@tillhub/schemas 6.319.0 → 6.320.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/v1/promotions/template/index.js +149 -37
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [6.320.0](https://github.com/tillhub/schemas/compare/v6.319.0...v6.320.0) (2024-06-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **promotion:** add new promotion type ([#968](https://github.com/tillhub/schemas/issues/968)) ([8ed6a0a](https://github.com/tillhub/schemas/commit/8ed6a0a))
|
|
7
|
+
|
|
1
8
|
# [6.319.0](https://github.com/tillhub/schemas/compare/v6.318.0...v6.319.0) (2024-06-17)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -17,14 +17,71 @@ module.exports = {
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
inputs: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
type: 'object',
|
|
21
|
+
required: [
|
|
22
|
+
'repeatable_promotable',
|
|
23
|
+
'promotable_product',
|
|
24
|
+
'bundle_junctions',
|
|
25
|
+
'output'
|
|
26
|
+
],
|
|
27
|
+
properties: {
|
|
28
|
+
repeatable_promotable: {
|
|
29
|
+
type: 'boolean'
|
|
30
|
+
},
|
|
31
|
+
promotable_product: {
|
|
32
|
+
required: ['property', 'value', 'qty'],
|
|
33
|
+
properties: {
|
|
34
|
+
property: {
|
|
35
|
+
type: 'string'
|
|
36
|
+
},
|
|
37
|
+
value: {
|
|
38
|
+
type: 'string'
|
|
39
|
+
},
|
|
40
|
+
qty: {
|
|
41
|
+
type: 'number'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
23
44
|
},
|
|
24
|
-
{
|
|
25
|
-
type: '
|
|
45
|
+
bundle_junctions: {
|
|
46
|
+
type: 'array',
|
|
47
|
+
uniqueItems: true,
|
|
48
|
+
additionalItems: false,
|
|
49
|
+
minItems: 2,
|
|
50
|
+
maxItems: 2,
|
|
51
|
+
items: {
|
|
52
|
+
required: ['type', 'property', 'value'],
|
|
53
|
+
properties: {
|
|
54
|
+
property: { // its only assumed that the property is id
|
|
55
|
+
type: 'string'
|
|
56
|
+
},
|
|
57
|
+
value: {
|
|
58
|
+
type: 'array'
|
|
59
|
+
},
|
|
60
|
+
qty: { // only needs for type = product
|
|
61
|
+
type: 'number'
|
|
62
|
+
},
|
|
63
|
+
type: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
enum: ['product', 'product_group']
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
output: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
required: ['property', 'value'],
|
|
73
|
+
properties: {
|
|
74
|
+
property: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
enum: ['amount_total_gross', 'percentage_discount', 'amount_discount']
|
|
77
|
+
|
|
78
|
+
},
|
|
79
|
+
value: {
|
|
80
|
+
type: 'number'
|
|
81
|
+
}
|
|
82
|
+
}
|
|
26
83
|
}
|
|
27
|
-
|
|
84
|
+
}
|
|
28
85
|
}
|
|
29
86
|
}
|
|
30
87
|
},
|
|
@@ -43,14 +100,71 @@ module.exports = {
|
|
|
43
100
|
]
|
|
44
101
|
},
|
|
45
102
|
inputs: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
103
|
+
type: 'object',
|
|
104
|
+
required: [
|
|
105
|
+
'repeatable_promotable',
|
|
106
|
+
'promotable_product',
|
|
107
|
+
'bundle_junctions',
|
|
108
|
+
'output'
|
|
109
|
+
],
|
|
110
|
+
properties: {
|
|
111
|
+
repeatable_promotable: {
|
|
112
|
+
type: 'boolean'
|
|
113
|
+
},
|
|
114
|
+
promotable_product: {
|
|
115
|
+
required: ['property', 'value', 'qty'],
|
|
116
|
+
properties: {
|
|
117
|
+
property: {
|
|
118
|
+
type: 'string'
|
|
119
|
+
},
|
|
120
|
+
value: {
|
|
121
|
+
type: 'string'
|
|
122
|
+
},
|
|
123
|
+
qty: {
|
|
124
|
+
type: 'number'
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
bundle_junctions: {
|
|
129
|
+
type: 'array',
|
|
130
|
+
maxItems: 1,
|
|
131
|
+
minItems: 1,
|
|
132
|
+
uniqueItems: true,
|
|
133
|
+
additionalItems: false,
|
|
134
|
+
items: {
|
|
135
|
+
required: ['type', 'property', 'value', 'qty'],
|
|
136
|
+
properties: {
|
|
137
|
+
property: {
|
|
138
|
+
type: 'string'
|
|
139
|
+
},
|
|
140
|
+
value: {
|
|
141
|
+
type: 'string'
|
|
142
|
+
},
|
|
143
|
+
qty: {
|
|
144
|
+
type: 'number'
|
|
145
|
+
},
|
|
146
|
+
type: {
|
|
147
|
+
type: 'string',
|
|
148
|
+
enum: ['product']
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
49
152
|
},
|
|
50
|
-
{
|
|
51
|
-
type: '
|
|
153
|
+
output: {
|
|
154
|
+
type: 'object',
|
|
155
|
+
required: ['property', 'value'],
|
|
156
|
+
properties: {
|
|
157
|
+
property: {
|
|
158
|
+
type: 'string',
|
|
159
|
+
enum: ['amount_total_gross', 'percentage_discount', 'amount_discount']
|
|
160
|
+
|
|
161
|
+
},
|
|
162
|
+
value: {
|
|
163
|
+
type: 'number'
|
|
164
|
+
}
|
|
165
|
+
}
|
|
52
166
|
}
|
|
53
|
-
|
|
167
|
+
}
|
|
54
168
|
}
|
|
55
169
|
}
|
|
56
170
|
},
|
|
@@ -71,39 +185,37 @@ module.exports = {
|
|
|
71
185
|
inputs: {
|
|
72
186
|
type: 'object',
|
|
73
187
|
required: [
|
|
74
|
-
'
|
|
75
|
-
'
|
|
188
|
+
'promotable_product',
|
|
189
|
+
'required_amount',
|
|
190
|
+
'promotable_product_group',
|
|
76
191
|
'output'
|
|
77
192
|
],
|
|
78
193
|
properties: {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
value: {
|
|
88
|
-
type: 'string'
|
|
89
|
-
}
|
|
194
|
+
promotable_product: {
|
|
195
|
+
required: ['property', 'value'],
|
|
196
|
+
properties: {
|
|
197
|
+
property: {
|
|
198
|
+
type: 'string'
|
|
199
|
+
},
|
|
200
|
+
value: {
|
|
201
|
+
type: 'array'
|
|
90
202
|
}
|
|
91
203
|
}
|
|
92
204
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
value: {
|
|
102
|
-
type: 'string'
|
|
103
|
-
}
|
|
205
|
+
promotable_product_group: {
|
|
206
|
+
required: ['property', 'value'],
|
|
207
|
+
properties: {
|
|
208
|
+
property: {
|
|
209
|
+
type: 'string'
|
|
210
|
+
},
|
|
211
|
+
value: {
|
|
212
|
+
type: 'array'
|
|
104
213
|
}
|
|
105
214
|
}
|
|
106
215
|
},
|
|
216
|
+
required_amount: {
|
|
217
|
+
type: 'number'
|
|
218
|
+
},
|
|
107
219
|
output: {
|
|
108
220
|
type: 'object',
|
|
109
221
|
required: ['property', 'value'],
|
|
@@ -114,7 +226,7 @@ module.exports = {
|
|
|
114
226
|
|
|
115
227
|
},
|
|
116
228
|
value: {
|
|
117
|
-
type: '
|
|
229
|
+
type: 'number'
|
|
118
230
|
}
|
|
119
231
|
}
|
|
120
232
|
}
|