@tillhub/schemas 6.183.0 → 6.185.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,17 @@
1
+ # [6.185.0](https://github.com/tillhub/schemas/compare/v6.184.0...v6.185.0) (2022-12-15)
2
+
3
+
4
+ ### Features
5
+
6
+ * **stocks-book:** improve multiline formatting #UNTIL-5820 ([a93bc25](https://github.com/tillhub/schemas/commit/a93bc25)), closes [#UNTIL-5820](https://github.com/tillhub/schemas/issues/UNTIL-5820)
7
+
8
+ # [6.184.0](https://github.com/tillhub/schemas/compare/v6.183.0...v6.184.0) (2022-12-15)
9
+
10
+
11
+ ### Features
12
+
13
+ * **stocks-book:** align schema with requirements v5 #UNTIL-5820 ([1333558](https://github.com/tillhub/schemas/commit/1333558)), closes [#UNTIL-5820](https://github.com/tillhub/schemas/issues/UNTIL-5820)
14
+
1
15
  # [6.183.0](https://github.com/tillhub/schemas/compare/v6.182.0...v6.183.0) (2022-12-14)
2
16
 
3
17
 
@@ -9,12 +9,12 @@ const simple = {
9
9
  type: 'object'
10
10
  }),
11
11
  qty: {
12
- description: 'The quantity of product remain after book',
12
+ description: 'The quantity of product remain after stock booking',
13
13
  example: 11,
14
14
  type: 'number'
15
15
  },
16
16
  qty_change: {
17
- description: 'The quantity change with the book',
17
+ description: 'The quantity change with the stock booking',
18
18
  example: -2,
19
19
  type: 'number'
20
20
  },
@@ -72,19 +72,19 @@ const simple = {
72
72
  type: 'object'
73
73
  }),
74
74
  reason: oneOf({
75
- description: 'Alphanumerical UUID of the reason',
75
+ description: 'Alphanumerical UUID of the reason: the association with user generated entity which can be specifically set when booking things out manually',
76
76
  example: 'a1c1d0c6-f38b-4d89-ae26-7f1aea34985c',
77
77
  type: 'string',
78
78
  format: 'uuid'
79
79
  }),
80
80
  comments: oneOf({
81
- description: 'Additional comments for stock book',
81
+ description: 'Additional comments for stock booking',
82
82
  example: 'Actualized due to inventarisation',
83
83
  type: 'string',
84
84
  maxLength: 2048
85
85
  }),
86
86
  images: oneOf({
87
- description: 'Images associated with stock book',
87
+ description: 'Images associated with stock booking',
88
88
  type: 'array',
89
89
  items: {
90
90
  type: 'string',
@@ -92,7 +92,7 @@ const simple = {
92
92
  }
93
93
  }),
94
94
  type: {
95
- description: 'The type of stock book',
95
+ description: 'The type of stock booking',
96
96
  type: 'string',
97
97
  enum: [
98
98
  'add',
@@ -1,3 +1,4 @@
1
+ const { stripIndents } = require('common-tags')
1
2
  const pick = require('just-pick')
2
3
  const { oneOf } = require('../../helpers/payload-or-null')
3
4
  const baseObject = require('../../common/base')
@@ -15,10 +16,16 @@ const baseStockBook = require('./base').simple
15
16
  const eventTypeEnum = ['transfer', 'sale', 'delivery_note']
16
17
 
17
18
  const eventBaseData = pick({
18
- ...baseObject({ entityName: 'stock book' }),
19
+ ...baseObject({ entityName: 'stock booking' }),
19
20
  ...baseStockBook,
20
21
  type: {
21
22
  ...baseStockBook.type,
23
+ description: stripIndents`
24
+ The type of stock booking:
25
+ 'transfer' - indicates a stock change made by the operator for the logistic purpose, positive value for goods-in and negative value for goods-out;
26
+ 'sale' - indicates a stock change triggered by a sale, positive value for a successful transaction and negative value for a refund or cancellation;
27
+ 'delivery_note' - indicates a stock change triggered by a delivery note, positive value for a successful delivery note and negative value for a refund or cancellation
28
+ `,
22
29
  enum: eventTypeEnum
23
30
  }
24
31
  }, ['id', 'created_at', 'qty_change', 'type'])
@@ -53,7 +60,7 @@ const eventOverrideData = {
53
60
  ])
54
61
  },
55
62
  reason: oneOf({
56
- description: 'The reason of stock book',
63
+ description: 'The reason name: the user generated text which can be specifically set when booking things out manually',
57
64
  type: 'string',
58
65
  example: 'Not arbitrary reason'
59
66
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.183.0",
3
+ "version": "6.185.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",