Last active
January 8, 2019 23:08
-
-
Save innerdaze/25bfe52a564424eec0a57944a5e624d0 to your computer and use it in GitHub Desktop.
Promotion JSON spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enums | |
enum PROMOTION_TYPES { | |
GENERIC, | |
??? | |
} | |
enum PROMOTION_PART_TYPES { | |
TITLE, | |
PLAIN_TEXT, | |
RICH_TEXT, | |
ICON, | |
IMAGE, | |
BARCODE | |
} | |
// Types | |
{ | |
_id: UUID_V4, | |
type: PROMOTION_TYPES, | |
layouts { | |
string [{ | |
_id: UUID_V4, | |
part: UUID_V4 | |
}], | |
string [{ | |
_id: UUID_V4, | |
part: UUID_V4 | |
}] | |
}, | |
parts { | |
UUID_V4 { | |
_id: UUID_V4, | |
type: PROMOTION_PART_TYPES, | |
value: * | |
} | |
} | |
} | |
// Example Promotion | |
[{ | |
"_id": "af5ade44-8940-46b6-b183-04576e902f84", | |
"type": PROMOTION_TYPES.GENERIC, | |
"layouts": { | |
"summary": [{ | |
// Icon | |
"_id": "8292966d-13ca-43e8-940d-f92f2946898a", | |
"part": "4b74481a-5e60-4220-aa7e-9bb70c9dc981" | |
}, { | |
// Title | |
"_id": "5f1f76d5-dce2-4494-bb32-14d4172e036b", | |
"part": "dcc1a5fc-c02c-4b4b-ab68-5d1520382fc9" | |
}, { | |
// Image | |
"_id": "235e0d5c-418b-4041-b0cf-623bc2ef9148", | |
"part": "95363507-3e30-41cb-b36a-b5f8adf1b093" | |
}, { | |
// Short description | |
"_id": "aad07e13-71ef-4ff8-9fce-c06b484b747d", | |
"part": "d06660f7-d580-4845-a1a7-bb289ff8a837" | |
}], | |
"detail": [{ | |
// Title (repeated) | |
"_id": "0b6632cf-9e51-46b7-a938-d68ab127286c", | |
"part": "dcc1a5fc-c02c-4b4b-ab68-5d1520382fc9" | |
}, { | |
// Image (repeated) | |
"_id": "9ebc50f2-18ea-438e-9bf8-5ff7508ef7ee", | |
"part": "95363507-3e30-41cb-b36a-b5f8adf1b093" | |
}, { | |
// Long Description | |
"_id": "6930323d-bfdd-4c35-bbac-9674cae4e79b", | |
"part": "4cdb9ce8-9e36-4483-a272-e9446718c9f8" | |
}, { | |
// Barcode | |
"_id": "af3ab23e-c53e-4a9c-8b3a-3f9ded417a34", | |
"part": "95363507-3e30-41cb-b36a-b5f8adf1b093" | |
}] | |
}, | |
"parts": [{ | |
"_id": "dcc1a5fc-c02c-4b4b-ab68-5d1520382fc9", | |
"type": PROMOTION_PART_TYPES.TITLE, | |
"value": "Save on servicing" | |
}, { | |
"_id": "d06660f7-d580-4845-a1a7-bb289ff8a837", | |
"type": PROMOTION_PART_TYPES.PLAIN_TEXT, | |
"value": "Buy selected Mobil1 Synthetic Engine Oil products and claim a voucher towards your next service" | |
}, { | |
"_id": "4b74481a-5e60-4220-aa7e-9bb70c9dc981", | |
"type": PROMOTION_PART_TYPES.ICON, | |
"value": <BASE 64 ENCODED IMAGE> | |
}, { | |
"_id": "4cdb9ce8-9e36-4483-a272-e9446718c9f8", | |
"type": PROMOTION_PART_TYPES.RICH_TEXT, | |
"value": "<p>Fuel discounts are redeemable at participating stations only. Ask in store for further information.</p>" | |
}, { | |
"_id": "95363507-3e30-41cb-b36a-b5f8adf1b093", | |
"type": PROMOTION_PART_TYPES.IMAGE, | |
"value": <BASE 64 ENCODED IMAGE> | |
}, { | |
"_id": "95363507-3e30-41cb-b36a-b5f8adf1b093", | |
"type": PROMOTION_PART_TYPES.BARCODE, | |
"value": "741932508443" | |
}] | |
}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment