@tillhub/schemas 6.119.0 → 6.122.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 +26 -0
- package/lib/common/address.js +67 -82
- package/lib/common/base.js +3 -0
- package/lib/common/images.js +63 -0
- package/lib/common/query.js +64 -0
- package/lib/common/response.js +10 -9
- package/lib/v0/branches/base.js +55 -63
- package/lib/v0/branches/create.js +18 -0
- package/lib/v0/branches/index.js +1 -0
- package/lib/v0/branches/read.js +119 -0
- package/lib/v0/branches/update.js +18 -0
- package/lib/v0/customers/base.js +352 -576
- package/lib/v0/customers/baseExt.js +35 -0
- package/lib/v0/customers/create.js +41 -0
- package/lib/v0/customers/ext.js +113 -7
- package/lib/v0/customers/index.js +18 -50
- package/lib/v0/customers/properties/anaylytics.js +7 -7
- package/lib/v0/customers/read.js +42 -0
- package/lib/v0/customers/update.js +30 -0
- package/lib/v0/deliveries/base.js +3 -3
- package/lib/v0/orders/create.request.js +3 -3
- package/lib/v0/pdfs/templates.deliveries.create.request.js +3 -7
- package/lib/v0/pdfs/templates.delivery_notes.create.request.js +3 -7
- package/lib/v0/pdfs/templates.full_receipts.create.request.js +3 -7
- package/lib/v0/pdfs/templates.invoices.create.request.js +3 -7
- package/lib/v0/pdfs/templates.transaction_receipts.create.request.js +3 -7
- package/lib/v1/branches/index.js +1 -0
- package/lib/v1/branches/read.js +16 -0
- package/lib/v1/carts/base.js +182 -0
- package/lib/v1/carts/create.js +30 -0
- package/lib/v1/carts/index.js +3 -8
- package/lib/v1/carts/items/create.js +150 -227
- package/lib/v1/carts/patch.js +29 -0
- package/lib/v1/carts/read.js +54 -0
- package/lib/v1/index.js +6 -5
- package/package.json +1 -1
- package/test/branches/branches.v0.spec.js +50 -11
- package/test/branches/branches.v1.spec.js +19 -0
- package/test/carts/carts.v1.spec.js +46 -6
- package/test/customers/customers.v0.spec.js +93 -5
- package/lib/v0/customers/create.request.js +0 -24
- package/lib/v0/customers/update.request.js +0 -14
- package/lib/v1/carts/create.request.js +0 -268
- package/lib/v1/carts/patch.request.js +0 -259
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [6.122.0](https://github.com/tillhub/schemas/compare/v6.121.0...v6.122.0) (2022-02-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **carts:** add detailed schema #API-1394 ([#673](https://github.com/tillhub/schemas/issues/673)) ([774c03b](https://github.com/tillhub/schemas/commit/774c03b)), closes [#API-1394](https://github.com/tillhub/schemas/issues/API-1394) [#API-1394](https://github.com/tillhub/schemas/issues/API-1394)
|
|
7
|
+
|
|
8
|
+
# [6.121.0](https://github.com/tillhub/schemas/compare/v6.120.0...v6.121.0) (2022-02-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **tests:** remove require() errors ([f2b6a16](https://github.com/tillhub/schemas/commit/f2b6a16))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **customers:** add rmissing schemas #API-1393 ([#672](https://github.com/tillhub/schemas/issues/672)) ([a4b8f30](https://github.com/tillhub/schemas/commit/a4b8f30)), closes [#API-1393](https://github.com/tillhub/schemas/issues/API-1393) [#API-1393](https://github.com/tillhub/schemas/issues/API-1393)
|
|
19
|
+
|
|
20
|
+
# [6.120.0](https://github.com/tillhub/schemas/compare/v6.119.0...v6.120.0) (2022-02-17)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* **branches:** add detailed branches schema #API-1392 ([#671](https://github.com/tillhub/schemas/issues/671)) ([3232d2b](https://github.com/tillhub/schemas/commit/3232d2b)), closes [#API-1392](https://github.com/tillhub/schemas/issues/API-1392) [#API-1392](https://github.com/tillhub/schemas/issues/API-1392)
|
|
26
|
+
|
|
1
27
|
# [6.119.0](https://github.com/tillhub/schemas/compare/v6.118.1...v6.119.0) (2022-02-15)
|
|
2
28
|
|
|
3
29
|
|
package/lib/common/address.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
required
|
|
1
|
+
const { oneOf } = require('../helpers/payload-or-null')
|
|
2
|
+
|
|
3
|
+
function getAddress ({
|
|
4
|
+
required = [
|
|
5
5
|
'lines',
|
|
6
6
|
'street',
|
|
7
7
|
'locality',
|
|
@@ -10,10 +10,21 @@ module.exports = {
|
|
|
10
10
|
'country',
|
|
11
11
|
'type'
|
|
12
12
|
],
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
availableTypes = [
|
|
14
|
+
'local',
|
|
15
|
+
'delivery',
|
|
16
|
+
'billing'
|
|
17
|
+
]
|
|
18
|
+
} = {}) {
|
|
19
|
+
return {
|
|
20
|
+
type: 'object',
|
|
21
|
+
additionalProperties: false,
|
|
22
|
+
required,
|
|
23
|
+
properties: {
|
|
24
|
+
lines: {
|
|
25
|
+
description: 'Address details',
|
|
26
|
+
example: 'Penthouse',
|
|
27
|
+
...oneOf({
|
|
17
28
|
type: 'array',
|
|
18
29
|
minItems: 1,
|
|
19
30
|
maxItems: 4,
|
|
@@ -21,91 +32,65 @@ module.exports = {
|
|
|
21
32
|
type: 'string',
|
|
22
33
|
minLength: 1
|
|
23
34
|
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
street: {
|
|
31
|
-
oneOf: [
|
|
32
|
-
{
|
|
35
|
+
})
|
|
36
|
+
},
|
|
37
|
+
street: {
|
|
38
|
+
description: 'Street name',
|
|
39
|
+
example: 'Genthiner Str.',
|
|
40
|
+
...oneOf({
|
|
33
41
|
type: 'string'
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
street_number: {
|
|
41
|
-
oneOf: [
|
|
42
|
-
{
|
|
42
|
+
})
|
|
43
|
+
},
|
|
44
|
+
street_number: {
|
|
45
|
+
description: 'Building number',
|
|
46
|
+
example: '34',
|
|
47
|
+
...oneOf({
|
|
43
48
|
type: 'string'
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
locality: {
|
|
51
|
-
oneOf: [
|
|
52
|
-
{
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
locality: {
|
|
52
|
+
description: 'Locality name (city, village, etc.)',
|
|
53
|
+
example: 'Berlin',
|
|
54
|
+
...oneOf({
|
|
53
55
|
type: 'string'
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
region: {
|
|
61
|
-
oneOf: [
|
|
62
|
-
{
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
region: {
|
|
59
|
+
description: 'Region name',
|
|
60
|
+
example: 'Branderburg',
|
|
61
|
+
...oneOf({
|
|
63
62
|
type: 'string'
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
postal_code: {
|
|
71
|
-
oneOf: [
|
|
72
|
-
{
|
|
63
|
+
})
|
|
64
|
+
},
|
|
65
|
+
postal_code: {
|
|
66
|
+
description: 'Postal code',
|
|
67
|
+
example: '10785',
|
|
68
|
+
...oneOf({
|
|
73
69
|
type: 'string',
|
|
74
70
|
maxLength: 10
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
country: {
|
|
82
|
-
oneOf: [
|
|
83
|
-
{
|
|
71
|
+
})
|
|
72
|
+
},
|
|
73
|
+
country: {
|
|
74
|
+
description: 'Country',
|
|
75
|
+
example: 'Germany',
|
|
76
|
+
...oneOf({
|
|
84
77
|
type: 'string',
|
|
85
78
|
minLength: 2,
|
|
86
79
|
maxLength: 2,
|
|
87
80
|
pattern: '^[A-Z]{2}$'
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
type: {
|
|
96
|
-
oneOf: [
|
|
97
|
-
{
|
|
81
|
+
}),
|
|
82
|
+
'default': null
|
|
83
|
+
},
|
|
84
|
+
type: {
|
|
85
|
+
description: 'Address type',
|
|
86
|
+
example: 'delivery',
|
|
87
|
+
...oneOf({
|
|
98
88
|
type: 'string',
|
|
99
|
-
'enum':
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
'billing'
|
|
103
|
-
]
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
type: 'null'
|
|
107
|
-
}
|
|
108
|
-
]
|
|
89
|
+
'enum': availableTypes
|
|
90
|
+
})
|
|
91
|
+
}
|
|
109
92
|
}
|
|
110
93
|
}
|
|
111
94
|
}
|
|
95
|
+
|
|
96
|
+
module.exports = { getAddress }
|
package/lib/common/base.js
CHANGED
|
@@ -5,16 +5,19 @@
|
|
|
5
5
|
function baseObject (options = {}) {
|
|
6
6
|
return {
|
|
7
7
|
id: {
|
|
8
|
+
description: 'Unique entity ID',
|
|
8
9
|
type: 'string',
|
|
9
10
|
format: 'uuid',
|
|
10
11
|
example: '936835f7-2d75-41d2-9001-38ed6e458328'
|
|
11
12
|
},
|
|
12
13
|
created_at: {
|
|
14
|
+
description: 'The date and time entity was created',
|
|
13
15
|
type: 'string',
|
|
14
16
|
format: 'date-time',
|
|
15
17
|
example: '2019-03-17T21:12:04.849Z'
|
|
16
18
|
},
|
|
17
19
|
updated_at: {
|
|
20
|
+
description: 'The date and time entity was updated',
|
|
18
21
|
type: 'string',
|
|
19
22
|
format: 'date-time',
|
|
20
23
|
example: '2019-03-17T21:12:04.849Z'
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const definedSizes = {
|
|
2
|
+
'1x': {
|
|
3
|
+
description: 'Image transformed to predefined small size',
|
|
4
|
+
example: 'https://my-storage.io/images/f5a3cc72-7fb5-4d2c-bda5-9b2983c7e879_1x.png',
|
|
5
|
+
type: 'string',
|
|
6
|
+
format: 'uri'
|
|
7
|
+
},
|
|
8
|
+
'2x': {
|
|
9
|
+
description: 'Image transformed to predefined medium size',
|
|
10
|
+
example: 'https://my-storage.io/images/f5a3cc72-7fb5-4d2c-bda5-9b2983c7e879_2x.png',
|
|
11
|
+
type: 'string',
|
|
12
|
+
format: 'uri'
|
|
13
|
+
},
|
|
14
|
+
'3x': {
|
|
15
|
+
description: 'Image transformed to predefined big size',
|
|
16
|
+
example: 'https://my-storage.io/images/f5a3cc72-7fb5-4d2c-bda5-9b2983c7e879_1x.png',
|
|
17
|
+
type: 'string',
|
|
18
|
+
format: 'uri'
|
|
19
|
+
},
|
|
20
|
+
gallery: {
|
|
21
|
+
description: 'Image transformed to predefined size to use in gallery',
|
|
22
|
+
example: 'https://my-storage.io/images/f5a3cc72-7fb5-4d2c-bda5-9b2983c7e879_gallery.png',
|
|
23
|
+
type: 'string',
|
|
24
|
+
format: 'uri'
|
|
25
|
+
},
|
|
26
|
+
avatar: {
|
|
27
|
+
description: 'Image transformed to predefined size to use as "avatar"',
|
|
28
|
+
example: 'https://my-storage.io/images/f5a3cc72-7fb5-4d2c-bda5-9b2983c7e879_avatar.png',
|
|
29
|
+
type: 'string',
|
|
30
|
+
format: 'uri'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function getImages (sizes = ['1x', '2x', '3x', 'avatar'], strict = false) {
|
|
35
|
+
const sizesMap = sizes.reduce((memo, size) => {
|
|
36
|
+
if (!definedSizes[size]) {
|
|
37
|
+
throw new ReferenceError(`Size '${size}' is not defined`)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
memo[size] = { ...definedSizes[size] }
|
|
41
|
+
return memo
|
|
42
|
+
}, {})
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
description: 'Images object with URLs of various types of images',
|
|
46
|
+
anyOf: [{
|
|
47
|
+
type: 'object',
|
|
48
|
+
additionalProperties: !strict,
|
|
49
|
+
properties: {
|
|
50
|
+
...sizesMap,
|
|
51
|
+
original: {
|
|
52
|
+
description: 'Original image',
|
|
53
|
+
example: 'https://my-storage.io/images/f5a3cc72-7fb5-4d2c-bda5-9b2983c7e879.png',
|
|
54
|
+
type: 'string',
|
|
55
|
+
format: 'uri'
|
|
56
|
+
}
|
|
57
|
+
} }, {
|
|
58
|
+
type: 'null'
|
|
59
|
+
}]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
module.exports = { getImages }
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const standardParams = {
|
|
2
|
+
start: {
|
|
3
|
+
description: 'The start date to filter entities by "updated_at" field value',
|
|
4
|
+
example: '2022-02-01T00:00:00.000Z',
|
|
5
|
+
type: 'string',
|
|
6
|
+
format: 'date-time'
|
|
7
|
+
},
|
|
8
|
+
end: {
|
|
9
|
+
description: 'The end date to filter entities by "updated_at" field value',
|
|
10
|
+
example: '2022-02-28T23:59:59.999Z',
|
|
11
|
+
type: 'string',
|
|
12
|
+
format: 'date-time'
|
|
13
|
+
},
|
|
14
|
+
limit: {
|
|
15
|
+
description: 'The maximum amount of entries on page (for paginated output)',
|
|
16
|
+
example: 50,
|
|
17
|
+
type: 'integer',
|
|
18
|
+
minimum: 1
|
|
19
|
+
},
|
|
20
|
+
active: {
|
|
21
|
+
description: 'Filter entities by "active" field value',
|
|
22
|
+
example: 'true',
|
|
23
|
+
type: 'string',
|
|
24
|
+
enum: ['true', 'false']
|
|
25
|
+
},
|
|
26
|
+
deleted: {
|
|
27
|
+
description: 'Filter entities which are deleted or not',
|
|
28
|
+
example: 'true',
|
|
29
|
+
type: 'string',
|
|
30
|
+
enum: ['true', 'false']
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Generate a common query for entities set
|
|
36
|
+
* @param {Object} required Required fields to restrict the amount of entries
|
|
37
|
+
*/
|
|
38
|
+
function getQuery ({
|
|
39
|
+
standard = ['start', 'end'],
|
|
40
|
+
required = ['start', 'end'],
|
|
41
|
+
additional = {}
|
|
42
|
+
} = {}) {
|
|
43
|
+
const properties = standard.reduce((memo, paramName) => {
|
|
44
|
+
if (!standardParams[paramName]) {
|
|
45
|
+
throw new ReferenceError(`Parameter '${paramName}' is not standard`)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
memo[paramName] = { ...standardParams[paramName] }
|
|
49
|
+
|
|
50
|
+
return memo
|
|
51
|
+
}, {})
|
|
52
|
+
|
|
53
|
+
Object.assign(properties, additional)
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
57
|
+
additionalProperties: false,
|
|
58
|
+
type: 'object',
|
|
59
|
+
required,
|
|
60
|
+
properties
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
module.exports = getQuery
|
package/lib/common/response.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
const cursor = {
|
|
2
2
|
type: 'object',
|
|
3
|
+
description: 'Optional cursor in paginated API calls. The cursor next field must be called as fully quantifiable URI in order to hit the next if available.',
|
|
3
4
|
additionalProperties: false,
|
|
4
|
-
|
|
5
|
+
required: ['self'],
|
|
5
6
|
properties: {
|
|
6
7
|
next: {
|
|
7
8
|
type: 'string',
|
|
8
9
|
format: 'uri',
|
|
9
10
|
description: 'The URI pointing to the next page.',
|
|
10
|
-
example: 'https://api.tillhub.com/api/v1/products/061f91a3-eba2-40b8-9a76-115189d6741e?
|
|
11
|
+
example: 'https://api.tillhub.com/api/v1/products/061f91a3-eba2-40b8-9a76-115189d6741e?cursor=2018-07-02T21%3A47%3A44.382Z&size=10&cursor_field=updated_at'
|
|
11
12
|
},
|
|
12
13
|
first: {
|
|
13
14
|
type: 'string',
|
|
14
15
|
format: 'uri',
|
|
15
16
|
description: 'The URI pointing to the the first page.',
|
|
16
|
-
example: 'https://api.tillhub.com/api/v1/products/061f91a3-eba2-40b8-9a76-115189d6741e?
|
|
17
|
+
example: 'https://api.tillhub.com/api/v1/products/061f91a3-eba2-40b8-9a76-115189d6741e?cursor=2018-07-02T21%3A47%3A44.382Z&size=10&cursor_field=updated_at'
|
|
17
18
|
},
|
|
18
19
|
self: {
|
|
19
20
|
type: 'string',
|
|
20
21
|
format: 'uri',
|
|
21
22
|
description: 'The URI pointing to this page.',
|
|
22
|
-
example: 'https://api.tillhub.com/api/v1/products/061f91a3-eba2-40b8-9a76-115189d6741e?
|
|
23
|
+
example: 'https://api.tillhub.com/api/v1/products/061f91a3-eba2-40b8-9a76-115189d6741e?cursor=2018-07-02T21%3A47%3A44.382Z&size=10&cursor_field=updated_at'
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
}
|
|
@@ -47,14 +48,14 @@ function commonResponse ({ resultItems, results, additionals } = {}, { hasCursor
|
|
|
47
48
|
msg: {
|
|
48
49
|
type: 'string',
|
|
49
50
|
minLength: 1,
|
|
50
|
-
example: 'Queried transactions
|
|
51
|
-
description: 'Any English sentence, meant as information for developers and implementers. Avoid displaying this to the users and especially do not expect
|
|
51
|
+
example: 'Queried transactions successfully.',
|
|
52
|
+
description: 'Any English sentence, meant as information for developers and implementers. Avoid displaying this to the users and especially do not expect those messages to stay stable.'
|
|
52
53
|
},
|
|
53
54
|
msg_localised: {
|
|
55
|
+
description: 'Optional localized message that can be displayed to the user if existing. The language can be set by in the request or will fallback to English.',
|
|
56
|
+
example: 'Abgefragte Transaktionen erfolgreich.',
|
|
54
57
|
type: 'string',
|
|
55
|
-
minLength: 1
|
|
56
|
-
example: 'Queried transactions sucessefully.',
|
|
57
|
-
description: 'Optional localised message that can be displayed to the user if existing. The language can be set by in the request or will fallback to English.'
|
|
58
|
+
minLength: 1
|
|
58
59
|
},
|
|
59
60
|
request: {
|
|
60
61
|
type: 'object',
|
package/lib/v0/branches/base.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
const customProperties = require('../../common/custom_properties')
|
|
2
1
|
const { stripIndents } = require('common-tags')
|
|
2
|
+
const customProperties = require('../../common/custom_properties')
|
|
3
|
+
const { getImages } = require('../../common/images')
|
|
3
4
|
|
|
4
5
|
module.exports = {
|
|
5
6
|
name: {
|
|
6
|
-
description: '
|
|
7
|
+
description: 'Any arbitrary name for a branch that can be displayed in applications.',
|
|
8
|
+
example: 'Head office',
|
|
7
9
|
anyOf: [
|
|
8
10
|
{
|
|
9
11
|
type: 'string',
|
|
@@ -16,17 +18,19 @@ module.exports = {
|
|
|
16
18
|
]
|
|
17
19
|
},
|
|
18
20
|
phonenumbers: {
|
|
19
|
-
description: 'A number of valid types of
|
|
21
|
+
description: 'A number of valid types of phone numbers for a branch.',
|
|
20
22
|
anyOf: [
|
|
21
23
|
{
|
|
22
24
|
type: 'object',
|
|
23
25
|
additionalProperties: false,
|
|
24
26
|
properties: {
|
|
25
27
|
line_main: {
|
|
26
|
-
type: 'string'
|
|
28
|
+
type: 'string',
|
|
29
|
+
example: '+49-555-1976'
|
|
27
30
|
},
|
|
28
31
|
line_1: {
|
|
29
|
-
type: 'string'
|
|
32
|
+
type: 'string',
|
|
33
|
+
example: '+49-555-1977'
|
|
30
34
|
},
|
|
31
35
|
line_2: {
|
|
32
36
|
type: 'string'
|
|
@@ -57,6 +61,7 @@ module.exports = {
|
|
|
57
61
|
},
|
|
58
62
|
email: {
|
|
59
63
|
description: 'The main contact email for a branch.',
|
|
64
|
+
example: 'office@my-incredible-company.to',
|
|
60
65
|
anyOf: [
|
|
61
66
|
{
|
|
62
67
|
type: 'string',
|
|
@@ -70,6 +75,7 @@ module.exports = {
|
|
|
70
75
|
},
|
|
71
76
|
receipt_header: {
|
|
72
77
|
description: 'An arbitrary string that will be printed on every receipt as the header.',
|
|
78
|
+
example: 'Perfect socks LTD',
|
|
73
79
|
anyOf: [
|
|
74
80
|
{
|
|
75
81
|
type: 'string',
|
|
@@ -82,6 +88,7 @@ module.exports = {
|
|
|
82
88
|
},
|
|
83
89
|
receipt_footer: {
|
|
84
90
|
description: 'An arbitrary string that will be printed on every receipt as the footer',
|
|
91
|
+
example: 'Thank you!',
|
|
85
92
|
anyOf: [
|
|
86
93
|
{
|
|
87
94
|
type: 'string',
|
|
@@ -117,40 +124,7 @@ module.exports = {
|
|
|
117
124
|
}
|
|
118
125
|
]
|
|
119
126
|
},
|
|
120
|
-
images:
|
|
121
|
-
description: 'A Tillhub image object with URLs to display images this for this branch.',
|
|
122
|
-
anyOf: [
|
|
123
|
-
{
|
|
124
|
-
type: 'object',
|
|
125
|
-
additionalProperties: true,
|
|
126
|
-
properties: {
|
|
127
|
-
'1x': {
|
|
128
|
-
type: 'string',
|
|
129
|
-
format: 'uri'
|
|
130
|
-
},
|
|
131
|
-
'2x': {
|
|
132
|
-
type: 'string',
|
|
133
|
-
format: 'uri'
|
|
134
|
-
},
|
|
135
|
-
'3x': {
|
|
136
|
-
type: 'string',
|
|
137
|
-
format: 'uri'
|
|
138
|
-
},
|
|
139
|
-
avatar: {
|
|
140
|
-
type: 'string',
|
|
141
|
-
format: 'uri'
|
|
142
|
-
},
|
|
143
|
-
original: {
|
|
144
|
-
type: 'string',
|
|
145
|
-
format: 'uri'
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
type: 'null'
|
|
151
|
-
}
|
|
152
|
-
]
|
|
153
|
-
},
|
|
127
|
+
images: getImages(),
|
|
154
128
|
image: {
|
|
155
129
|
description: 'DEPRECATED. Omit or set null.',
|
|
156
130
|
anyOf: [
|
|
@@ -170,11 +144,13 @@ module.exports = {
|
|
|
170
144
|
},
|
|
171
145
|
active: {
|
|
172
146
|
description: 'Soft disable or enabled this branch.',
|
|
147
|
+
example: 'true',
|
|
173
148
|
type: 'boolean',
|
|
174
149
|
default: true
|
|
175
150
|
},
|
|
176
151
|
deleted: {
|
|
177
152
|
description: 'Soft delete this branch.',
|
|
153
|
+
example: 'false',
|
|
178
154
|
type: 'boolean',
|
|
179
155
|
default: false
|
|
180
156
|
},
|
|
@@ -186,10 +162,22 @@ module.exports = {
|
|
|
186
162
|
branch_number: {
|
|
187
163
|
type: 'number',
|
|
188
164
|
description: 'The maximum stems from the fact that is it stored as an postgres int4 type, with 4 bytes of space',
|
|
165
|
+
example: 107,
|
|
189
166
|
minimum: 0,
|
|
190
167
|
maximum: 2147483647
|
|
191
168
|
},
|
|
169
|
+
custom_id: {
|
|
170
|
+
description: 'Branch custom unique ID.',
|
|
171
|
+
example: 'dd3234of',
|
|
172
|
+
anyOf: [{
|
|
173
|
+
type: 'string'
|
|
174
|
+
}, {
|
|
175
|
+
type: 'null'
|
|
176
|
+
}]
|
|
177
|
+
},
|
|
192
178
|
external_custom_id: {
|
|
179
|
+
description: 'Unique ID of this branch in external system. Uses for synchronization.',
|
|
180
|
+
example: '7882448928329',
|
|
193
181
|
anyOf: [
|
|
194
182
|
{
|
|
195
183
|
type: 'string',
|
|
@@ -202,6 +190,8 @@ module.exports = {
|
|
|
202
190
|
]
|
|
203
191
|
},
|
|
204
192
|
cost_center: {
|
|
193
|
+
description: 'Cost center unique ID',
|
|
194
|
+
example: '7882448928329',
|
|
205
195
|
anyOf: [
|
|
206
196
|
{
|
|
207
197
|
type: 'string',
|
|
@@ -242,6 +232,7 @@ module.exports = {
|
|
|
242
232
|
},
|
|
243
233
|
street: {
|
|
244
234
|
description: 'A street name',
|
|
235
|
+
example: 'Downing Street',
|
|
245
236
|
oneOf: [
|
|
246
237
|
{
|
|
247
238
|
type: 'string',
|
|
@@ -254,6 +245,7 @@ module.exports = {
|
|
|
254
245
|
},
|
|
255
246
|
street_number: {
|
|
256
247
|
description: 'A street number',
|
|
248
|
+
example: '10',
|
|
257
249
|
oneOf: [
|
|
258
250
|
{
|
|
259
251
|
type: 'string',
|
|
@@ -266,6 +258,7 @@ module.exports = {
|
|
|
266
258
|
},
|
|
267
259
|
locality: {
|
|
268
260
|
description: 'The international format for a city, village and any other localizable city like place.',
|
|
261
|
+
example: 'London',
|
|
269
262
|
oneOf: [
|
|
270
263
|
{
|
|
271
264
|
type: 'string'
|
|
@@ -277,6 +270,7 @@ module.exports = {
|
|
|
277
270
|
},
|
|
278
271
|
region: {
|
|
279
272
|
description: 'The international format for regional sub category of a country e.g. a state or province.',
|
|
273
|
+
example: 'Greater London',
|
|
280
274
|
oneOf: [
|
|
281
275
|
{
|
|
282
276
|
type: 'string'
|
|
@@ -288,6 +282,7 @@ module.exports = {
|
|
|
288
282
|
},
|
|
289
283
|
postal_code: {
|
|
290
284
|
description: 'A non-validated postal code.',
|
|
285
|
+
example: 'SW1A',
|
|
291
286
|
oneOf: [
|
|
292
287
|
{
|
|
293
288
|
type: 'string',
|
|
@@ -300,6 +295,7 @@ module.exports = {
|
|
|
300
295
|
},
|
|
301
296
|
country: {
|
|
302
297
|
description: 'A country as ISO Alpha-2 code.',
|
|
298
|
+
example: 'UK',
|
|
303
299
|
oneOf: [
|
|
304
300
|
{
|
|
305
301
|
type: 'string',
|
|
@@ -366,42 +362,37 @@ module.exports = {
|
|
|
366
362
|
},
|
|
367
363
|
configuration: {
|
|
368
364
|
description: 'Deprecated: Overwriting a fa_account_number on cash payments for DATEV export.',
|
|
369
|
-
anyOf: [
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
type: 'null'
|
|
375
|
-
}
|
|
376
|
-
]
|
|
365
|
+
anyOf: [{
|
|
366
|
+
type: 'string'
|
|
367
|
+
}, {
|
|
368
|
+
type: 'null'
|
|
369
|
+
}]
|
|
377
370
|
},
|
|
378
371
|
timezone_default: {
|
|
379
372
|
description: 'An IANA timezone that will be used to display local timezones in documents and UI. Validation for the timezone will happen in memory of the server, but not on that schema.',
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
]
|
|
373
|
+
example: 'Europe/London',
|
|
374
|
+
anyOf: [{
|
|
375
|
+
type: 'string'
|
|
376
|
+
}, {
|
|
377
|
+
type: 'null'
|
|
378
|
+
}]
|
|
388
379
|
},
|
|
389
380
|
currency_default: {
|
|
390
381
|
description: 'The three letter [ISO currency](https://en.wikipedia.org/wiki/ISO_4217) of this branch.',
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}
|
|
398
|
-
]
|
|
382
|
+
example: 'GBP',
|
|
383
|
+
anyOf: [{
|
|
384
|
+
type: 'string'
|
|
385
|
+
}, {
|
|
386
|
+
type: 'null'
|
|
387
|
+
}]
|
|
399
388
|
},
|
|
400
389
|
custom_properties: {
|
|
390
|
+
description: 'User-defined branch properties',
|
|
401
391
|
...customProperties.implementation
|
|
402
392
|
},
|
|
403
393
|
default_favourite: {
|
|
404
394
|
description: 'Define which favourite set to show as default in the POS if none is defined on the register.',
|
|
395
|
+
example: '20e89159-28d9-46f2-bda3-d74bb70834e7',
|
|
405
396
|
anyOf: [
|
|
406
397
|
{
|
|
407
398
|
type: 'string',
|
|
@@ -414,6 +405,7 @@ module.exports = {
|
|
|
414
405
|
},
|
|
415
406
|
default_category_tree: {
|
|
416
407
|
description: 'Define which category tree to use as default in the POS if none is defined on the register.',
|
|
408
|
+
example: 'c45764ed-fc6d-4b32-b406-59a5e84d2999',
|
|
417
409
|
anyOf: [
|
|
418
410
|
{
|
|
419
411
|
type: 'string',
|