Skip to content

Instantly share code, notes, and snippets.

@kwiest
Created November 20, 2019 01:40
Show Gist options
  • Save kwiest/95380165f20210e3bd959161fbf28e76 to your computer and use it in GitHub Desktop.
Save kwiest/95380165f20210e3bd959161fbf28e76 to your computer and use it in GitHub Desktop.
Poor Man's PIM
{"idempotency_key":"1475d547-7b0e-48c5-bd28-e74700a9d82a","batches":[{"objects":[{"item_data":{"name":"Kyle's Test Item","variations":[{"item_variation_data":{"pricing_type":"FIXED_PRICING","location_overrides":[{"location_id":"WMYW60XEVK9MD","track_inventory":true,"price_money":{"amount":550,"currency":"USD"}}],"name":"Hayes Valley","price_money":{"amount":450,"currency":"USD"}},"present_at_location_ids":["WMYW60XEVK9MD","S7CWFDJ0Y3PD5"],"present_at_all_locations":false,"id":"#Hayes Valley","type":"ITEM_VARIATION"}]},"id":"#Kyle's Test Item","type":"ITEM"}]}]}
-- Poor Man's PIM Menu
let Location = ./Location/package.dhall
let Money = ./Money/package.dhall
let Product = ./Product/package.dhall
let locations = ./locations.dhall
let taxCategories = ./taxCategories.dhall
in
[
{ id = None Text
, name = "Kyle's Test Item"
, tagline = "That one thing."
, description = "A test item. Super delicious."
, preparation = Some Product.PreparationMethod.Drip
, calorieMin = 60
, calorieMax = 120
, station = Product.Station.Drip
, taxCategories = [ taxCategories.hotBeverage
]
, variants = [ { id = None Text
, name = "Hayes Valley"
, sku = "PRD-HVE"
, modifiers = [ Product.ModifierCategory.SplashOfMilk
, Product.ModifierCategory.Caffeine
]
, locations = locations.all
, price = { cents = 450, ccy = Money.Currency.USD }
, overrides = [ { location = locations.techSandbox
, price = { cents = 550, ccy = Money.Currency.USD }
}
]
}
]
}
]
{
"objects": [
{
"type": "ITEM",
"id": "4LUGEYLASUR7FNVCCO3NA573",
"updated_at": "2019-11-20T01:37:26.067Z",
"version": 1574213846067,
"is_deleted": false,
"present_at_all_locations": true,
"item_data": {
"name": "Kyle's Test Item",
"variations": [
{
"type": "ITEM_VARIATION",
"id": "YS6IMW27HW2NHBPDP3LTNLOQ",
"updated_at": "2019-11-20T01:37:26.067Z",
"version": 1574213846067,
"is_deleted": false,
"present_at_all_locations": false,
"present_at_location_ids": [
"S7CWFDJ0Y3PD5",
"WMYW60XEVK9MD"
],
"item_variation_data": {
"item_id": "4LUGEYLASUR7FNVCCO3NA573",
"name": "Hayes Valley",
"ordinal": 0,
"pricing_type": "FIXED_PRICING",
"price_money": {
"amount": 450,
"currency": "USD"
},
"location_overrides": [
{
"location_id": "WMYW60XEVK9MD",
"price_money": {
"amount": 550,
"currency": "USD"
},
"track_inventory": true
}
]
}
}
],
"product_type": "REGULAR"
}
}
],
"id_mappings": [
{
"client_object_id": "#Kyle's Test Item",
"object_id": "4LUGEYLASUR7FNVCCO3NA573"
},
{
"client_object_id": "#Hayes Valley",
"object_id": "YS6IMW27HW2NHBPDP3LTNLOQ"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment