Skip to content

Instantly share code, notes, and snippets.

@brh55
Last active November 8, 2019 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brh55/3324bee6dd4c285dda665f7e3e8bedc1 to your computer and use it in GitHub Desktop.
Save brh55/3324bee6dd4c285dda665f7e3e8bedc1 to your computer and use it in GitHub Desktop.
DB Notes

UI Renders List View

  • Location
    • Merchant.Thumbnail
    • Merchant.Name
    • Merchant.ID
    • Location.Name
    • Location.ID
    • Location.City
    • Location.State
    • Items.Name
    • Item.ID

Detail View (Merchant-Location ID) passed

  • Merchant.Location.Full_Address
  • Merchant.Location.Item_Name
  • Merchant.Location.Item_Variations
  • Item_Parent_Id (We need to know where it falls under)
    • Quantity
    • Description
    • Max Qty
    • Current Qty
    • Price

GSI:

GSI: MerchantCredentialIndex PK: Merchant ID, SK: Access Token

  • LocationDetails
  • ItemVariationByID (PK: Item_catalog_ID, SK: Item_variation_id)
  • LocationDetails (PK: Location ID, SK: Locality)
  • ItemPerLocation (PK: Location ID, SK: Item_Catalog) filter by Merchant ID for dups
  • MerchantDetails (Merchant ID, ?)

Item Schema:

  • Merchant Credentials

    • created_at
    • merchant_id (“PK”)
    • access_token
    • refresh_token
  • Location

    • merchant_id (“PK”)
    • location_id
    • Address
    • Address_line_1
    • Status
    • Locality
    • Name
    • City
    • State
    • Merchant Name
    • Thumbnail
  • Item

    • item_catalog_id
    • merchant_id (“PK”)
    • Name
    • Category_id
    • Description
    • Location_ID
  • Item Variation

    • item_variation_id
    • merchant_id (“PK”)
    • Name
    • Quantity
    • location_Id
    • State
    • created_at
{
    "TableName": “Merchant”,
    "IndexName": “MerchantCredentialIndex”,
    "KeyConditionExpression": “MerchantID = :merchant_id”,
    "ExpressionAttributeValues": {
        “:merchant_id”: {"S": “MERCHANT_ID1234”}
    },
    "ProjectionExpression": “Access_Token, Refresh_Token”,
    "ScanIndexForward": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment