@tillhub/schemas 6.236.1 → 6.238.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/v0/analytics/index.js +2 -1
- package/lib/v0/analytics/reports/index.js +3 -0
- package/lib/v0/analytics/reports/products/index.js +3 -0
- package/lib/v0/analytics/reports/products/top.js +27 -0
- package/lib/v0/service_categories/index.js +5 -0
- package/lib/v0/service_categories/update.request.js +8 -0
- package/lib/v0/service_categories/update.response.js +8 -0
- package/package.json +1 -1
- package/test/service_categories/v0/service_categories.v0.spec.js +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [6.238.0](https://github.com/tillhub/schemas/compare/v6.237.0...v6.238.0) (2023-07-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **service_categories:** add schema for PUT service_categories ([#833](https://github.com/tillhub/schemas/issues/833)) ([3e6db9a](https://github.com/tillhub/schemas/commit/3e6db9a))
|
|
7
|
+
|
|
8
|
+
# [6.237.0](https://github.com/tillhub/schemas/compare/v6.236.1...v6.237.0) (2023-07-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **reports:** get top products endpoint's filters schema ([f99ca34](https://github.com/tillhub/schemas/commit/f99ca34))
|
|
14
|
+
|
|
1
15
|
## [6.236.1](https://github.com/tillhub/schemas/compare/v6.236.0...v6.236.1) (2023-07-25)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module.exports.request = {
|
|
2
|
+
$id: 'https://schemas.tillhub.com/v0/analytics.reports.products.top.request.schema.json',
|
|
3
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
4
|
+
type: 'object',
|
|
5
|
+
additionalProperties: false,
|
|
6
|
+
required: [],
|
|
7
|
+
properties: {
|
|
8
|
+
start: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
format: 'date-time',
|
|
11
|
+
example: '2018-01-29T14:55:05.000Z',
|
|
12
|
+
description: 'Start date for top products report'
|
|
13
|
+
},
|
|
14
|
+
end: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
format: 'date-time',
|
|
17
|
+
example: '2018-01-29T14:55:05.000Z',
|
|
18
|
+
description: 'End date for top products report'
|
|
19
|
+
},
|
|
20
|
+
branch_number: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
pattern: '^[0-9]+$',
|
|
23
|
+
example: '239',
|
|
24
|
+
description: 'Branch number'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -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.update.response.schema.json',
|
|
6
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
7
|
+
...commonResponse({ resultItems: response })
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -18,3 +18,21 @@ test('Service Categories 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('Service Categories V0: update request schema validation', t => {
|
|
23
|
+
t.plan(2)
|
|
24
|
+
const updateRequest = require('../../../lib/v0/service_categories').update.request
|
|
25
|
+
const { valid, error } = validate(updateRequest)
|
|
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('Service Categories V0: update response schema validation', t => {
|
|
32
|
+
t.plan(2)
|
|
33
|
+
const updateResponse = require('../../../lib/v0/service_categories').update.response
|
|
34
|
+
const { valid, error } = validate(updateResponse)
|
|
35
|
+
t.ok(valid, 'update response schema is valid')
|
|
36
|
+
t.error(error, 'should not get any error')
|
|
37
|
+
t.end()
|
|
38
|
+
})
|