-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscount.schema.json
60 lines (60 loc) · 2.18 KB
/
discount.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
"meta:license": [
"Copyright 2017 Adobe Systems Incorporated. All rights reserved.",
"This work is licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0) license",
"you may not use this file except in compliance with the License. You may obtain a copy",
"of the License at https://creativecommons.org/licenses/by/4.0/"
],
"$id": "https://ns.adobe.com/xdm/data/discount",
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Discount",
"type": "object",
"description":
"This is an offer from the supplier to the purchaser, to reduce the payment amount if the payment is made within a certain period of time.",
"definitions": {
"discount": {
"properties": {
"schema:description": {
"title": "Description",
"description": "Describes the discounting rules in detail. ",
"type": "string"
},
"xdm:code": {
"title": "Code",
"type": "string",
"description":
"The description of the discountValue attribute. e.g percentage, currency, 3for2 etc. Can be enumerated, custom values allowed.",
"meta:enum": {
"bogo": "Buy one, get one free",
"bogoho": "Buy one, get one half off",
"3for2": "Three for the price of two",
"3fixed": "Any three items for a fixed price",
"voucher":
"Save `xdm:value` when you spend more than `xdm:condition`",
"fixed": "Fixed amount off",
"percentage": "Percentage amount off",
"shipping": "Free shipping"
}
},
"xdm:value": {
"title": "Value",
"type": "number",
"description":
"If the discount description indicates a percentage or similar formulaic value, it is represented here, can be percentage or currency amount."
},
"xdm:condition": {
"title": "Condition",
"description":
"The minimum amount of items or price for the dicount to qualify"
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/discount"
}
],
"required": ["xdm:code"],
"meta:status": "experimental"
}