@gls_spain/gps-common 34.27.8 → 34.27.10

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,10 +1,24 @@
1
- ## [34.27.8](https://github.com/GLS-Spain/gps-common/compare/v34.27.7...v34.27.8) (2022-09-07)
1
+ ## [34.27.10](https://github.com/GLS-Spain/gps-common/compare/v34.27.9...v34.27.10) (2022-11-15)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * add flag ps gold ([9c04b43](https://github.com/GLS-Spain/gps-common/commit/9c04b435057925f0d4f3d3330d25a94e51a8337e))
6
+ * add error for IBAN and NIF ([915228d](https://github.com/GLS-Spain/gps-common/commit/915228d5952f3eab13c8c334bf73ce466355ca0d))
7
7
 
8
+ ## [34.27.9](https://github.com/GLS-Spain/gps-common/compare/v34.27.8...v34.27.9) (2022-09-07)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add gold flag new ([c77e1e3](https://github.com/GLS-Spain/gps-common/commit/c77e1e354a81ba2208c93739bab798d418df3461))
14
+
15
+ ## [34.27.8](https://github.com/GLS-Spain/gps-common/compare/v34.27.7...v34.27.8) (2022-09-07)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add flag ps gold ([9c04b43](https://github.com/GLS-Spain/gps-common/commit/9c04b435057925f0d4f3d3330d25a94e51a8337e))
21
+
8
22
  ## [34.27.7](https://github.com/GLS-Spain/gps-common/compare/v34.27.6...v34.27.7) (2022-07-15)
9
23
 
10
24
 
@@ -0,0 +1,11 @@
1
+ const { DatabaseError } = require('@gls_spain/mongodb');
2
+
3
+ class IbanNotCorrectError extends DatabaseError {
4
+ constructor(message = 'IBAN is not correct.') {
5
+ // noinspection JSCheckFunctionSignatures
6
+ super(message);
7
+ this.name = 'IbanNotCorrectError';
8
+ }
9
+ }
10
+
11
+ module.exports = IbanNotCorrectError;
@@ -0,0 +1,11 @@
1
+ const { DatabaseError } = require('@gls_spain/mongodb');
2
+
3
+ class NifNotCorrectError extends DatabaseError {
4
+ constructor(message = 'NIF is not correct.') {
5
+ // noinspection JSCheckFunctionSignatures
6
+ super(message);
7
+ this.name = 'NifNotCorrectError';
8
+ }
9
+ }
10
+
11
+ module.exports = NifNotCorrectError;
package/errors/index.js CHANGED
@@ -36,6 +36,8 @@ const AgenciaTributariaDNI = require('./AgenciaTributariaDNI');
36
36
  const GLSSpainError = require('./GLSSpainError');
37
37
  const GLSRecordingError = require('./GLSRecordingError');
38
38
  const LabelDoesNotExistError = require('./LabelDoesNotExistError');
39
+ const IbanNotCorrectError = require('./IbanNotCorrectError');
40
+ const NifNotCorrectError = require('./NifNotCorrectError');
39
41
 
40
42
  const errorsNames = {
41
43
  DatabaseNotEmptyError: 'DatabaseNotEmptyError',
@@ -76,6 +78,8 @@ const errorsNames = {
76
78
  GLSSpainError: 'GLSSpainError',
77
79
  GLSRecordingError: 'GLSRecordingError',
78
80
  LabelDoesNotExistError: 'LabelDoesNotExistError',
81
+ NifNotCorrectError:'NifNotCorrectError',
82
+ IbanNotCorrectError:'IbanNotCorrectError',
79
83
  };
80
84
 
81
85
  module.exports = {
@@ -118,4 +122,6 @@ module.exports = {
118
122
  GLSRecordingError,
119
123
  LabelDoesNotExistError,
120
124
  errorsNames,
125
+ NifNotCorrectError,
126
+ IbanNotCorrectError,
121
127
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gls_spain/gps-common",
3
- "version": "34.27.8",
3
+ "version": "34.27.10",
4
4
  "description": "Errors, schemas and documentation for the Parcel Shops project",
5
5
  "keywords": [
6
6
  "gls"
@@ -222,9 +222,10 @@ const shop = () => ({
222
222
  address: addressWithRequiredLocation(),
223
223
  capabilities: {
224
224
  type: 'array',
225
- items: { type: 'string', enum: ['deliver', 'pickup', 'sell','sellplus', 'gold'] },
225
+ items: { type: 'string', enum: ['deliver', 'pickup', 'sell','sellplus'] },
226
226
  uniqueItems: true,
227
227
  },
228
+
228
229
  openingSchedule: shopSchedule(),
229
230
  holidays: shopHolidays(),
230
231
  timezone: timezone(),
@@ -238,6 +239,7 @@ const shop = () => ({
238
239
  derivationSettings: derivationSettings(),
239
240
  expirationSettings: expirationSettings(),
240
241
  eco: { type: 'boolean', default: false },
242
+ gold: { type: 'boolean', default: false },
241
243
  squareCode: { type: 'string' },
242
244
  clientCode: { type: 'string' }
243
245
  },
@@ -307,6 +309,7 @@ const createShopRequest = () =>
307
309
  'derivationSettings',
308
310
  'expirationSettings',
309
311
  'eco',
312
+ 'gold',
310
313
  'squareCode',
311
314
  'clientCode'
312
315
  ]),
@@ -411,7 +414,7 @@ const updateShopRequest = () =>
411
414
  status: setShopStatus(),
412
415
  ...pickProperties(
413
416
  shop(),
414
- ['name', 'address', 'capabilities', 'openingSchedule', 'holidays', 'contacts', 'eco', 'squareCode', 'clientCode'],
417
+ ['name', 'address', 'capabilities', 'openingSchedule', 'holidays', 'contacts', 'eco', 'gold', 'squareCode', 'clientCode'],
415
418
  ['fiscal', 'activity', 'notes', 'derivationSettings', 'expirationSettings'],
416
419
  ),
417
420
  },
@@ -458,6 +461,7 @@ const upsertShopRequest = () => (
458
461
  'derivationSettings',
459
462
  'expirationSettings',
460
463
  'eco',
464
+ 'gold',
461
465
  'squareCode',
462
466
  'clientCode'
463
467
  ]),