@gls_spain/gps-common 34.29.0 → 34.30.1

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,43 +1,57 @@
1
- # [34.29.0](https://github.com/GLS-Spain/gps-common/compare/v34.28.2...v34.29.0) (2023-01-23)
2
-
3
-
4
- ### Features
5
-
6
- * add new documentType enum IDForeign ([0ca22ba](https://github.com/GLS-Spain/gps-common/commit/0ca22baa2ccb58bc9cc527a775d420cede3228ca))
7
-
8
- ## [34.28.2](https://github.com/GLS-Spain/gps-common/compare/v34.28.1...v34.28.2) (2022-12-22)
9
-
10
-
11
- ### Bug Fixes
12
-
13
- * shcema sales properties ([2a48e12](https://github.com/GLS-Spain/gps-common/commit/2a48e1280e61f204286ea56e0b61678bc0c45edf))
14
-
15
- ## [34.28.1](https://github.com/GLS-Spain/gps-common/compare/v34.28.0...v34.28.1) (2022-12-22)
16
-
17
-
18
- ### Bug Fixes
19
-
20
- * add referenceTypeSix to sale schema ([cff2547](https://github.com/GLS-Spain/gps-common/commit/cff25471c6a801cda23b11ae4407d98829c1d05f))
21
-
22
- # [34.28.0](https://github.com/GLS-Spain/gps-common/compare/v34.27.10...v34.28.0) (2022-12-21)
1
+ ## [34.30.1](https://github.com/GLS-Spain/gps-common/compare/v34.30.0...v34.30.1) (2023-04-20)
23
2
 
24
3
 
25
4
  ### Bug Fixes
26
5
 
27
- * add customer barcode to schema v2 ([8d46e4d](https://github.com/GLS-Spain/gps-common/commit/8d46e4d382dec12529d442178db08db1133a0bc6))
28
-
29
-
30
- ### Features
31
-
32
- * add barcode to customer objectSchema ([d3402eb](https://github.com/GLS-Spain/gps-common/commit/d3402eb083116a839d76f12e3a74a0d298e0696a))
33
-
34
- ## [34.27.10](https://github.com/GLS-Spain/gps-common/compare/v34.27.9...v34.27.10) (2022-11-15)
35
-
36
-
37
- ### Bug Fixes
38
-
39
- * add error for IBAN and NIF ([915228d](https://github.com/GLS-Spain/gps-common/commit/915228d5952f3eab13c8c334bf73ce466355ca0d))
6
+ * add fields to status.manuallyDisabled in shop ([d979a8e](https://github.com/GLS-Spain/gps-common/commit/d979a8e00019a4c52c7b74f70067624f2a530c88))
40
7
 
8
+ # [34.30.0](https://github.com/GLS-Spain/gps-common/compare/v34.29.0...v34.30.0) (2023-02-01)
9
+
10
+
11
+ ### Features
12
+
13
+ * remove unused sale attributes / shop squareCode (plaza) check ([aea6742](https://github.com/GLS-Spain/gps-common/commit/aea67427fdaf4e3c38d96e74024ab9f59a5259e1))
14
+
15
+ # [34.29.0](https://github.com/GLS-Spain/gps-common/compare/v34.28.2...v34.29.0) (2023-01-23)
16
+
17
+
18
+ ### Features
19
+
20
+ * add new documentType enum IDForeign ([0ca22ba](https://github.com/GLS-Spain/gps-common/commit/0ca22baa2ccb58bc9cc527a775d420cede3228ca))
21
+
22
+ ## [34.28.2](https://github.com/GLS-Spain/gps-common/compare/v34.28.1...v34.28.2) (2022-12-22)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * shcema sales properties ([2a48e12](https://github.com/GLS-Spain/gps-common/commit/2a48e1280e61f204286ea56e0b61678bc0c45edf))
28
+
29
+ ## [34.28.1](https://github.com/GLS-Spain/gps-common/compare/v34.28.0...v34.28.1) (2022-12-22)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * add referenceTypeSix to sale schema ([cff2547](https://github.com/GLS-Spain/gps-common/commit/cff25471c6a801cda23b11ae4407d98829c1d05f))
35
+
36
+ # [34.28.0](https://github.com/GLS-Spain/gps-common/compare/v34.27.10...v34.28.0) (2022-12-21)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * add customer barcode to schema v2 ([8d46e4d](https://github.com/GLS-Spain/gps-common/commit/8d46e4d382dec12529d442178db08db1133a0bc6))
42
+
43
+
44
+ ### Features
45
+
46
+ * add barcode to customer objectSchema ([d3402eb](https://github.com/GLS-Spain/gps-common/commit/d3402eb083116a839d76f12e3a74a0d298e0696a))
47
+
48
+ ## [34.27.10](https://github.com/GLS-Spain/gps-common/compare/v34.27.9...v34.27.10) (2022-11-15)
49
+
50
+
51
+ ### Bug Fixes
52
+
53
+ * add error for IBAN and NIF ([915228d](https://github.com/GLS-Spain/gps-common/commit/915228d5952f3eab13c8c334bf73ce466355ca0d))
54
+
41
55
  ## [34.27.9](https://github.com/GLS-Spain/gps-common/compare/v34.27.8...v34.27.9) (2022-09-07)
42
56
 
43
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gls_spain/gps-common",
3
- "version": "34.29.0",
3
+ "version": "34.30.1",
4
4
  "description": "Errors, schemas and documentation for the Parcel Shops project",
5
5
  "keywords": [
6
6
  "gls"
@@ -24,23 +24,23 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@semantic-release/changelog": "^5.0.1",
27
- "@semantic-release/git": "^9.0.0",
27
+ "@semantic-release/git": "^9.0.1",
28
28
  "@semantic-release/npm": "^7.0.10",
29
- "@semantic-release/release-notes-generator": "^9.0.1",
29
+ "@semantic-release/release-notes-generator": "^9.0.3",
30
30
  "@types/jest": "^25.2.3",
31
31
  "ajv": "^6.12.6",
32
- "commitizen": "^4.2.3",
32
+ "commitizen": "^4.3.0",
33
33
  "cz-conventional-changelog": "^3.3.0",
34
34
  "eslint": "^6.8.0",
35
35
  "eslint-config-airbnb-base": "^14.2.1",
36
36
  "eslint-config-prettier": "^6.15.0",
37
- "eslint-plugin-import": "^2.22.1",
37
+ "eslint-plugin-import": "^2.27.5",
38
38
  "husky": "^4.3.8",
39
39
  "jest": "^25.5.4",
40
40
  "prettier": "^1.19.1",
41
41
  "redoc-cli": "^0.10.4",
42
42
  "rimraf": "^2.6.3",
43
- "semantic-release": "^17.4.1"
43
+ "semantic-release": "^17.4.7"
44
44
  },
45
45
  "dependencies": {
46
46
  "@gls_spain/ajv-options": "^1.1.2",
@@ -74,11 +74,14 @@ const saleZone = () => ({
74
74
  l: money(),
75
75
  xl: money(),
76
76
  letter: money(),
77
+ // 2023-01-13 JL esto está en producción????
77
78
  fourteen: money(),
78
79
  },
79
- required: ['envelope', 'xs', 's', 'm', 'l', 'xl', 'letter', 'fourteen'],
80
+ required: ['envelope', 'xs', 's', 'm', 'l', 'xl'],
81
+ // required: ['envelope', 'xs', 's', 'm', 'l', 'xl', 'letter', 'fourteen'],
80
82
  additionalProperties: false,
81
83
  },
84
+ // 2023-01-13 JL esto está en producción????
82
85
  pricesTraveller: {
83
86
  type: 'object',
84
87
  properties: {
@@ -92,7 +95,8 @@ const saleZone = () => ({
92
95
  includes: { type: 'array', items: saleZoneRegion(), uniqueItems: true },
93
96
  excludes: { type: 'array', items: saleZoneRegion(), uniqueItems: true },
94
97
  },
95
- required: ['name', 'prices', 'pricesTraveller', 'includes', 'excludes'],
98
+ required: ['name', 'prices', 'includes', 'excludes'],
99
+ // required: ['name', 'prices', 'pricesTraveller', 'includes', 'excludes'],
96
100
  additionalProperties: false,
97
101
  });
98
102
 
@@ -55,7 +55,7 @@ const sale = () => ({
55
55
  size: saleSize(),
56
56
  fourteenService: { type: 'boolean' },
57
57
  official_invoice: { type: 'boolean' },
58
- referenceTypeSix:{type:'string'},
58
+ referenceTypeSix: { type: 'string' },
59
59
  price: money(),
60
60
  settings: mergeSchemas(salesSettings(), network().properties.salesSettings, {
61
61
  description: 'a copy of both the defaults sale settings and the network sale settings as they were when the sale was created',
@@ -77,6 +77,8 @@ const sale = () => ({
77
77
  type: 'object',
78
78
  properties: {
79
79
  name: { type: 'string', trim: true },
80
+ // 2023-01-12 JL hay que quitar esta campo de MyGls, para luego eliminarlo aquí definitivamente
81
+ // lastname: { type: 'string', trim: true },
80
82
  nif: { type: 'string', trim: true },
81
83
  nifType: nifType(),
82
84
  countryPassport: country(),
@@ -100,7 +102,7 @@ const sale = () => ({
100
102
  notes: { type: 'string', trim: true },
101
103
  reference: { type: 'string', trim: true },
102
104
  suitcasetag: { type: 'string', trim: true },
103
- barcode:{ type: 'string', trim: true },
105
+ barcode: { type: 'string', trim: true },
104
106
  },
105
107
  required: ['name', 'nif', 'address', 'emails', 'phones', 'fiscal'],
106
108
  additionalProperties: false,
@@ -125,6 +127,8 @@ const sale = () => ({
125
127
  payId: { type: 'string', description: 'only available after payment' },
126
128
  fullUrl: { type: 'string' },
127
129
  shortId: { type: 'string' },
130
+ payToken: { type: 'string', description: 'ingenico order token' },
131
+ payPspid: { type: 'string', description: 'ingenico pspId' },
128
132
  },
129
133
  required: ['statusHistory', 'orderId', 'fullUrl', 'shortId'],
130
134
  additionalProperties: false,
@@ -43,7 +43,6 @@ const shopDaySchedule = () => ({
43
43
  description: '[ ] or [ [HH:mm:ss, HH:mm:ss] ] or [ [HH:mm:ss, HH:mm:ss], [HH:mm:ss, HH:mm:ss] ]',
44
44
  });
45
45
 
46
-
47
46
  const shopSchedule = () => ({
48
47
  oneOf: [
49
48
  {
@@ -81,25 +80,23 @@ const absencesHolidaysShop = () => ({
81
80
  _id: uuid(),
82
81
  from: datetime(),
83
82
  to: datetime(),
84
- description:{ type: 'string' },
85
- createAt: datetime()
83
+ description: { type: 'string' },
84
+ createAt: datetime(),
86
85
  },
87
86
  required: ['from', 'to', '_id', 'createAt'],
88
87
  additionalProperties: false,
89
88
  });
90
89
 
91
90
  const shopHolidays = () => ({
92
- title: 'Holidays shop',
93
- type: 'array',
94
- properties: {
95
- absences: absencesHolidaysShop(),
96
- },
97
- required: ['absences'],
98
- additionalProperties: false,
91
+ title: 'Holidays shop',
92
+ type: 'array',
93
+ properties: {
94
+ absences: absencesHolidaysShop(),
95
+ },
96
+ required: ['absences'],
97
+ additionalProperties: false,
99
98
  });
100
99
 
101
-
102
-
103
100
  const shopRepresentative = () => ({
104
101
  type: 'object',
105
102
  properties: {
@@ -150,7 +147,7 @@ const shopActivity = () => ({
150
147
  'moving',
151
148
  'dryCleaner',
152
149
  'toyStores',
153
- 'other'
150
+ 'other',
154
151
  ],
155
152
  });
156
153
 
@@ -208,7 +205,9 @@ const shop = () => ({
208
205
  manuallyDisabled: {
209
206
  type: 'object',
210
207
  properties: {
208
+ _id:uuid(),
211
209
  at: datetime(),
210
+ to: datetime(),
212
211
  reason: { type: 'string', trim: true },
213
212
  },
214
213
  required: ['at', 'reason'],
@@ -222,7 +221,7 @@ const shop = () => ({
222
221
  address: addressWithRequiredLocation(),
223
222
  capabilities: {
224
223
  type: 'array',
225
- items: { type: 'string', enum: ['deliver', 'pickup', 'sell','sellplus'] },
224
+ items: { type: 'string', enum: ['deliver', 'pickup', 'sell', 'sellplus'] },
226
225
  uniqueItems: true,
227
226
  },
228
227
 
@@ -240,8 +239,12 @@ const shop = () => ({
240
239
  expirationSettings: expirationSettings(),
241
240
  eco: { type: 'boolean', default: false },
242
241
  gold: { type: 'boolean', default: false },
243
- squareCode: { type: 'string' },
244
- clientCode: { type: 'string' }
242
+ // squareCode: { type: 'string' },
243
+ // clientCode: { type: 'string' },
244
+ // 2023-01-12 JL están definidos como string
245
+ // TODO en el momento que el frontend sea capaz de mandar integer, se quita "string"
246
+ squareCode: { type: ['integer', 'string'], minimum: 0, maximum: 32767, description: 'agency code' },
247
+ clientCode: { type: ['integer', 'string'], minimum: 0, description: 'client code' },
245
248
  },
246
249
  required: [
247
250
  '_id',
@@ -311,7 +314,7 @@ const createShopRequest = () =>
311
314
  'eco',
312
315
  'gold',
313
316
  'squareCode',
314
- 'clientCode'
317
+ 'clientCode',
315
318
  ]),
316
319
  },
317
320
  required: ['network', 'status', 'name', 'address', 'openingSchedule', 'timezone'],
@@ -435,10 +438,10 @@ const deleteShopRequest = () => deleteRequest(findById());
435
438
 
436
439
  const deleteShopResponse = () => deleteResponse(shop());
437
440
 
438
- const upsertShopRequest = () => (
439
- {
440
- type: 'object',
441
- properties: { upsert: {
441
+ const upsertShopRequest = () => ({
442
+ type: 'object',
443
+ properties: {
444
+ upsert: {
442
445
  title: 'upsert',
443
446
  type: 'object',
444
447
  properties: {
@@ -463,23 +466,23 @@ const upsertShopRequest = () => (
463
466
  'eco',
464
467
  'gold',
465
468
  'squareCode',
466
- 'clientCode'
469
+ 'clientCode',
467
470
  ]),
468
471
  },
469
472
  required: ['network', 'status', 'name', 'address'],
470
473
  additionalProperties: false,
471
- } },
472
- required: ['upsert'],
473
- additionalProperties: false,
474
- });
475
-
476
- const upsertShopResponse = () => (
477
- {
478
- type: 'object',
479
- properties: { upsert: shop() },
480
- required: ['upsert'],
481
- additionalProperties: false
482
- });
474
+ },
475
+ },
476
+ required: ['upsert'],
477
+ additionalProperties: false,
478
+ });
479
+
480
+ const upsertShopResponse = () => ({
481
+ type: 'object',
482
+ properties: { upsert: shop() },
483
+ required: ['upsert'],
484
+ additionalProperties: false,
485
+ });
483
486
 
484
487
  module.exports = {
485
488
  shop,