@tillhub/schemas 6.120.0 → 6.121.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 +12 -0
- package/lib/common/address.js +67 -82
- package/lib/common/images.js +6 -0
- package/lib/common/response.js +3 -3
- package/lib/v0/branches/read.js +8 -12
- 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/package.json +1 -1
- 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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [6.121.0](https://github.com/tillhub/schemas/compare/v6.120.0...v6.121.0) (2022-02-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **tests:** remove require() errors ([f2b6a16](https://github.com/tillhub/schemas/commit/f2b6a16))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **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)
|
|
12
|
+
|
|
1
13
|
# [6.120.0](https://github.com/tillhub/schemas/compare/v6.119.0...v6.120.0) (2022-02-17)
|
|
2
14
|
|
|
3
15
|
|
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/images.js
CHANGED
|
@@ -17,6 +17,12 @@ const definedSizes = {
|
|
|
17
17
|
type: 'string',
|
|
18
18
|
format: 'uri'
|
|
19
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
|
+
},
|
|
20
26
|
avatar: {
|
|
21
27
|
description: 'Image transformed to predefined size to use as "avatar"',
|
|
22
28
|
example: 'https://my-storage.io/images/f5a3cc72-7fb5-4d2c-bda5-9b2983c7e879_avatar.png',
|
package/lib/common/response.js
CHANGED
|
@@ -8,19 +8,19 @@ const cursor = {
|
|
|
8
8
|
type: 'string',
|
|
9
9
|
format: 'uri',
|
|
10
10
|
description: 'The URI pointing to the next page.',
|
|
11
|
-
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'
|
|
12
12
|
},
|
|
13
13
|
first: {
|
|
14
14
|
type: 'string',
|
|
15
15
|
format: 'uri',
|
|
16
16
|
description: 'The URI pointing to the the first page.',
|
|
17
|
-
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'
|
|
18
18
|
},
|
|
19
19
|
self: {
|
|
20
20
|
type: 'string',
|
|
21
21
|
format: 'uri',
|
|
22
22
|
description: 'The URI pointing to this page.',
|
|
23
|
-
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'
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
package/lib/v0/branches/read.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const baseObject = require('../../common/base')
|
|
2
2
|
const commonResponse = require('../../common/response')
|
|
3
3
|
const commonQuery = require('../../common/query')
|
|
4
|
+
const { oneOf } = require('../../helpers/payload-or-null')
|
|
5
|
+
|
|
4
6
|
const base = require('./base')
|
|
5
7
|
|
|
6
8
|
const extended = {
|
|
@@ -10,27 +12,21 @@ const extended = {
|
|
|
10
12
|
},
|
|
11
13
|
fa_account_number: {
|
|
12
14
|
description: 'Account number',
|
|
13
|
-
|
|
15
|
+
...oneOf({
|
|
14
16
|
type: 'string'
|
|
15
|
-
}
|
|
16
|
-
type: 'null'
|
|
17
|
-
}]
|
|
17
|
+
})
|
|
18
18
|
},
|
|
19
19
|
configurations: {
|
|
20
20
|
description: 'Configurations set',
|
|
21
|
-
|
|
21
|
+
...oneOf({
|
|
22
22
|
type: 'object'
|
|
23
|
-
}
|
|
24
|
-
type: 'null'
|
|
25
|
-
}]
|
|
23
|
+
})
|
|
26
24
|
},
|
|
27
25
|
merged_configurations: {
|
|
28
26
|
description: 'Merged configuration of branch and account',
|
|
29
|
-
|
|
27
|
+
...oneOf({
|
|
30
28
|
type: 'object'
|
|
31
|
-
}
|
|
32
|
-
type: 'null'
|
|
33
|
-
}]
|
|
29
|
+
})
|
|
34
30
|
}
|
|
35
31
|
}
|
|
36
32
|
|