@tillhub/schemas 6.252.0 → 6.253.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 +19 -0
- package/README.md +2 -1
- package/lib/v0/analytics/snapshots/create.js +11 -4
- package/lib/v0/customers/base.js +15 -0
- package/lib/v0/services/index.js +5 -0
- package/lib/v0/services/update.request.js +36 -0
- package/lib/v0/services/update.response.js +22 -0
- package/lib/v0/stocks_book/create.js +5 -0
- package/package.json +1 -1
- package/test/services/v0/services.v0.spec.js +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [6.253.0](https://github.com/tillhub/schemas/compare/v6.252.1...v6.253.0) (2023-08-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **chore:** commit message fix for new version ([#856](https://github.com/tillhub/schemas/issues/856)) ([8047905](https://github.com/tillhub/schemas/commit/8047905))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **stock-management:** add optional transaction_id to stock-book create event ([#857](https://github.com/tillhub/schemas/issues/857)) ([43091fa](https://github.com/tillhub/schemas/commit/43091fa))
|
|
12
|
+
|
|
13
|
+
## [6.252.1](https://github.com/tillhub/schemas/compare/v6.252.0...v6.252.1) (2023-08-21)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **customers:** base ([6233e17](https://github.com/tillhub/schemas/commit/6233e17))
|
|
19
|
+
|
|
1
20
|
# [6.252.0](https://github.com/tillhub/schemas/compare/v6.251.0...v6.252.0) (2023-08-21)
|
|
2
21
|
|
|
3
22
|
|
package/README.md
CHANGED
|
@@ -26,7 +26,8 @@ console.log(createCartSchema)
|
|
|
26
26
|
## Release flow
|
|
27
27
|
|
|
28
28
|
Releases are automated with @semantic-release.
|
|
29
|
-
For triggering a new release just use commit messages started from "feat" or "fix" prefix which
|
|
29
|
+
For triggering a new release just use commit messages started from "feat" or "fix" prefix which
|
|
30
|
+
is part of [proper message format](https://github.com/semantic-release/semantic-release#commit-message-format) (please do not forget about it!).
|
|
30
31
|
|
|
31
32
|
CricleCI takes care of publishing the package. it will only trigger on the master branch.
|
|
32
33
|
After the PR is merged into master, CircleCI will start the deployment process:
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const dateObject = require('../../../common/date_object')
|
|
1
2
|
const commonResponse = require('../../../common/response')
|
|
2
3
|
|
|
3
4
|
module.exports.request = {
|
|
@@ -109,12 +110,18 @@ module.exports.response = {
|
|
|
109
110
|
maxLength: 2048
|
|
110
111
|
},
|
|
111
112
|
created_at: {
|
|
112
|
-
|
|
113
|
-
format: 'date-time'
|
|
113
|
+
...dateObject
|
|
114
114
|
},
|
|
115
115
|
updated_at: {
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
...dateObject
|
|
117
|
+
},
|
|
118
|
+
start: {
|
|
119
|
+
...dateObject,
|
|
120
|
+
description: 'Start date for the filter'
|
|
121
|
+
},
|
|
122
|
+
end: {
|
|
123
|
+
...dateObject,
|
|
124
|
+
description: 'End date for the filter'
|
|
118
125
|
},
|
|
119
126
|
items: {
|
|
120
127
|
type: 'array',
|
package/lib/v0/customers/base.js
CHANGED
|
@@ -410,5 +410,20 @@ module.exports = {
|
|
|
410
410
|
maxLength: 20,
|
|
411
411
|
minLength: 5
|
|
412
412
|
})
|
|
413
|
+
},
|
|
414
|
+
source: {
|
|
415
|
+
description: 'Customer source of creation',
|
|
416
|
+
example: 'N/A, DASHBOARD, APPOINTMENT_CALENDAR, WEB_RESERVATION, POS',
|
|
417
|
+
...oneOf({
|
|
418
|
+
type: 'string',
|
|
419
|
+
maxLength: 128
|
|
420
|
+
})
|
|
421
|
+
},
|
|
422
|
+
branch_id: {
|
|
423
|
+
description: 'in cases where the customer is created via the POS, the branch_id is required',
|
|
424
|
+
...oneOf({
|
|
425
|
+
type: 'string',
|
|
426
|
+
format: 'uuid'
|
|
427
|
+
})
|
|
413
428
|
}
|
|
414
429
|
}
|
package/lib/v0/services/index.js
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const base = require('../products/update')
|
|
2
|
+
const { oneOf } = require('../../helpers/payload-or-null')
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
...base,
|
|
6
|
+
properties: {
|
|
7
|
+
...base.properties,
|
|
8
|
+
name: {
|
|
9
|
+
description: 'The name of the service',
|
|
10
|
+
type: 'string',
|
|
11
|
+
example: 'Haircut'
|
|
12
|
+
},
|
|
13
|
+
category: oneOf({
|
|
14
|
+
description: 'The UUID of the category that the service belongs to',
|
|
15
|
+
type: 'string',
|
|
16
|
+
format: 'uuid',
|
|
17
|
+
example: '05297f58-3408-44d0-8bf4-125d4e86c08a'
|
|
18
|
+
}),
|
|
19
|
+
duration: {
|
|
20
|
+
description: 'the duration of the service in mintues',
|
|
21
|
+
type: 'integer',
|
|
22
|
+
minimum: 5,
|
|
23
|
+
maximum: 1440,
|
|
24
|
+
example: 30
|
|
25
|
+
},
|
|
26
|
+
'linked_product': {
|
|
27
|
+
description: 'The UUID of the product associated with the service',
|
|
28
|
+
type: 'string',
|
|
29
|
+
format: 'uuid',
|
|
30
|
+
example: '05297f58-3408-44d0-8bf4-125d4e86c08a'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
required: [],
|
|
34
|
+
$id: 'https://schemas.tillhub.com/v0/services.update.request.schema.json',
|
|
35
|
+
$schema: 'http://json-schema.org/draft-07/schema#'
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const request = require('./update.request')
|
|
2
|
+
const commonResponse = require('../../common/response')
|
|
3
|
+
|
|
4
|
+
const response = {
|
|
5
|
+
...request,
|
|
6
|
+
required: [],
|
|
7
|
+
properties: {
|
|
8
|
+
id: {
|
|
9
|
+
description: 'The service ID',
|
|
10
|
+
type: 'string',
|
|
11
|
+
format: 'uuid',
|
|
12
|
+
example: '05297f58-3408-44d0-8bf4-125d4e86c08a'
|
|
13
|
+
},
|
|
14
|
+
...request.properties
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = {
|
|
19
|
+
$id: 'https://schemas.tillhub.com/v0/services.update.response.schema.json',
|
|
20
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
21
|
+
...commonResponse({ resultItems: response })
|
|
22
|
+
}
|
|
@@ -63,6 +63,11 @@ const eventOverrideData = {
|
|
|
63
63
|
description: 'The reason name: the user generated text which can be specifically set when booking things out manually',
|
|
64
64
|
type: 'string',
|
|
65
65
|
example: 'Not arbitrary reason'
|
|
66
|
+
}),
|
|
67
|
+
transaction_id: oneOf({
|
|
68
|
+
description: 'id of transaction, if stock book is related to transaction',
|
|
69
|
+
type: 'string',
|
|
70
|
+
example: 'f0a52a37-df58-465d-9121-b8180fc95133'
|
|
66
71
|
})
|
|
67
72
|
}
|
|
68
73
|
|
package/package.json
CHANGED
|
@@ -18,3 +18,21 @@ test('Services V0: create response schema validation', t => {
|
|
|
18
18
|
t.error(error, 'should not get any error')
|
|
19
19
|
t.end()
|
|
20
20
|
})
|
|
21
|
+
|
|
22
|
+
test('Services V0: update request schema validation', t => {
|
|
23
|
+
t.plan(2)
|
|
24
|
+
const createRequest = require('../../../lib/v0/services').update.request
|
|
25
|
+
const { valid, error } = validate(createRequest)
|
|
26
|
+
t.ok(valid, 'update request schema is valid')
|
|
27
|
+
t.error(error, 'should not get any error')
|
|
28
|
+
t.end()
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
test('Services V0: update response schema validation', t => {
|
|
32
|
+
t.plan(2)
|
|
33
|
+
const createResponse = require('../../../lib/v0/services').update.response
|
|
34
|
+
const { valid, error } = validate(createResponse)
|
|
35
|
+
t.ok(valid, 'update response schema is valid')
|
|
36
|
+
t.error(error, 'should not get any error')
|
|
37
|
+
t.end()
|
|
38
|
+
})
|