@tillhub/schemas 6.342.0 → 6.343.1

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,17 @@
1
+ ## [6.343.1](https://github.com/tillhub/schemas/compare/v6.343.0...v6.343.1) (2024-10-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **stock replace:** adjust schema to new inventory endpoint ([#1006](https://github.com/tillhub/schemas/issues/1006)) ([52a73c9](https://github.com/tillhub/schemas/commit/52a73c9))
7
+
8
+ # [6.343.0](https://github.com/tillhub/schemas/compare/v6.342.0...v6.343.0) (2024-09-30)
9
+
10
+
11
+ ### Features
12
+
13
+ * **transactions:** devices ([ee3632a](https://github.com/tillhub/schemas/commit/ee3632a))
14
+
1
15
  # [6.342.0](https://github.com/tillhub/schemas/compare/v6.341.1...v6.342.0) (2024-09-26)
2
16
 
3
17
 
@@ -0,0 +1,32 @@
1
+ const { oneOf } = require('../helpers/payload-or-null')
2
+
3
+ module.exports = {
4
+ type: 'object',
5
+ properties: {
6
+ identifier_for_vendor: oneOf({
7
+ type: 'string',
8
+ description: 'Current vendor identifier regardless of value stored in keychain',
9
+ example: 'A2700DA6-CE09-4041-9724-1313DEF295E2'
10
+ }),
11
+ keychain_counting_numbers: oneOf({
12
+ type: 'string',
13
+ description: 'Snapshot of the keychain counting numbers table',
14
+ example: 'sale: 3, expense: 0, balance: 0, deliveryNote: 0, savedCart: 0, order: 1'
15
+ }),
16
+ app_info: oneOf({
17
+ type: 'string',
18
+ description: 'Application currently reporting',
19
+ example: 'de.tillhub.tillhubstage.dev 1.0:0'
20
+ }),
21
+ os_info: oneOf({
22
+ type: 'string',
23
+ description: 'OS running on device',
24
+ example: 'iPadOS 17.4'
25
+ }),
26
+ model_info: oneOf({
27
+ type: 'string',
28
+ description: 'Device hardware',
29
+ example: 'Simulator iPad (10th generation)'
30
+ })
31
+ }
32
+ }
@@ -1,7 +1,4 @@
1
-
2
1
  const { oneOf } = require('../../helpers/payload-or-null')
3
- const locationType = require('../../common/location_type')
4
- const defaultResponse = require('./default-response')
5
2
 
6
3
  module.exports.request = {
7
4
  $id: 'https://schemas.tillhub.com/v0/stock.update.request.schema.json',
@@ -9,122 +6,39 @@ module.exports.request = {
9
6
  additionalProperties: false,
10
7
  type: 'object',
11
8
  required: [
12
- 'qty',
13
- 'location'
9
+ 'qty'
14
10
  ],
15
11
  properties: {
16
12
  qty: {
17
- anyOf: [
18
- {
19
- type: 'null'
20
- },
21
- {
22
- type: 'number'
23
- }
24
- ]
25
- },
26
- status: {
27
- type: 'string',
28
- 'enum': [
29
- 'available',
30
- 'sold',
31
- 'purchased',
32
- 'reserved',
33
- 'transit_outgoing',
34
- 'transit_incoming',
35
- 'delivered',
36
- 'selected'
37
- ]
13
+ type: 'number'
38
14
  },
39
15
  metadata: oneOf({
40
16
  type: 'object'
41
17
  }),
42
- reasons: oneOf({
43
- description: 'Deprecated property. Use reason instead.',
44
- type: 'string',
45
- format: 'uuid'
46
- }),
47
18
  reason: oneOf({
48
19
  type: 'string',
49
20
  format: 'uuid'
50
- }),
51
- comments: oneOf({
52
- type: 'string',
53
- minLength: 1,
54
- maxLength: 2048
55
- }),
56
- location: {
57
- description: 'Alphanumeric uuid of the location, e.g. branch uuid or warehouse uuid',
58
- type: 'string',
59
- format: 'uuid'
60
- }
21
+ })
61
22
  }
62
23
  }
63
24
 
64
25
  module.exports.response = {
65
26
  $id: 'https://schemas.tillhub.com/v0/stock.update.response.schema.json',
66
27
  $schema: 'http://json-schema.org/draft-07/schema#',
67
- additionalProperties: false,
68
- type: 'object',
69
- required: [
70
- 'id',
71
- 'qty_change'
72
- ],
73
- properties: {
74
- ...defaultResponse,
75
- qty_change: {
76
- type: 'number'
77
- },
78
- channel: oneOf({
79
- type: 'string',
80
- example: 'api'
81
- }),
82
- purchase: oneOf({
83
- type: 'object'
84
- }),
85
- reasons: oneOf({
86
- description: 'Deprecated property. Use reason instead.',
87
- type: 'string',
88
- format: 'uuid'
89
- }),
90
- reason: oneOf({
91
- type: 'string',
92
- format: 'uuid'
93
- }),
94
- comments: oneOf({
95
- type: 'string',
96
- minLength: 1,
97
- maxLength: 2048
98
- }),
99
- from: oneOf({
100
- type: 'object',
101
- additionalProperties: false,
102
- properties: {
103
- id: {
104
- type: 'string',
105
- description: 'Alphanumeric uuid of the location, e.g. branch uuid or warehouse uuid',
106
- format: 'uuid'
107
- },
108
- location_type: locationType
28
+ type: 'array',
29
+ items: {
30
+ type: 'object',
31
+ required: [
32
+ 'stock',
33
+ 'stock_book'
34
+ ],
35
+ properties: {
36
+ stock: {
37
+ type: 'object'
109
38
  },
110
- required: [
111
- 'id'
112
- ]
113
- }),
114
- to: oneOf({
115
- type: 'object',
116
- additionalProperties: false,
117
- properties: {
118
- id: {
119
- type: 'string',
120
- description: 'Alphanumeric uuid of the location, e.g. branch uuid or warehouse uuid',
121
- format: 'uuid'
122
- },
123
- location_type: locationType
124
- },
125
- required: [
126
- 'id'
127
- ]
128
- })
39
+ stock_book: {
40
+ type: 'object'
41
+ }
42
+ }
129
43
  }
130
44
  }
@@ -1,5 +1,6 @@
1
1
  const { oneOf } = require('../../../../helpers/payload-or-null')
2
2
  const currencyAmount = require('../../../../common/currency_amount')
3
+ const deviceInfo = require('../../../../common/device_info')
3
4
 
4
5
  module.exports = {
5
6
  description: 'Extended balance stats',
@@ -64,24 +65,7 @@ module.exports = {
64
65
  description: 'Counting number of the last transaction'
65
66
  }),
66
67
  device: oneOf({
67
- type: 'object',
68
- properties: {
69
- identifier_for_vendor: oneOf({
70
- type: 'string',
71
- description: 'Current vendor identifier regardless of value stored in keychain',
72
- example: 'A2700DA6-CE09-4041-9724-1313DEF295E2'
73
- }),
74
- keychain_counting_numbers: oneOf({
75
- type: 'string',
76
- description: 'Snapshot of the keychain counting numbers table',
77
- example: 'sale: 3, expense: 0, balance: 0, deliveryNote: 0, savedCart: 0, order: 1'
78
- }),
79
- app_info: oneOf({
80
- type: 'string',
81
- description: 'Application info currently reporting',
82
- example: 'de.tillhub.tillhubstage.dev 1.0:0'
83
- })
84
- }
68
+ ...deviceInfo
85
69
  })
86
70
  }
87
71
  }
@@ -7,6 +7,7 @@ const dependsObject = require('../components/embedded/reference/depends')
7
7
  const originObject = require('../components/embedded/reference/origin')
8
8
  const gastroOrderOrigin = require('../../../common/gastro_order_origin')
9
9
  const promotionObject = require('../components/embedded/promotions/base')
10
+ const deviceInfo = require('../../../common/device_info')
10
11
 
11
12
  module.exports = {
12
13
  dev_uuid: {
@@ -203,24 +204,7 @@ module.exports = {
203
204
  }
204
205
  },
205
206
  device: oneOf({
206
- type: 'object',
207
- properties: {
208
- identifier_for_vendor: oneOf({
209
- type: 'string',
210
- description: 'Current vendor identifier regardless of value stored in keychain',
211
- example: 'A2700DA6-CE09-4041-9724-1313DEF295E2'
212
- }),
213
- keychain_counting_numbers: oneOf({
214
- type: 'string',
215
- description: 'Snapshot of the keychain counting numbers table',
216
- example: 'sale: 3, expense: 0, balance: 0, deliveryNote: 0, savedCart: 0, order: 1'
217
- }),
218
- app_info: oneOf({
219
- type: 'string',
220
- description: 'Application info currently reporting',
221
- example: 'de.tillhub.tillhubstage.dev 1.0:0'
222
- })
223
- }
207
+ ...deviceInfo
224
208
  }),
225
209
  order: oneOf({
226
210
  type: 'object',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.342.0",
3
+ "version": "6.343.1",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",