@tillhub/schemas 6.229.0 → 6.231.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/lib/v0/index.js +1 -0
- package/lib/v0/service_categories/base.js +41 -0
- package/lib/v0/service_categories/create.request.js +7 -0
- package/lib/v0/service_categories/create.response.js +8 -0
- package/lib/v0/service_categories/index.js +4 -0
- package/lib/v0/staff/update.js +24 -0
- package/package.json +1 -1
- package/test/service_categories/v0/service_categories.v0.spec.js +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [6.231.0](https://github.com/tillhub/schemas/compare/v6.230.0...v6.231.0) (2023-07-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **service_categories:** add service_categories.create ([#829](https://github.com/tillhub/schemas/issues/829)) ([fc3e117](https://github.com/tillhub/schemas/commit/fc3e117))
|
|
7
|
+
|
|
8
|
+
# [6.230.0](https://github.com/tillhub/schemas/compare/v6.229.0...v6.230.0) (2023-07-14)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **staffs:** linting fix ([0b606e9](https://github.com/tillhub/schemas/commit/0b606e9))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **staffs:** request schema to update short_code ([ca8c114](https://github.com/tillhub/schemas/commit/ca8c114))
|
|
19
|
+
|
|
1
20
|
# [6.229.0](https://github.com/tillhub/schemas/compare/v6.228.0...v6.229.0) (2023-07-14)
|
|
2
21
|
|
|
3
22
|
|
package/lib/v0/index.js
CHANGED
|
@@ -74,5 +74,6 @@ module.exports.table_layouts = require('./table_layouts')
|
|
|
74
74
|
module.exports.product_addons = require('./product_addons')
|
|
75
75
|
module.exports.product_addon_groups = require('./product_addon_groups')
|
|
76
76
|
module.exports.configurations = require('./configurations')
|
|
77
|
+
module.exports.service_categories = require('./service_categories')
|
|
77
78
|
|
|
78
79
|
// 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,41 @@
|
|
|
1
|
+
const base = require('../product_groups/base')
|
|
2
|
+
|
|
3
|
+
const request = {
|
|
4
|
+
...base.request,
|
|
5
|
+
properties: {
|
|
6
|
+
...base.request.properties,
|
|
7
|
+
description: {
|
|
8
|
+
description: 'A description of the service category',
|
|
9
|
+
type: 'string',
|
|
10
|
+
example: 'Haircuts for men'
|
|
11
|
+
},
|
|
12
|
+
active: {
|
|
13
|
+
description: 'Soft disable or enable this service category.',
|
|
14
|
+
type: 'boolean',
|
|
15
|
+
default: true
|
|
16
|
+
},
|
|
17
|
+
deleted: {
|
|
18
|
+
description: 'Soft delete this service category.',
|
|
19
|
+
type: 'boolean',
|
|
20
|
+
default: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
required: ['name']
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = {
|
|
27
|
+
request,
|
|
28
|
+
response: {
|
|
29
|
+
...request,
|
|
30
|
+
required: [],
|
|
31
|
+
properties: {
|
|
32
|
+
id: {
|
|
33
|
+
description: 'The service category ID',
|
|
34
|
+
type: 'string',
|
|
35
|
+
format: 'uuid',
|
|
36
|
+
example: '05297f58-3408-44d0-8bf4-125d4e86c08a'
|
|
37
|
+
},
|
|
38
|
+
...request.properties
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const { response } = require('./base')
|
|
2
|
+
const commonResponse = require('../../common/response')
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
$id: 'https://schemas.tillhub.com/v0/service_categories.create.response.schema.json',
|
|
6
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
7
|
+
...commonResponse({ resultItems: response })
|
|
8
|
+
}
|
package/lib/v0/staff/update.js
CHANGED
|
@@ -20,3 +20,27 @@ module.exports.request = {
|
|
|
20
20
|
}
|
|
21
21
|
]
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
module.exports.short_code = {
|
|
25
|
+
request: {
|
|
26
|
+
$id: 'https://schemas.tillhub.com/v0/staff.update.short_code.request.schema.json',
|
|
27
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
properties: {
|
|
30
|
+
new_short_code: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
maxLength: 10,
|
|
33
|
+
minLength: 1
|
|
34
|
+
},
|
|
35
|
+
old_short_code: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
maxLength: 10,
|
|
38
|
+
minLength: 1
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
type: 'object',
|
|
42
|
+
required: [
|
|
43
|
+
'old_short_code', 'new_short_code'
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const test = require('tape')
|
|
2
|
+
const validate = require('../../helpers/validate-schema')
|
|
3
|
+
|
|
4
|
+
test('Service Categories V0: create request schema validation', t => {
|
|
5
|
+
t.plan(2)
|
|
6
|
+
const createRequest = require('../../../lib/v0/service_categories').create.request
|
|
7
|
+
const { valid, error } = validate(createRequest)
|
|
8
|
+
t.ok(valid, 'create request schema is valid')
|
|
9
|
+
t.error(error, 'should not get any error')
|
|
10
|
+
t.end()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
test('Service Categories V0: create response schema validation', t => {
|
|
14
|
+
t.plan(2)
|
|
15
|
+
const createResponse = require('../../../lib/v0/service_categories').create.response
|
|
16
|
+
const { valid, error } = validate(createResponse)
|
|
17
|
+
t.ok(valid, 'create response schema is valid')
|
|
18
|
+
t.error(error, 'should not get any error')
|
|
19
|
+
t.end()
|
|
20
|
+
})
|