@tillhub/schemas 6.180.0 → 6.181.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.181.0](https://github.com/tillhub/schemas/compare/v6.180.0...v6.181.0) (2022-12-12)
2
+
3
+
4
+ ### Features
5
+
6
+ * **stocks-book:** align schema with requirements v1 #UNTIL-5820 ([c606cc8](https://github.com/tillhub/schemas/commit/c606cc8)), closes [#UNTIL-5820](https://github.com/tillhub/schemas/issues/UNTIL-5820)
7
+
1
8
  # [6.180.0](https://github.com/tillhub/schemas/compare/v6.179.0...v6.180.0) (2022-12-12)
2
9
 
3
10
 
@@ -5,6 +5,7 @@ const dateObject = require('./date_object')
5
5
  * @param {Object} [options]
6
6
  */
7
7
  function baseObject ({
8
+ entityName = 'entity',
8
9
  splitDate = false
9
10
  } = {}) {
10
11
  const dateType = splitDate ? dateObject : {
@@ -15,18 +16,18 @@ function baseObject ({
15
16
 
16
17
  return {
17
18
  id: {
18
- description: 'Unique entity ID',
19
+ description: `Unique ${entityName} ID`,
19
20
  type: 'string',
20
21
  format: 'uuid',
21
22
  example: '936835f7-2d75-41d2-9001-38ed6e458328'
22
23
  },
23
24
  created_at: {
24
25
  ...dateType,
25
- description: 'The date and time entity was created'
26
+ description: `The date and time ${entityName} was created`
26
27
  },
27
28
  updated_at: {
28
29
  ...dateType,
29
- description: 'The date and time entity was updated'
30
+ description: `The date and time ${entityName} was updated`
30
31
  }
31
32
  }
32
33
  }
@@ -5,7 +5,10 @@ const baseProduct = require('../../v1/products/base').response
5
5
  const baseBranch = require('../../v0/branches/base')
6
6
  const baseStockBook = require('./base').simple
7
7
 
8
- const eventBaseData = pick(baseStockBook, ['id', 'qty_change', 'type'])
8
+ const eventBaseData = pick({
9
+ ...baseObject({ entityName: 'stock book' }),
10
+ ...baseStockBook
11
+ }, ['id', 'qty_change', 'type'])
9
12
 
10
13
  const eventOverrideData = {
11
14
  product: {
@@ -56,7 +59,6 @@ module.exports = {
56
59
  'location'
57
60
  ],
58
61
  properties: {
59
- ...baseObject(),
60
62
  ...eventBaseData,
61
63
  ...eventOverrideData
62
64
  }
@@ -12,7 +12,7 @@ module.exports.all = {
12
12
  type: 'object',
13
13
  additionalProperties: false,
14
14
  properties: {
15
- ...baseObject(),
15
+ ...baseObject({ entityName: 'stock book' }),
16
16
  ...base
17
17
  }
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.180.0",
3
+ "version": "6.181.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",