@gls_spain/gps-common 35.15.2 → 35.15.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,10 +1,24 @@
1
- ## [35.15.2](https://github.com/GLS-Spain/gps-common/compare/v35.15.1...v35.15.2) (2026-03-06)
1
+ ## [35.15.4](https://github.com/GLS-Spain/gps-common/compare/v35.15.3...v35.15.4) (2026-03-10)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * test schema lockers ([a525c25](https://github.com/GLS-Spain/gps-common/commit/a525c256202951fd9b9354109eae04521d94125d))
6
+ * add locker variable that i forgot ([f2db81e](https://github.com/GLS-Spain/gps-common/commit/f2db81e5d600ae23dc41ef02e21c4a262717c0c6))
7
7
 
8
+ ## [35.15.3](https://github.com/GLS-Spain/gps-common/compare/v35.15.2...v35.15.3) (2026-03-10)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add properties locker schema ([3450fae](https://github.com/GLS-Spain/gps-common/commit/3450fae69e5079590a6d8e160b49907a6cd75992))
14
+
15
+ ## [35.15.2](https://github.com/GLS-Spain/gps-common/compare/v35.15.1...v35.15.2) (2026-03-06)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * test schema lockers ([a525c25](https://github.com/GLS-Spain/gps-common/commit/a525c256202951fd9b9354109eae04521d94125d))
21
+
8
22
  ## [35.15.1](https://github.com/GLS-Spain/gps-common/compare/v35.15.0...v35.15.1) (2026-03-06)
9
23
 
10
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gls_spain/gps-common",
3
- "version": "35.15.2",
3
+ "version": "35.15.4",
4
4
  "description": "Errors, schemas and documentation for the Parcel Shops project",
5
5
  "keywords": [
6
6
  "gls"
@@ -557,6 +557,7 @@ const upsertShopResponse = () => ({
557
557
 
558
558
  // LOCKERS
559
559
 
560
+
560
561
  const locker = () => ({
561
562
  title: 'locker',
562
563
  type: 'object',
@@ -681,21 +682,53 @@ const locker = () => ({
681
682
  additionalProperties: false,
682
683
  });
683
684
 
685
+
684
686
  const createLockerRequest = () =>
685
687
  createRequest({
686
688
  type: 'object',
687
689
  properties: {
688
- // ----- parcelshop -----
690
+
689
691
  parcelshop: {
690
692
  type: 'object',
691
693
  properties: {
692
- _id: uuid(), // el handler lo asigna a locker.carrier.lockerId
694
+ _id: uuid(),
693
695
  createdAt: datetime(),
694
696
  network: objectWithUuid(),
695
697
  zone: objectWithUuid(),
696
698
  openingRepresentative: setShopRepresentative(),
697
699
  managingRepresentative: setShopRepresentative(),
698
- name: shop().properties.name,
700
+
701
+ status: {
702
+ type: 'object',
703
+ properties: {
704
+ code: { type: 'string', enum: ['enabled', 'disabled', 'manuallyDisabled'] },
705
+ disabled: {
706
+ type: 'object',
707
+ properties: {
708
+ at: datetime(),
709
+ reason: { type: 'string', trim: true },
710
+ },
711
+ required: ['at', 'reason'],
712
+ additionalProperties: false,
713
+ },
714
+ manuallyDisabled: {
715
+ type: 'object',
716
+ properties: {
717
+ _id: uuid(),
718
+ at: datetime(),
719
+ to: datetime(),
720
+ reason: { type: 'string', trim: true },
721
+ },
722
+ required: ['at', 'reason'],
723
+ additionalProperties: false,
724
+ },
725
+ },
726
+ required: ['code'],
727
+ additionalProperties: false,
728
+ },
729
+
730
+ name: { type: 'string', trim: true },
731
+
699
732
  address: {
700
733
  type: 'object',
701
734
  properties: {
@@ -704,6 +737,7 @@ const createLockerRequest = () =>
704
737
  postalCode: { type: 'string', trim: true },
705
738
  locality: { type: 'string', trim: true },
706
739
  country: { type: 'string', trim: true },
740
+ access_descript_locker: { type: 'string', trim: true },
707
741
  location: {
708
742
  type: 'object',
709
743
  properties: {
@@ -711,56 +745,48 @@ const createLockerRequest = () =>
711
745
  type: 'object',
712
746
  properties: {
713
747
  type: { type: 'string', enum: ['Point'] },
714
- coordinates: { type: 'array', items: { type: 'number' }, minItems: 2, maxItems: 2 },
748
+ coordinates: {
749
+ type: 'array',
750
+ items: { type: 'number' },
751
+ minItems: 2,
752
+ maxItems: 2,
753
+ },
715
754
  },
716
- required: ['coordinates'],
755
+ required: ['type', 'coordinates'],
717
756
  additionalProperties: false,
718
757
  },
719
- precision: { type: 'string' },
720
758
  },
721
759
  required: ['geometry'],
722
760
  additionalProperties: false,
723
761
  },
724
762
  },
725
- additionalProperties: true, // permite access_descript_locker y otros campos extra
763
+ required: ['street', 'postalCode', 'locality', 'country', 'location'],
764
+ additionalProperties: false,
726
765
  },
766
+
727
767
  openingSchedule: shop().properties.openingSchedule,
728
768
  timezone: shop().properties.timezone,
729
769
  activity: shop().properties.activity,
730
770
  eco: shop().properties.eco,
731
- status: {
771
+
772
+ fiscal: fiscal(),
773
+
774
+ nxt: {
732
775
  type: 'object',
733
776
  properties: {
734
- code: { type: 'string', enum: ['enabled', 'disabled', 'manuallyDisabled'] },
735
- disabled: {
736
- type: 'object',
737
- properties: {
738
- at: datetime(),
739
- reason: { type: 'string', trim: true },
740
- },
741
- required: ['at', 'reason'],
742
- additionalProperties: false,
743
- },
744
- manuallyDisabled: {
745
- type: 'object',
746
- properties: {
747
- _id: uuid(),
748
- at: datetime(),
749
- to: datetime(),
750
- reason: { type: 'string', trim: true },
751
- },
752
- required: ['at', 'reason'],
753
- additionalProperties: false,
754
- },
777
+ parcelShopId: { type: 'string' },
755
778
  },
756
- required: ['code'],
779
+ required: ['parcelShopId'],
757
780
  additionalProperties: false,
758
781
  },
782
+
783
+ // Campos _locker: fuente de verdad para coordenadas y dirección
759
784
  direccion_locker: { type: 'string', trim: true },
760
785
  codpostal_locker: { type: 'string', trim: true },
761
786
  ciudad_locker: { type: 'string', trim: true },
762
- longitud_locker: { type: 'number' },
763
- latitud_locker: { type: 'number' },
787
+ // ✅ longitud_locker y latitud_locker son la fuente de verdad de coordenadas
788
+ longitud_locker: { type: 'number', description: 'Fuente de verdad para longitude — sobreescribe address.location.geometry.coordinates[0]' },
789
+ latitud_locker: { type: 'number', description: 'Fuente de verdad para latitude — sobreescribe address.location.geometry.coordinates[1]' },
764
790
  capacity_locker: { type: 'string' },
765
791
  access_descript_locker: { type: 'string', trim: true },
766
792
  },
@@ -779,18 +805,18 @@ const createLockerRequest = () =>
779
805
  ],
780
806
  additionalProperties: false,
781
807
  },
782
- // ----- locker ----- NXT MODEL
783
- lockerDevice: {
784
- title: 'lockerDevice',
808
+
809
+ locker: {
810
+ title: 'locker',
785
811
  type: 'object',
786
812
  properties: {
787
813
 
788
814
  provider: {
789
815
  type: 'object',
790
816
  properties: {
791
- name: { type: 'string', trim: true }, // "KEBA"
792
- lockerVersion: { type: 'string', trim: true }, // "v1.0"
793
- lockerModel: { type: 'string', trim: true }, // "gls_es_0001_m03_b031"
817
+ name: { type: 'string', trim: true },
818
+ lockerVersion: { type: 'string', trim: true },
819
+ lockerModel: { type: 'string', trim: true },
794
820
  },
795
821
  required: ['name'],
796
822
  additionalProperties: false,
@@ -799,13 +825,13 @@ const createLockerRequest = () =>
799
825
  location: {
800
826
  type: 'object',
801
827
  properties: {
802
- streetNumber: { type: 'string', trim: true }, // "3"
803
- street: { type: 'string', trim: true }, // "AL-12 3"
804
- postalCode: { type: 'string', trim: true }, // "04006"
805
- lon: { type: 'number' }, // -2.4229276567318436
806
- lat: { type: 'number' }, // 36.84309556940104
807
- countryCode: { type: 'string', trim: true, minLength: 2, maxLength: 2 }, // "ES"
808
- city: { type: 'string', trim: true }, // "Almería"
828
+ streetNumber: { type: 'string', trim: true },
829
+ street: { type: 'string', trim: true },
830
+ postalCode: { type: 'string', trim: true },
831
+ lon: { type: 'number' },
832
+ lat: { type: 'number' },
833
+ countryCode: { type: 'string', trim: true, minLength: 2, maxLength: 2 },
834
+ city: { type: 'string', trim: true },
809
835
  },
810
836
  required: ['street', 'postalCode', 'countryCode', 'city'],
811
837
  additionalProperties: false,
@@ -814,9 +840,9 @@ const createLockerRequest = () =>
814
840
  features: {
815
841
  type: 'object',
816
842
  properties: {
817
- hasScreen: { type: 'boolean' }, // true
818
- hasPinPad: { type: 'boolean' }, // true
819
- hasPinBarcodeReader: { type: 'boolean' }, // true
843
+ hasScreen: { type: 'boolean' },
844
+ hasPinPad: { type: 'boolean' },
845
+ hasPinBarcodeReader: { type: 'boolean' },
820
846
  },
821
847
  additionalProperties: false,
822
848
  },
@@ -824,9 +850,9 @@ const createLockerRequest = () =>
824
850
  carrier: {
825
851
  type: 'object',
826
852
  properties: {
827
- lockerName: { type: 'string', trim: true }, // "Locker GLS NXT - 24/7 MOEVE Los Partidores"
828
- activationDate: { type: 'string', format: 'date-time' }, // "2027-03-10T01:00:00Z"
829
- lockerId: { type: 'string' }, // uuid — asignado por el handler antes de validar
853
+ lockerName: { type: 'string', trim: true },
854
+ activationDate: { type: 'string', format: 'date-time' },
855
+ lockerId: { type: 'string' }, // asignado por el handler con parcelshop._id
830
856
  },
831
857
  required: ['lockerName', 'lockerId'],
832
858
  additionalProperties: false,
@@ -835,8 +861,10 @@ const createLockerRequest = () =>
835
861
  },
836
862
  required: ['provider', 'location', 'carrier'],
837
863
  additionalProperties: false,
838
- }
864
+ },
865
+
839
866
  },
867
+ // FIX: era ['parcelshop', 'locker'] con 'lockerDevice' en properties → siempre fallaba
840
868
  required: ['parcelshop', 'locker'],
841
869
  additionalProperties: false,
842
870
  });
@@ -844,7 +872,6 @@ const createLockerRequest = () =>
844
872
  const createLockerResponse = () => createResponse(locker());
845
873
 
846
874
 
847
-
848
875
  module.exports = {
849
876
  shop,
850
877
  locker,