@tillhub/schemas 6.343.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,10 @@
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
+
1
8
  # [6.343.0](https://github.com/tillhub/schemas/compare/v6.342.0...v6.343.0) (2024-09-30)
2
9
 
3
10
 
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.343.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",