@tillhub/schemas 6.185.0 → 6.187.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,21 @@
1
+ # [6.187.0](https://github.com/tillhub/schemas/compare/v6.186.0...v6.187.0) (2023-01-24)
2
+
3
+
4
+ ### Features
5
+
6
+ * **analytics:** Filter reports by branch group - Statistics ([62b52f2](https://github.com/tillhub/schemas/commit/62b52f2))
7
+ * **balances:** added balance event ([2e1cdb7](https://github.com/tillhub/schemas/commit/2e1cdb7))
8
+ * **chore:** fix lint ([8e22c17](https://github.com/tillhub/schemas/commit/8e22c17))
9
+ * **features:** Make the `inventory` feature flag true by default on new accounts ([999f12d](https://github.com/tillhub/schemas/commit/999f12d))
10
+ * **receipts_configuration:** add first name and last name to the waiter printing policy ([1861d83](https://github.com/tillhub/schemas/commit/1861d83))
11
+
12
+ # [6.186.0](https://github.com/tillhub/schemas/compare/v6.185.0...v6.186.0) (2022-12-16)
13
+
14
+
15
+ ### Features
16
+
17
+ * **webhooks:** use snake schema #UNTIL-5887 ([0dc2fb1](https://github.com/tillhub/schemas/commit/0dc2fb1)), closes [#UNTIL-5887](https://github.com/tillhub/schemas/issues/UNTIL-5887)
18
+
1
19
  # [6.185.0](https://github.com/tillhub/schemas/compare/v6.184.0...v6.185.0) (2022-12-15)
2
20
 
3
21
 
@@ -8,34 +8,34 @@ module.exports.getEvent = function getEvent (payload, {
8
8
  type: 'object',
9
9
  additionalProperties: false,
10
10
  properties: {
11
- webhookId: {
11
+ webhook_id: {
12
12
  description: 'The webhook UUID',
13
13
  example: 'ff30cfdf-5167-4f72-b4fc-c1d72db3c07e',
14
14
  type: 'string',
15
15
  format: 'uuid'
16
16
  },
17
- eventId: {
17
+ event_id: {
18
18
  description: 'The event UUID',
19
19
  example: 'c6fe918a-7bdc-4ccd-af36-95c03853233d',
20
20
  type: 'string',
21
21
  format: 'uuid'
22
22
  },
23
- eventEntity: {
23
+ event_entity: {
24
24
  description: 'The entity name the event refers to',
25
25
  example: eventEntityExample,
26
26
  type: 'string'
27
27
  },
28
- eventType: {
28
+ event_type: {
29
29
  description: 'The event type (e.g. create, update, delete)',
30
30
  example: eventTypeExample,
31
31
  type: 'string'
32
32
  },
33
- eventVersion: {
33
+ event_version: {
34
34
  description: 'The event payload version',
35
35
  example: eventVersionExample,
36
36
  type: 'number'
37
37
  },
38
- entityInstanceId: {
38
+ entity_instance_id: {
39
39
  description: 'The entity instance UUID',
40
40
  example: '10b06f38-031d-4e0c-8706-0474c8c5b61c',
41
41
  type: 'string',
@@ -47,6 +47,21 @@ module.exports.request = {
47
47
  'branch': {
48
48
  'type': 'string'
49
49
  },
50
+ 'branch_group': {
51
+ 'anyOf': [
52
+ {
53
+ 'type': 'string',
54
+ 'format': 'uuid'
55
+ },
56
+ {
57
+ 'type': 'array',
58
+ 'items': {
59
+ 'type': 'string',
60
+ 'format': 'uuid'
61
+ }
62
+ }
63
+ ]
64
+ },
50
65
  'discount_rate': {
51
66
  'type': 'string'
52
67
  },
@@ -14,6 +14,21 @@ module.exports.request = {
14
14
  'type': 'string',
15
15
  'format': 'uuid'
16
16
  },
17
+ 'branch_group': {
18
+ 'anyOf': [
19
+ {
20
+ 'type': 'string',
21
+ 'format': 'uuid'
22
+ },
23
+ {
24
+ 'type': 'array',
25
+ 'items': {
26
+ 'type': 'string',
27
+ 'format': 'uuid'
28
+ }
29
+ }
30
+ ]
31
+ },
17
32
  'staff_number': {
18
33
  'type': 'string',
19
34
  'minLength': 1,
@@ -81,7 +81,7 @@ module.exports = {
81
81
  },
82
82
  inventory: {
83
83
  type: 'boolean',
84
- default: false
84
+ default: true
85
85
  },
86
86
  web_view: {
87
87
  type: 'boolean',
@@ -1,4 +1,6 @@
1
1
  const commonResponse = require('../../common/response')
2
+ const { getEvent } = require('../../common/webhooks')
3
+ const response = require('../balances/legacy/response')
2
4
 
3
5
  module.exports.create = {
4
6
  request: require('./create.request'),
@@ -36,3 +38,9 @@ module.exports.legacy = {
36
38
  }
37
39
  }
38
40
  }
41
+
42
+ module.exports.event = {
43
+ $id: 'https://schemas.tillhub.com/v1/balances.legacy.create.event.schema.json',
44
+ $schema: 'http://json-schema.org/draft-07/schema#',
45
+ ...getEvent(response, { eventEntityExample: 'balance' })
46
+ }
@@ -43,7 +43,9 @@ const salespersonConfiguration = {
43
43
  type: 'string',
44
44
  enum: [
45
45
  'number',
46
- 'name'
46
+ 'name',
47
+ 'first_name', // first name only
48
+ 'last_name' // last name only
47
49
  ]
48
50
  }),
49
51
  conditions: oneOf({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.185.0",
3
+ "version": "6.187.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",
@@ -10,6 +10,15 @@ test('Balances: v1: create schema validation', function (t) {
10
10
  t.end()
11
11
  })
12
12
 
13
+ test('Balances: v1: get schema validation', function (t) {
14
+ t.plan(2)
15
+ const getResponse = require('../../lib/v1/balances').get.all.response
16
+ const { valid, error } = validate(getResponse)
17
+ t.ok(valid, 'get schema is valid')
18
+ t.error(error, 'should not get any error')
19
+ t.end()
20
+ })
21
+
13
22
  test('Balances: v1: create response schema', function (t) {
14
23
  t.plan(2)
15
24
  const createResponse = require('../../lib/v1/balances').create.response