@gls_spain/gps-common 35.14.2 → 35.14.3

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,10 @@
1
+ ## [35.14.3](https://github.com/GLS-Spain/gps-common/compare/v35.14.2...v35.14.3) (2025-09-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * sales.discount fix ([7a7bceb](https://github.com/GLS-Spain/gps-common/commit/7a7bcebac719d42943b55f094ad201d7603b00cf))
7
+
1
8
  ## [35.14.2](https://github.com/GLS-Spain/gps-common/compare/v35.14.1...v35.14.2) (2025-09-01)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gls_spain/gps-common",
3
- "version": "35.14.2",
3
+ "version": "35.14.3",
4
4
  "description": "Errors, schemas and documentation for the Parcel Shops project",
5
5
  "keywords": [
6
6
  "gls"
@@ -32,6 +32,30 @@ const parcelShopData = () => ({
32
32
  required: ['_id', 'email', 'name', 'phone', 'postalCode'],
33
33
  });
34
34
 
35
+ const carrefourDiscount = () => ({
36
+ type: 'object',
37
+ properties: {
38
+ type: { type: 'string', enum: ['carrefour'] },
39
+ code: { type: 'string' },
40
+ price: { type: 'integer', minimum: 0 },
41
+ percentage: { type: 'number', minimum: 0 },
42
+ clientPrice: { type: 'integer', minimum: 0 },
43
+ },
44
+ required: ['type', 'code', 'price'],
45
+ additionalProperties: false,
46
+ });
47
+
48
+ const campaignDiscount = () => ({
49
+ type: 'object',
50
+ properties: {
51
+ type: { type: 'string', enum: ['campaign'] },
52
+ code: { type: 'string' },
53
+ price: { type: 'integer', minimum: 0 },
54
+ },
55
+ required: ['type', 'code', 'price'],
56
+ additionalProperties: false,
57
+ });
58
+
35
59
  const sale = () => ({
36
60
  title: 'sale',
37
61
  type: 'object',
@@ -152,15 +176,7 @@ const sale = () => ({
152
176
  typeService: { type: 'string', enum: ['parcel', 'traveller'] },
153
177
  // 2025-07-25 JL descuentos (campañas/carrefour)
154
178
  discount: {
155
- type: 'object',
156
- properties: {
157
- type: { type: 'string' },
158
- code: { type: 'string' },
159
- price: { type: 'integer', minimum: 0 },
160
- clientPrice: { type: 'integer', minimum: 0 },
161
- },
162
- required: ['type', 'code', 'price'],
163
- additionalProperties: false,
179
+ oneOf: [campaignDiscount(), carrefourDiscount()],
164
180
  },
165
181
  },
166
182
  required: [