@gls_spain/gps-common 35.19.2 → 35.19.4

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,19 @@
1
+ ## [35.19.4](https://github.com/GLS-Spain/gps-common/compare/v35.19.3...v35.19.4) (2026-10-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * channeling agency code now is type number ([9d09898](https://github.com/GLS-Spain/gps-common/commit/9d09898d7abef0c1658f2edb04e532e1de825447))
7
+ * channelingagencycode to type integer instaed number ([41cdd9a](https://github.com/GLS-Spain/gps-common/commit/41cdd9af0bddf7187ce2a17b2f6e0db64785e9de))
8
+ * check channelingAgencyCode is not required, can be null, integer and can be not an empty string ([79d9bad](https://github.com/GLS-Spain/gps-common/commit/79d9bad7e8efccd259d44386bfde3f95fa3d478c))
9
+
10
+ ## [35.19.3](https://github.com/GLS-Spain/gps-common/compare/v35.19.2...v35.19.3) (2026-10-14)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * quit required createLocker and fix property name in address schema ([158ed74](https://github.com/GLS-Spain/gps-common/commit/158ed74e11cc704bc87858d44cc979d54de385ff))
16
+
1
17
  ## [35.19.2](https://github.com/GLS-Spain/gps-common/compare/v35.19.1...v35.19.2) (2026-10-07)
2
18
 
3
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gls_spain/gps-common",
3
- "version": "35.19.2",
3
+ "version": "35.19.4",
4
4
  "description": "Errors, schemas and documentation for the Parcel Shops project",
5
5
  "keywords": [
6
6
  "gls"
@@ -304,7 +304,7 @@ const addressWithRequiredLocation = () =>
304
304
  streetType: { type: 'string', trim: true, maxLength: 50 },
305
305
  streetName: { type: 'string', trim: true, maxLength: 200 },
306
306
  streetNumber: { type: 'string', trim: true, maxLength: 50 }, // alfanumérico: '12', '12B', 'S/N'
307
- notes: { type: 'string', trim: true, maxLength: 200 },
307
+ addressDetails: { type: 'string', trim: true, maxLength: 200 },
308
308
  manuallyVerified: { type: 'boolean' },
309
309
  addressValidationDate: { type: 'string', trim: true },
310
310
  },
@@ -503,7 +503,7 @@ const lockerAddress = () => ({
503
503
  streetType: { type: 'string', trim: true, maxLength: 50 },
504
504
  streetName: { type: 'string', trim: true, maxLength: 200 },
505
505
  streetNumber: { type: 'string', trim: true, maxLength: 50 }, // alfanumérico: '12', '12B', 'S/N'
506
- notes: { type: 'string', trim: true, maxLength: 200 }, // observaciones
506
+ addressDetails: { type: 'string', trim: true, maxLength: 200 }, // observaciones
507
507
  manuallyVerified: { type: 'boolean' },
508
508
  addressValidationDate: { type: 'string', trim: true, maxLength: 30 },
509
509
  // campo específico de locker
@@ -246,7 +246,7 @@ const shop = () => ({
246
246
  squareCode: { type: ['integer', 'string'], minimum: 0, maximum: 32767, description: 'agency code' },
247
247
  clientCode: { type: ['integer', 'string'], description: 'client code' },
248
248
  // 2024-07-22 JJC campo de agencia de canalización
249
- channelingAgencyCode: { type: ['integer', 'string', 'null'], description: 'Channeling Agency Code' },
249
+ channelingAgencyCode: { type: ['integer', 'null'], minimum: 0, maximum: 32767, description: 'Channeling Agency Code' },
250
250
  // Volume capacity 07/11/2024
251
251
  capacity: { type: 'string' },
252
252
  // NXT integration
@@ -429,6 +429,15 @@ const findShopsNetworkAdminRequest = () =>
429
429
 
430
430
  const findShopsResponse = () => findResponse(shop());
431
431
 
432
+ // En update, los strings obligatorios no pueden llegar vacíos: trim convierte " " en "" y se sobrescribiría el valor en BD.
433
+ // Se usa pattern en vez de minLength porque Ajv valida minLength antes de que trim modifique el dato.
434
+ const nonEmpty = () => ({ pattern: '\\S' });
435
+
436
+ const updateShopAddress = () =>
437
+ mergeSchemas(addressWithRequiredLocation(), {
438
+ properties: { street: nonEmpty(), postalCode: nonEmpty(), locality: nonEmpty(), country: nonEmpty() },
439
+ });
440
+
432
441
  const updateShopRequest = () =>
433
442
  updateRequest(
434
443
  findById(),
@@ -461,6 +470,10 @@ const updateShopRequest = () =>
461
470
  ],
462
471
  ['fiscal', 'activity', 'notes', 'derivationSettings', 'expirationSettings'],
463
472
  ),
473
+ name: mergeSchemas(shop().properties.name, nonEmpty()),
474
+ address: updateShopAddress(),
475
+ squareCode: mergeSchemas(shop().properties.squareCode, nonEmpty()),
476
+ clientCode: mergeSchemas(shop().properties.clientCode, nonEmpty()),
464
477
  },
465
478
  minProperties: 0,
466
479
  additionalProperties: false,
@@ -672,7 +685,7 @@ const lockerNxt = () => ({
672
685
  activationDate: { type: 'string', format: 'date-time' },
673
686
  lockerId: { type: 'string', maxLength: 36 }, // UUID = 36 chars
674
687
  },
675
- required: ['lockerName', 'lockerId'],
688
+ required: ['lockerName'],
676
689
  additionalProperties: false,
677
690
  },
678
691
  },