@tillhub/schemas 6.314.0 → 6.316.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 +14 -0
- package/lib/v1/index.js +1 -0
- package/lib/v1/promotions/base.js +91 -0
- package/lib/v1/promotions/constraints/index.js +12 -0
- package/lib/v1/promotions/create.js +26 -0
- package/lib/v1/promotions/default-response.js +17 -0
- package/lib/v1/promotions/index.js +2 -0
- package/lib/v1/promotions/template/index.js +58 -0
- package/lib/v1/promotions/update.js +22 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [6.316.0](https://github.com/tillhub/schemas/compare/v6.315.0...v6.316.0) (2024-06-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **promotion:** defining promotion v1 ([#962](https://github.com/tillhub/schemas/issues/962)) ([c8ed835](https://github.com/tillhub/schemas/commit/c8ed835))
|
|
7
|
+
|
|
8
|
+
# [6.315.0](https://github.com/tillhub/schemas/compare/v6.314.0...v6.315.0) (2024-06-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **promotion:** defining promotion v1 ([#961](https://github.com/tillhub/schemas/issues/961)) ([8b3e5cd](https://github.com/tillhub/schemas/commit/8b3e5cd))
|
|
14
|
+
|
|
1
15
|
# [6.314.0](https://github.com/tillhub/schemas/compare/v6.313.1...v6.314.0) (2024-06-06)
|
|
2
16
|
|
|
3
17
|
|
package/lib/v1/index.js
CHANGED
|
@@ -11,5 +11,6 @@ module.exports.registers = require('./registers')
|
|
|
11
11
|
module.exports.templates = require('./templates')
|
|
12
12
|
module.exports.transactions = require('./transactions')
|
|
13
13
|
module.exports.statuses = require('./statuses')
|
|
14
|
+
module.exports.promotions = require('./promotions')
|
|
14
15
|
|
|
15
16
|
// hygen:injection - Please, don't delete this line: when running the cli for schema resources the new routes will be automatically added here.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const { oneOf } = require('../../helpers/payload-or-null')
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
name: {
|
|
5
|
+
...oneOf([{
|
|
6
|
+
type: 'string',
|
|
7
|
+
minLength: 1,
|
|
8
|
+
maxLength: 255
|
|
9
|
+
}])
|
|
10
|
+
},
|
|
11
|
+
description: {
|
|
12
|
+
...oneOf([{
|
|
13
|
+
type: 'string',
|
|
14
|
+
minLength: 1,
|
|
15
|
+
maxLength: 1024
|
|
16
|
+
}])
|
|
17
|
+
},
|
|
18
|
+
type: {
|
|
19
|
+
description: 'The type of the promotion function',
|
|
20
|
+
type: 'string',
|
|
21
|
+
enum: [
|
|
22
|
+
'cart_map_function'
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
metadata: {
|
|
26
|
+
...oneOf({
|
|
27
|
+
type: 'object'
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
arguments: {
|
|
31
|
+
...oneOf({
|
|
32
|
+
type: 'array',
|
|
33
|
+
items: {
|
|
34
|
+
type: 'string'
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
},
|
|
38
|
+
locations: {
|
|
39
|
+
...oneOf({
|
|
40
|
+
type: 'array',
|
|
41
|
+
items: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
format: 'uuid'
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
client_id: {
|
|
48
|
+
description: 'A identifier used locally on POS for their own reference.',
|
|
49
|
+
...oneOf([{
|
|
50
|
+
type: 'string',
|
|
51
|
+
minLength: 1,
|
|
52
|
+
maxLength: 128
|
|
53
|
+
}])
|
|
54
|
+
},
|
|
55
|
+
deleted: {
|
|
56
|
+
type: 'boolean',
|
|
57
|
+
default: false
|
|
58
|
+
},
|
|
59
|
+
active: {
|
|
60
|
+
type: 'boolean',
|
|
61
|
+
default: true
|
|
62
|
+
},
|
|
63
|
+
template: {
|
|
64
|
+
...require('./template')
|
|
65
|
+
},
|
|
66
|
+
constraints: {
|
|
67
|
+
...oneOf(require('./constraints'))
|
|
68
|
+
},
|
|
69
|
+
branch_groups: {
|
|
70
|
+
...oneOf({
|
|
71
|
+
type: 'array',
|
|
72
|
+
items: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
format: 'uuid'
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
},
|
|
78
|
+
version: oneOf({
|
|
79
|
+
type: 'integer',
|
|
80
|
+
description: 'The version number of the promotion. Version 1 is deprecated, current version is 2',
|
|
81
|
+
example: 2,
|
|
82
|
+
minimum: 1
|
|
83
|
+
}),
|
|
84
|
+
barcode: {
|
|
85
|
+
description: 'The barcode used to trigger the promotion',
|
|
86
|
+
example: '0E9761310XF',
|
|
87
|
+
...oneOf({
|
|
88
|
+
type: 'string'
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const { oneOf } = require('../../../helpers/payload-or-null')
|
|
2
|
+
const { timeConstraints } = require('../../../common/time_constraints')
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
type: 'object',
|
|
6
|
+
additionalProperties: false,
|
|
7
|
+
properties: {
|
|
8
|
+
time: oneOf({
|
|
9
|
+
...timeConstraints
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const base = require('./base')
|
|
2
|
+
const defaultResponse = require('./default-response')
|
|
3
|
+
|
|
4
|
+
module.exports.request = {
|
|
5
|
+
$id: 'https://schemas.tillhub.com/v0/promotions.create.request.schema.json',
|
|
6
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
7
|
+
additionalProperties: false,
|
|
8
|
+
type: 'object',
|
|
9
|
+
required: [
|
|
10
|
+
'name',
|
|
11
|
+
'template',
|
|
12
|
+
'type'
|
|
13
|
+
],
|
|
14
|
+
properties: base
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports.response = {
|
|
18
|
+
$id: 'https://schemas.tillhub.com/v0/promotions.create.response.schema.json',
|
|
19
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
20
|
+
additionalProperties: true,
|
|
21
|
+
type: 'object',
|
|
22
|
+
required: [
|
|
23
|
+
'id'
|
|
24
|
+
],
|
|
25
|
+
properties: defaultResponse
|
|
26
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
$id: 'https://schemas.tillhub.com/v0/promotions.templates.schema.json',
|
|
3
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
4
|
+
oneOf: [
|
|
5
|
+
{
|
|
6
|
+
additionalProperties: false,
|
|
7
|
+
type: 'object',
|
|
8
|
+
required: [
|
|
9
|
+
'inputs',
|
|
10
|
+
'type'
|
|
11
|
+
],
|
|
12
|
+
properties: {
|
|
13
|
+
type: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
enum: [
|
|
16
|
+
'product_property:and_or_concat:output_properties'
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
inputs: {
|
|
20
|
+
oneOf: [
|
|
21
|
+
{
|
|
22
|
+
type: 'object'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'null'
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
additionalProperties: false,
|
|
33
|
+
type: 'object',
|
|
34
|
+
required: [
|
|
35
|
+
'inputs',
|
|
36
|
+
'type'
|
|
37
|
+
],
|
|
38
|
+
properties: {
|
|
39
|
+
type: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
enum: [
|
|
42
|
+
'product_property:exclusive_bundle:output_properties'
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
inputs: {
|
|
46
|
+
oneOf: [
|
|
47
|
+
{
|
|
48
|
+
type: 'object'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'null'
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const base = require('./base')
|
|
2
|
+
const defaultResponse = require('./default-response')
|
|
3
|
+
|
|
4
|
+
module.exports.request = {
|
|
5
|
+
$id: 'https://schemas.tillhub.com/v0/promotions.update.request.schema.json',
|
|
6
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
7
|
+
additionalProperties: false,
|
|
8
|
+
type: 'object',
|
|
9
|
+
required: [],
|
|
10
|
+
properties: base
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports.response = {
|
|
14
|
+
$id: 'https://schemas.tillhub.com/v0/promotions.update.response.schema.json',
|
|
15
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
16
|
+
additionalProperties: true,
|
|
17
|
+
type: 'object',
|
|
18
|
+
required: [
|
|
19
|
+
'id'
|
|
20
|
+
],
|
|
21
|
+
properties: defaultResponse
|
|
22
|
+
}
|