@gls_spain/gps-common 34.28.2 → 34.30.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 +42 -28
- package/package.json +6 -6
- package/schemas/definitions/common.js +2 -1
- package/schemas/definitions/defaults.js +6 -2
- package/schemas/definitions/sales.js +6 -2
- package/schemas/definitions/shops.js +35 -34
- package/scripts/build-documentation.js +1 -1
- package/scripts/build-json-schemas.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,36 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* shcema sales properties ([2a48e12](https://github.com/GLS-Spain/gps-common/commit/2a48e1280e61f204286ea56e0b61678bc0c45edf))
|
|
7
|
-
|
|
8
|
-
## [34.28.1](https://github.com/GLS-Spain/gps-common/compare/v34.28.0...v34.28.1) (2022-12-22)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Bug Fixes
|
|
12
|
-
|
|
13
|
-
* add referenceTypeSix to sale schema ([cff2547](https://github.com/GLS-Spain/gps-common/commit/cff25471c6a801cda23b11ae4407d98829c1d05f))
|
|
14
|
-
|
|
15
|
-
# [34.28.0](https://github.com/GLS-Spain/gps-common/compare/v34.27.10...v34.28.0) (2022-12-21)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Bug Fixes
|
|
19
|
-
|
|
20
|
-
* add customer barcode to schema v2 ([8d46e4d](https://github.com/GLS-Spain/gps-common/commit/8d46e4d382dec12529d442178db08db1133a0bc6))
|
|
1
|
+
# [34.30.0](https://github.com/GLS-Spain/gps-common/compare/v34.29.0...v34.30.0) (2023-02-01)
|
|
21
2
|
|
|
22
3
|
|
|
23
4
|
### Features
|
|
24
5
|
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
## [34.27.10](https://github.com/GLS-Spain/gps-common/compare/v34.27.9...v34.27.10) (2022-11-15)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### Bug Fixes
|
|
31
|
-
|
|
32
|
-
* add error for IBAN and NIF ([915228d](https://github.com/GLS-Spain/gps-common/commit/915228d5952f3eab13c8c334bf73ce466355ca0d))
|
|
6
|
+
* remove unused sale attributes / shop squareCode (plaza) check ([aea6742](https://github.com/GLS-Spain/gps-common/commit/aea67427fdaf4e3c38d96e74024ab9f59a5259e1))
|
|
33
7
|
|
|
8
|
+
# [34.29.0](https://github.com/GLS-Spain/gps-common/compare/v34.28.2...v34.29.0) (2023-01-23)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add new documentType enum IDForeign ([0ca22ba](https://github.com/GLS-Spain/gps-common/commit/0ca22baa2ccb58bc9cc527a775d420cede3228ca))
|
|
14
|
+
|
|
15
|
+
## [34.28.2](https://github.com/GLS-Spain/gps-common/compare/v34.28.1...v34.28.2) (2022-12-22)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* shcema sales properties ([2a48e12](https://github.com/GLS-Spain/gps-common/commit/2a48e1280e61f204286ea56e0b61678bc0c45edf))
|
|
21
|
+
|
|
22
|
+
## [34.28.1](https://github.com/GLS-Spain/gps-common/compare/v34.28.0...v34.28.1) (2022-12-22)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* add referenceTypeSix to sale schema ([cff2547](https://github.com/GLS-Spain/gps-common/commit/cff25471c6a801cda23b11ae4407d98829c1d05f))
|
|
28
|
+
|
|
29
|
+
# [34.28.0](https://github.com/GLS-Spain/gps-common/compare/v34.27.10...v34.28.0) (2022-12-21)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* add customer barcode to schema v2 ([8d46e4d](https://github.com/GLS-Spain/gps-common/commit/8d46e4d382dec12529d442178db08db1133a0bc6))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* add barcode to customer objectSchema ([d3402eb](https://github.com/GLS-Spain/gps-common/commit/d3402eb083116a839d76f12e3a74a0d298e0696a))
|
|
40
|
+
|
|
41
|
+
## [34.27.10](https://github.com/GLS-Spain/gps-common/compare/v34.27.9...v34.27.10) (2022-11-15)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* add error for IBAN and NIF ([915228d](https://github.com/GLS-Spain/gps-common/commit/915228d5952f3eab13c8c334bf73ce466355ca0d))
|
|
47
|
+
|
|
34
48
|
## [34.27.9](https://github.com/GLS-Spain/gps-common/compare/v34.27.8...v34.27.9) (2022-09-07)
|
|
35
49
|
|
|
36
50
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gls_spain/gps-common",
|
|
3
|
-
"version": "34.
|
|
3
|
+
"version": "34.30.0",
|
|
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.
|
|
27
|
+
"@semantic-release/git": "^9.0.1",
|
|
28
28
|
"@semantic-release/npm": "^7.0.10",
|
|
29
|
-
"@semantic-release/release-notes-generator": "^9.0.
|
|
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.
|
|
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.
|
|
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.
|
|
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'
|
|
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', '
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
|
|
@@ -222,7 +219,7 @@ const shop = () => ({
|
|
|
222
219
|
address: addressWithRequiredLocation(),
|
|
223
220
|
capabilities: {
|
|
224
221
|
type: 'array',
|
|
225
|
-
items: { type: 'string', enum: ['deliver', 'pickup', 'sell','sellplus'] },
|
|
222
|
+
items: { type: 'string', enum: ['deliver', 'pickup', 'sell', 'sellplus'] },
|
|
226
223
|
uniqueItems: true,
|
|
227
224
|
},
|
|
228
225
|
|
|
@@ -240,8 +237,12 @@ const shop = () => ({
|
|
|
240
237
|
expirationSettings: expirationSettings(),
|
|
241
238
|
eco: { type: 'boolean', default: false },
|
|
242
239
|
gold: { type: 'boolean', default: false },
|
|
243
|
-
squareCode: { type: 'string' },
|
|
244
|
-
clientCode: { type: 'string' }
|
|
240
|
+
// squareCode: { type: 'string' },
|
|
241
|
+
// clientCode: { type: 'string' },
|
|
242
|
+
// 2023-01-12 JL están definidos como string
|
|
243
|
+
// TODO en el momento que el frontend sea capaz de mandar integer, se quita "string"
|
|
244
|
+
squareCode: { type: ['integer', 'string'], minimum: 0, maximum: 32767, description: 'agency code' },
|
|
245
|
+
clientCode: { type: ['integer', 'string'], minimum: 0, description: 'client code' },
|
|
245
246
|
},
|
|
246
247
|
required: [
|
|
247
248
|
'_id',
|
|
@@ -311,7 +312,7 @@ const createShopRequest = () =>
|
|
|
311
312
|
'eco',
|
|
312
313
|
'gold',
|
|
313
314
|
'squareCode',
|
|
314
|
-
'clientCode'
|
|
315
|
+
'clientCode',
|
|
315
316
|
]),
|
|
316
317
|
},
|
|
317
318
|
required: ['network', 'status', 'name', 'address', 'openingSchedule', 'timezone'],
|
|
@@ -435,10 +436,10 @@ const deleteShopRequest = () => deleteRequest(findById());
|
|
|
435
436
|
|
|
436
437
|
const deleteShopResponse = () => deleteResponse(shop());
|
|
437
438
|
|
|
438
|
-
const upsertShopRequest = () => (
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
439
|
+
const upsertShopRequest = () => ({
|
|
440
|
+
type: 'object',
|
|
441
|
+
properties: {
|
|
442
|
+
upsert: {
|
|
442
443
|
title: 'upsert',
|
|
443
444
|
type: 'object',
|
|
444
445
|
properties: {
|
|
@@ -463,23 +464,23 @@ const upsertShopRequest = () => (
|
|
|
463
464
|
'eco',
|
|
464
465
|
'gold',
|
|
465
466
|
'squareCode',
|
|
466
|
-
'clientCode'
|
|
467
|
+
'clientCode',
|
|
467
468
|
]),
|
|
468
469
|
},
|
|
469
470
|
required: ['network', 'status', 'name', 'address'],
|
|
470
471
|
additionalProperties: false,
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
required: ['upsert'],
|
|
475
|
+
additionalProperties: false,
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
const upsertShopResponse = () => ({
|
|
479
|
+
type: 'object',
|
|
480
|
+
properties: { upsert: shop() },
|
|
481
|
+
required: ['upsert'],
|
|
482
|
+
additionalProperties: false,
|
|
483
|
+
});
|
|
483
484
|
|
|
484
485
|
module.exports = {
|
|
485
486
|
shop,
|