@gls_spain/gps-common 34.0.1 → 34.1.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/.idea/workspace.xml +14 -10
- package/CHANGELOG.md +7 -0
- package/open-api-spec/index.js +8 -7
- package/package.json +1 -1
- package/schemas/definitions/expeditions.js +24 -3
package/.idea/workspace.xml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<component name="ChangeListManager">
|
|
4
4
|
<list default="true" id="c2833e40-3178-44f3-9bc5-203849985c7f" name="Default Changelist" comment="">
|
|
5
5
|
<change beforePath="$PROJECT_DIR$/open-api-spec/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/open-api-spec/index.js" afterDir="false" />
|
|
6
|
-
<change beforePath="$PROJECT_DIR$/schemas/definitions/
|
|
6
|
+
<change beforePath="$PROJECT_DIR$/schemas/definitions/expeditions.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/expeditions.js" afterDir="false" />
|
|
7
7
|
</list>
|
|
8
8
|
<option name="SHOW_DIALOG" value="false" />
|
|
9
9
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -592,7 +592,11 @@
|
|
|
592
592
|
<workItem from="1595999862116" duration="11371000" />
|
|
593
593
|
<workItem from="1596052438845" duration="2941000" />
|
|
594
594
|
<workItem from="1596088002152" duration="1276000" />
|
|
595
|
-
<workItem from="1596102863465" duration="
|
|
595
|
+
<workItem from="1596102863465" duration="2035000" />
|
|
596
|
+
<workItem from="1596121607720" duration="51000" />
|
|
597
|
+
<workItem from="1596176213722" duration="391000" />
|
|
598
|
+
<workItem from="1596210378560" duration="336000" />
|
|
599
|
+
<workItem from="1597913906065" duration="2109000" />
|
|
596
600
|
</task>
|
|
597
601
|
<servers />
|
|
598
602
|
</component>
|
|
@@ -635,22 +639,22 @@
|
|
|
635
639
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
636
640
|
</state>
|
|
637
641
|
<state x="762" y="341" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.23.2048.1129@0.23.2048.1129" timestamp="1595577705727" />
|
|
638
|
-
<state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="
|
|
642
|
+
<state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1597916472340">
|
|
639
643
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
640
644
|
</state>
|
|
641
|
-
<state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
642
|
-
<state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="
|
|
645
|
+
<state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1597916472340" />
|
|
646
|
+
<state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1597916472339">
|
|
643
647
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
644
648
|
</state>
|
|
645
|
-
<state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
646
|
-
<state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="
|
|
649
|
+
<state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1597916472339" />
|
|
650
|
+
<state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1597916472339">
|
|
647
651
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
648
652
|
</state>
|
|
649
|
-
<state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
650
|
-
<state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="
|
|
653
|
+
<state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1597916472339" />
|
|
654
|
+
<state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1597916472339">
|
|
651
655
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
652
656
|
</state>
|
|
653
|
-
<state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
657
|
+
<state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1597916472339" />
|
|
654
658
|
<state x="689" y="276" width="670" height="676" key="search.everywhere.popup" timestamp="1595579270021">
|
|
655
659
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
656
660
|
</state>
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [34.1.0](https://github.com/GLS-Spain/gps-common/compare/v34.0.1...v34.1.0) (2020-08-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* can create expeditions that can be received on any shop of multiple networks ([f2fb145](https://github.com/GLS-Spain/gps-common/commit/f2fb14536fe21115a73f9d3edd3596596164d67e))
|
|
7
|
+
|
|
1
8
|
## [34.0.1](https://github.com/GLS-Spain/gps-common/compare/v34.0.0...v34.0.1) (2020-07-30)
|
|
2
9
|
|
|
3
10
|
|
package/open-api-spec/index.js
CHANGED
|
@@ -825,7 +825,7 @@ of each record.
|
|
|
825
825
|
{
|
|
826
826
|
name: 'Callbacks',
|
|
827
827
|
description: `
|
|
828
|
-
This section contains endpoints that are not meant to be used by the API users, instead they meant for other systems (integrations, etc)
|
|
828
|
+
This section contains endpoints that are not meant to be used by the API users, instead they are meant for other systems (integrations, etc)
|
|
829
829
|
to report back information when they have it.
|
|
830
830
|
`,
|
|
831
831
|
},
|
|
@@ -2586,10 +2586,11 @@ ${descriptions.createIdIsOptional}
|
|
|
2586
2586
|
|
|
2587
2587
|
${descriptions.optionalArrayPropertiesEmptyByDefault}
|
|
2588
2588
|
|
|
2589
|
-
An expedition can be associated on creation to either
|
|
2589
|
+
An expedition can be associated on creation to either one shop, one network or multiple networks:
|
|
2590
2590
|
|
|
2591
|
-
- Provide
|
|
2592
|
-
- Provide
|
|
2591
|
+
- Provide \`shop\` when it can be received only in a specific shop. The network will be inserted automatically.
|
|
2592
|
+
- Provide \`network\` when it can be received at any shop in one network. On reception the shop will be added to the expedition.
|
|
2593
|
+
- Provide \`network\` and \`otherNetworks\` when it can be received in any shop in more than one network. On reception the network and shop will be set and the other networks removed.
|
|
2593
2594
|
|
|
2594
2595
|
If the provided shop does not exist the API will return a \`500 ShopDoesNotExistError\`, if it is not enabled it will return a
|
|
2595
2596
|
\`500 ShopNotEnabledError\`, and if it is readonly it will return a \`500 ShopCannotBeUpdatedError\`.
|
|
@@ -2597,7 +2598,7 @@ If the provided shop does not exist the API will return a \`500 ShopDoesNotExist
|
|
|
2597
2598
|
When providing a shop one can also provide a sale if the expedition is created because of it. If the provided sale does not
|
|
2598
2599
|
exist the API will return a \`500 SaleDoesNotExistError\`.
|
|
2599
2600
|
|
|
2600
|
-
If
|
|
2601
|
+
If a provided network does not exist the API will return a \`500 NetworkDoesNotExistError\`.
|
|
2601
2602
|
|
|
2602
2603
|
The \`status.code\` of a new expedition cannot be specified and it will always be \`incoming\`.
|
|
2603
2604
|
|
|
@@ -2805,7 +2806,7 @@ Scan a barcode or QR code and find the appropriate expedition.
|
|
|
2805
2806
|
|
|
2806
2807
|
It can return:
|
|
2807
2808
|
|
|
2808
|
-
- \`ok\`: when the barcode or QR match a single expedition from the **same shop** or
|
|
2809
|
+
- \`ok\`: when the barcode or QR match a single expedition from the **same shop** or the expedition has **no shop** but can be received in this shop network.
|
|
2809
2810
|
- \`notFound\`: when the expedition does not exist.
|
|
2810
2811
|
- \`anotherShop\`: when the expedition belongs to another shop.
|
|
2811
2812
|
- \`multipleResults\`: when the barcode or QR match more than one expedition (e.g. shared reference). Try scanning another barcode.
|
|
@@ -2852,7 +2853,7 @@ and some are not. The result for each expedition depends on its situation:
|
|
|
2852
2853
|
| not found | - | not found | - | - |
|
|
2853
2854
|
| server error | - | error | - | - |
|
|
2854
2855
|
|
|
2855
|
-
(*) If the
|
|
2856
|
+
(*) If the expedition has no shop but it can be received in this network, then on reception its network and shop will be set to the receiving shop.
|
|
2856
2857
|
|
|
2857
2858
|
${securitySchemes.tokens}
|
|
2858
2859
|
${securitySchemes.shopUserRole}`,
|
package/package.json
CHANGED
|
@@ -129,12 +129,24 @@ const expedition = () => ({
|
|
|
129
129
|
required: ['_id', 'name'],
|
|
130
130
|
additionalProperties: false,
|
|
131
131
|
},
|
|
132
|
+
otherNetworks: {
|
|
133
|
+
type: 'array',
|
|
134
|
+
items: {
|
|
135
|
+
type: 'object',
|
|
136
|
+
properties: { ...pickProperties(network(), ['_id', 'name']) },
|
|
137
|
+
required: ['_id', 'name'],
|
|
138
|
+
additionalProperties: false,
|
|
139
|
+
},
|
|
140
|
+
minItems: 1,
|
|
141
|
+
uniqueItems: true,
|
|
142
|
+
description: `only for incoming expeditions created with multiple networks and no shop, on reception this field is removed and \`network\` and \`shop\` set to the receiving shop`,
|
|
143
|
+
},
|
|
132
144
|
shop: {
|
|
133
145
|
type: 'object',
|
|
134
146
|
properties: { ...pickProperties(shop(), ['_id', 'name']) },
|
|
135
147
|
required: ['_id', 'name'],
|
|
136
148
|
additionalProperties: false,
|
|
137
|
-
description: 'not available for incoming expeditions
|
|
149
|
+
description: 'not available for incoming expeditions created with no shop, on reception this will be set to the receiving shop',
|
|
138
150
|
},
|
|
139
151
|
type: { type: 'string', enum: ['delivery', 'pickup'] },
|
|
140
152
|
status: {
|
|
@@ -336,11 +348,20 @@ const createExpeditionWithShop = () => ({
|
|
|
336
348
|
});
|
|
337
349
|
|
|
338
350
|
const createExpeditionWithNetwork = () => ({
|
|
339
|
-
title: 'create with
|
|
351
|
+
title: 'create with one or more networks',
|
|
340
352
|
type: 'object',
|
|
341
353
|
properties: {
|
|
342
354
|
...pickProperties(expedition(), ['_id', 'createdAt']),
|
|
343
|
-
network: objectWithUuid(),
|
|
355
|
+
network: mergeSchemas(objectWithUuid(), {
|
|
356
|
+
description: `any shop in the network can receive it, on reception \`shop\` will be set to the receiving shop`,
|
|
357
|
+
}),
|
|
358
|
+
otherNetworks: {
|
|
359
|
+
type: 'array',
|
|
360
|
+
items: objectWithUuid(),
|
|
361
|
+
minItems: 1,
|
|
362
|
+
uniqueItems: true,
|
|
363
|
+
description: `additional networks the expedition can be received in, on reception this will be removed and \`network\` and \`shop\` set to the receiving shop`,
|
|
364
|
+
},
|
|
344
365
|
...pickProperties(expedition(), [
|
|
345
366
|
'type',
|
|
346
367
|
'code',
|