@tillhub/schemas 6.100.1 → 6.102.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 CHANGED
@@ -1,3 +1,31 @@
1
+ # [6.102.0](https://github.com/tillhub/schemas/compare/v6.101.0...v6.102.0) (2021-11-03)
2
+
3
+
4
+ ### Features
5
+
6
+ * **pricebook:** add lowest_price, highest_price ([2c55b20](https://github.com/tillhub/schemas/commit/2c55b20))
7
+
8
+ # [6.101.0](https://github.com/tillhub/schemas/compare/v6.100.3...v6.101.0) (2021-10-29)
9
+
10
+
11
+ ### Features
12
+
13
+ * **pricebooks:** add branch groups #API-1115 ([fac9fd0](https://github.com/tillhub/schemas/commit/fac9fd0)), closes [#API-1115](https://github.com/tillhub/schemas/issues/API-1115)
14
+
15
+ ## [6.100.3](https://github.com/tillhub/schemas/compare/v6.100.2...v6.100.3) (2021-10-22)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **products:** q is required property in products search request chema ([#641](https://github.com/tillhub/schemas/issues/641)) ([ceb3019](https://github.com/tillhub/schemas/commit/ceb3019))
21
+
22
+ ## [6.100.2](https://github.com/tillhub/schemas/compare/v6.100.1...v6.100.2) (2021-10-22)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **products:** Products search schema fixed ([#640](https://github.com/tillhub/schemas/issues/640)) ([24377f9](https://github.com/tillhub/schemas/commit/24377f9))
28
+
1
29
  ## [6.100.1](https://github.com/tillhub/schemas/compare/v6.100.0...v6.100.1) (2021-10-22)
2
30
 
3
31
 
@@ -2,43 +2,30 @@ const { oneOf } = require('../../helpers/payload-or-null')
2
2
 
3
3
  module.exports = {
4
4
  client_id: {
5
- description: 'An identifier used locally on POS for their own reference.',
6
- oneOf: [
7
- {
8
- type: 'string',
9
- maxLength: 128
10
- },
11
- {
12
- type: 'null'
13
- }
14
- ]
5
+ description: 'An identifier used locally on POS for their own reference. Guaranteed to be there',
6
+ type: 'string',
7
+ maxLength: 128
15
8
  },
16
- balance_client_id: {
9
+ balance_client_id: oneOf({
17
10
  type: 'string',
18
11
  maxLength: 128,
19
- description: 'A reference to the balance this exports belongs to.'
20
- },
21
- balance_number: {
22
- ...oneOf({
23
- type: 'integer',
24
- example: 5,
25
- description: 'The associated balance\'s counting number (receipt number) of this export'
26
- })
27
- },
28
- branch_custom_id: {
29
- ...oneOf({
30
- type: 'integer',
31
- example: 7,
32
- description: 'The branch number'
33
- })
34
- },
35
- register_custom_id: {
36
- ...oneOf({
37
- type: 'integer',
38
- example: 11,
39
- description: 'The register number'
40
- })
41
- },
12
+ description: 'A reference to the balance this exports belongs to. Can be omitted for archives.'
13
+ }),
14
+ balance_number: oneOf({
15
+ type: 'integer',
16
+ example: 5,
17
+ description: 'The associated balance\'s counting number (receipt number) of this export. Can be omitted for archives.'
18
+ }),
19
+ branch_custom_id: oneOf({
20
+ type: 'integer',
21
+ example: 7,
22
+ description: 'The branch number'
23
+ }),
24
+ register_custom_id: oneOf({
25
+ type: 'integer',
26
+ example: 11,
27
+ description: 'The register number'
28
+ }),
42
29
  register: {
43
30
  type: 'string',
44
31
  format: 'uuid',
@@ -65,47 +52,30 @@ module.exports = {
65
52
  export: {
66
53
  type: 'object',
67
54
  properties: {
68
- transaction_number_first: {
69
- type: 'integer',
70
- example: 15,
71
- description: 'The first TSE transaction number in this export'
72
- },
73
- transaction_number_last: {
74
- type: 'integer',
75
- example: 19,
76
- description: 'The last TSE transaction number in this export'
77
- },
78
- date_start: {
79
- description: 'Daterange start of the export.',
55
+ date_start: oneOf({
56
+ description: 'Daterange start of the export, omitted for archives.',
80
57
  type: 'string',
81
58
  format: 'date-time',
82
59
  example: '2020-10-17T08:12:04.849Z'
83
- },
60
+ }),
84
61
  date_end: {
85
62
  description: 'Daterange end of the export.',
86
63
  type: 'string',
87
64
  format: 'date-time',
88
65
  example: '2020-10-17T21:12:04.849Z'
89
66
  },
90
- url: {
67
+ url: oneOf({
91
68
  description: 'URL of the uploaded export tar file.',
92
69
  type: 'string',
93
70
  format: 'uri'
94
- },
71
+ }),
95
72
  type: {
96
73
  type: 'string',
97
74
  'enum': [
98
75
  'archive',
99
- 'number',
100
- 'number_interval',
101
76
  'time_period'
102
77
  ],
103
78
  default: 'time_period'
104
- },
105
- client_id: {
106
- description: 'An identifier used locally on the POS for their own reference.',
107
- type: 'string',
108
- maxLength: 128
109
79
  }
110
80
  }
111
81
  }
@@ -9,7 +9,7 @@ module.exports = {
9
9
  additionalProperties: false,
10
10
  required: [
11
11
  'tse_serial_number',
12
- 'balance_client_id'
12
+ 'export'
13
13
  ],
14
14
  properties: base,
15
15
  type: 'object'
@@ -29,9 +29,9 @@ module.exports = {
29
29
  type: 'string',
30
30
  description: 'Defines which price is chosen by default when conflict',
31
31
  enum: [
32
- 'default',
33
- 'pricebook',
34
- 'user'
32
+ 'user',
33
+ 'lowest_price',
34
+ 'highest_price'
35
35
  ]
36
36
  }),
37
37
  inheritance: oneOf({
@@ -23,6 +23,14 @@ module.exports = {
23
23
  format: 'uuid'
24
24
  }
25
25
  }),
26
+ branch_groups: oneOf({
27
+ description: 'If defined then only these branch groups (plus specified locations if any) will be using this price book',
28
+ type: 'array',
29
+ items: {
30
+ type: 'string',
31
+ format: 'uuid'
32
+ }
33
+ }),
26
34
  active: {
27
35
  type: 'boolean'
28
36
  },
@@ -1,7 +1,12 @@
1
1
  module.exports = {
2
+ $id: 'https://schemas.tillhub.com/v1/products.search.request.schema.json',
3
+ $schema: 'http://json-schema.org/draft-07/schema#',
2
4
  type: 'object',
3
5
  // additional properties are a little bit of a danger zone of not being validated by the upstream service
4
6
  additionalProperties: true,
7
+ required: [
8
+ 'q'
9
+ ],
5
10
  properties: {
6
11
  q: {
7
12
  type: 'string',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.100.1",
3
+ "version": "6.102.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",