@tillhub/schemas 6.179.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,3 +1,10 @@
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
+
1
8
  # [6.179.0](https://github.com/tillhub/schemas/compare/v6.178.0...v6.179.0) (2022-12-09)
2
9
 
3
10
 
@@ -10,7 +17,7 @@
10
17
 
11
18
  ### Features
12
19
 
13
- * **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)
14
21
  * **stocks-book:** fix linter issues ([a4d1ba8](https://github.com/tillhub/schemas/commit/a4d1ba8))
15
22
 
16
23
  # [6.177.0](https://github.com/tillhub/schemas/compare/v6.176.0...v6.177.0) (2022-12-07)
@@ -3,17 +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 {
10
- purchase: omitPurchase,
11
- images: omitImages,
12
- ...eventBaseData
13
- } = baseStockBook
8
+ const eventBaseData = pick(baseStockBook, ['id', 'qty_change', 'type'])
14
9
 
15
- const eventEmbeddedData = {
16
- product: oneOf({
10
+ const eventOverrideData = {
11
+ product: {
12
+ description: 'The product which stock was affected',
17
13
  type: 'object',
18
14
  additionalProperties: false,
19
15
  properties: pick({
@@ -23,14 +19,11 @@ const eventEmbeddedData = {
23
19
  'id',
24
20
  'name',
25
21
  'client_id',
26
- 'custom_id',
27
- 'custom_properties',
28
- 'metadata',
29
- 'product_group',
30
- 'is_service'
22
+ 'custom_id'
31
23
  ])
32
- }),
33
- location: oneOf({
24
+ },
25
+ location: {
26
+ description: 'The location the stock was booked at',
34
27
  type: 'object',
35
28
  additionalProperties: false,
36
29
  properties: pick({
@@ -43,18 +36,10 @@ const eventEmbeddedData = {
43
36
  'branch_number',
44
37
  'metadata'
45
38
  ])
46
- }),
39
+ },
47
40
  reason: oneOf({
48
- type: 'object',
49
- additionalProperties: false,
50
- properties: pick({
51
- ...baseObject(),
52
- ...baseReason
53
- }, [
54
- 'id',
55
- 'name',
56
- 'type'
57
- ])
41
+ description: 'The reason of stock book',
42
+ type: 'string'
58
43
  })
59
44
  }
60
45
 
@@ -66,17 +51,14 @@ module.exports = {
66
51
  additionalProperties: false,
67
52
  required: [
68
53
  'id',
69
- 'qty',
70
54
  'qty_change',
71
55
  'product',
72
- 'location',
73
- 'from',
74
- 'to'
56
+ 'location'
75
57
  ],
76
58
  properties: {
77
59
  ...baseObject(),
78
60
  ...eventBaseData,
79
- ...eventEmbeddedData
61
+ ...eventOverrideData
80
62
  }
81
63
  }
82
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.179.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",