@tillhub/schemas 6.178.0 → 6.180.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,9 +1,23 @@
1
+ # [6.180.0](https://github.com/tillhub/schemas/compare/v6.179.0...v6.180.0) (2022-12-12)
2
+
3
+
4
+ ### Features
5
+
6
+ * **release:** trigger the release ([40f7c6d](https://github.com/tillhub/schemas/commit/40f7c6d))
7
+
8
+ # [6.179.0](https://github.com/tillhub/schemas/compare/v6.178.0...v6.179.0) (2022-12-09)
9
+
10
+
11
+ ### Features
12
+
13
+ * **stocks-book:** omit 'purchase' and 'images' from event schema #UNTIL-5820 ([31672af](https://github.com/tillhub/schemas/commit/31672af)), closes [#UNTIL-5820](https://github.com/tillhub/schemas/issues/UNTIL-5820)
14
+
1
15
  # [6.178.0](https://github.com/tillhub/schemas/compare/v6.177.0...v6.178.0) (2022-12-08)
2
16
 
3
17
 
4
18
  ### Features
5
19
 
6
- * **stocks-book:** add stocks book schemas #UNTIL-5820 ([8172c34](https://github.com/tillhub/schemas/commit/8172c34)), closes [#UNTIL-5820](https://github.com/tillhub/schemas/issues/UNTIL-5820)
20
+ * **stocks-book:** add stocks book schemas ([8172c34](https://github.com/tillhub/schemas/commit/8172c34)), closes [#UNTIL-5820](https://github.com/tillhub/schemas/issues/UNTIL-5820)
7
21
  * **stocks-book:** fix linter issues ([a4d1ba8](https://github.com/tillhub/schemas/commit/a4d1ba8))
8
22
 
9
23
  # [6.177.0](https://github.com/tillhub/schemas/compare/v6.176.0...v6.177.0) (2022-12-07)
@@ -3,11 +3,13 @@ const { oneOf } = require('../../helpers/payload-or-null')
3
3
  const baseObject = require('../../common/base')
4
4
  const baseProduct = require('../../v1/products/base').response
5
5
  const baseBranch = require('../../v0/branches/base')
6
- const baseReason = require('../../v0/reasons/base')
7
6
  const baseStockBook = require('./base').simple
8
7
 
9
- const eventEmbeddedData = {
10
- product: oneOf({
8
+ const eventBaseData = pick(baseStockBook, ['id', 'qty_change', 'type'])
9
+
10
+ const eventOverrideData = {
11
+ product: {
12
+ description: 'The product which stock was affected',
11
13
  type: 'object',
12
14
  additionalProperties: false,
13
15
  properties: pick({
@@ -17,14 +19,11 @@ const eventEmbeddedData = {
17
19
  'id',
18
20
  'name',
19
21
  'client_id',
20
- 'custom_id',
21
- 'custom_properties',
22
- 'metadata',
23
- 'product_group',
24
- 'is_service'
22
+ 'custom_id'
25
23
  ])
26
- }),
27
- location: oneOf({
24
+ },
25
+ location: {
26
+ description: 'The location the stock was booked at',
28
27
  type: 'object',
29
28
  additionalProperties: false,
30
29
  properties: pick({
@@ -37,18 +36,10 @@ const eventEmbeddedData = {
37
36
  'branch_number',
38
37
  'metadata'
39
38
  ])
40
- }),
39
+ },
41
40
  reason: oneOf({
42
- type: 'object',
43
- additionalProperties: false,
44
- properties: pick({
45
- ...baseObject(),
46
- ...baseReason
47
- }, [
48
- 'id',
49
- 'name',
50
- 'type'
51
- ])
41
+ description: 'The reason of stock book',
42
+ type: 'string'
52
43
  })
53
44
  }
54
45
 
@@ -60,17 +51,14 @@ module.exports = {
60
51
  additionalProperties: false,
61
52
  required: [
62
53
  'id',
63
- 'qty',
64
54
  'qty_change',
65
55
  'product',
66
- 'location',
67
- 'from',
68
- 'to'
56
+ 'location'
69
57
  ],
70
58
  properties: {
71
59
  ...baseObject(),
72
- ...baseStockBook,
73
- ...eventEmbeddedData
60
+ ...eventBaseData,
61
+ ...eventOverrideData
74
62
  }
75
63
  }
76
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.178.0",
3
+ "version": "6.180.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",