@gls_spain/gps-common 32.0.0 → 32.0.2
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 +20 -14
- package/CHANGELOG.md +14 -0
- package/open-api-spec/index.js +33 -34
- package/package.json +1 -1
- package/schemas/definitions/gls-spain-integration-events.js +1 -6
package/.idea/workspace.xml
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<project version="4">
|
|
3
3
|
<component name="ChangeListManager">
|
|
4
|
-
<list default="true" id="c2833e40-3178-44f3-9bc5-203849985c7f" name="Default Changelist" comment=""
|
|
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/historic-records.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/historic-records.js" afterDir="false" />
|
|
7
|
-
</list>
|
|
4
|
+
<list default="true" id="c2833e40-3178-44f3-9bc5-203849985c7f" name="Default Changelist" comment="" />
|
|
8
5
|
<option name="SHOW_DIALOG" value="false" />
|
|
9
6
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
10
7
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -126,8 +123,8 @@
|
|
|
126
123
|
</configuration>
|
|
127
124
|
<recent_temporary>
|
|
128
125
|
<list>
|
|
129
|
-
<item itemvalue="npm.build-documentation" />
|
|
130
126
|
<item itemvalue="JavaScript Debug.documentation.html (1)" />
|
|
127
|
+
<item itemvalue="npm.build-documentation" />
|
|
131
128
|
<item itemvalue="npm.test" />
|
|
132
129
|
<item itemvalue="Jest.index.test.js" />
|
|
133
130
|
<item itemvalue="Jest.#errors" />
|
|
@@ -544,7 +541,16 @@
|
|
|
544
541
|
<workItem from="1585290769759" duration="503000" />
|
|
545
542
|
<workItem from="1585309502233" duration="144000" />
|
|
546
543
|
<workItem from="1585319154346" duration="599000" />
|
|
547
|
-
<workItem from="1585377577645" duration="
|
|
544
|
+
<workItem from="1585377577645" duration="3315000" />
|
|
545
|
+
<workItem from="1585476384500" duration="770000" />
|
|
546
|
+
<workItem from="1585492634523" duration="20000" />
|
|
547
|
+
<workItem from="1585557077739" duration="601000" />
|
|
548
|
+
<workItem from="1585571204150" duration="600000" />
|
|
549
|
+
<workItem from="1585587710749" duration="604000" />
|
|
550
|
+
<workItem from="1585635898343" duration="2594000" />
|
|
551
|
+
<workItem from="1585663493939" duration="466000" />
|
|
552
|
+
<workItem from="1585670078952" duration="596000" />
|
|
553
|
+
<workItem from="1585725349656" duration="659000" />
|
|
548
554
|
</task>
|
|
549
555
|
<servers />
|
|
550
556
|
</component>
|
|
@@ -600,22 +606,22 @@
|
|
|
600
606
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
601
607
|
</state>
|
|
602
608
|
<state x="606" y="280" key="EditFileWatcherDialog/0.23.2048.1129@0.23.2048.1129" timestamp="1580283934403" />
|
|
603
|
-
<state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="
|
|
609
|
+
<state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1585769591024">
|
|
604
610
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
605
611
|
</state>
|
|
606
|
-
<state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
607
|
-
<state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="
|
|
612
|
+
<state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1585769591024" />
|
|
613
|
+
<state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1585769591023">
|
|
608
614
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
609
615
|
</state>
|
|
610
|
-
<state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
611
|
-
<state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="
|
|
616
|
+
<state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1585769591023" />
|
|
617
|
+
<state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1585769591023">
|
|
612
618
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
613
619
|
</state>
|
|
614
|
-
<state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
615
|
-
<state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="
|
|
620
|
+
<state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1585769591023" />
|
|
621
|
+
<state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1585769591024">
|
|
616
622
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
617
623
|
</state>
|
|
618
|
-
<state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
624
|
+
<state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1585769591024" />
|
|
619
625
|
<state x="0" y="23" width="2048" height="1129" key="SettingsEditor" timestamp="1580283935326">
|
|
620
626
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
621
627
|
</state>
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [32.0.2](https://github.com/GLS-Spain/gps-common/compare/v32.0.1...v32.0.2) (2020-04-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* remove expiration date from the gls spain receive from customer event ([3d199b1](https://github.com/GLS-Spain/gps-common/commit/3d199b1b8eb72bc9a759c155bec25ae4a57231f6))
|
|
7
|
+
|
|
8
|
+
## [32.0.1](https://github.com/GLS-Spain/gps-common/compare/v32.0.0...v32.0.1) (2020-03-31)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* improve documentation about receiving expeditions with no shop ([3c08269](https://github.com/GLS-Spain/gps-common/commit/3c08269d7a68f631a37cfd4322fc8cdb1ede2795))
|
|
14
|
+
|
|
1
15
|
# [32.0.0](https://github.com/GLS-Spain/gps-common/compare/v31.0.3...v32.0.0) (2020-03-28)
|
|
2
16
|
|
|
3
17
|
|
package/open-api-spec/index.js
CHANGED
|
@@ -417,8 +417,6 @@ own network using the [shop users](#tag/Shop-users) endpoints.
|
|
|
417
417
|
description: `
|
|
418
418
|
Expeditions are the packages that are delivered and picked up at parcel shops.
|
|
419
419
|
|
|
420
|
-
Every expedition is associated to a parcel shop.
|
|
421
|
-
|
|
422
420
|
Super administrators can manage expeditions using the [expeditions](#tag/Expeditions) endpoints. Shop users can also use
|
|
423
421
|
some of those endpoints to receive and give expeditions from and to GLS and customers.
|
|
424
422
|
|
|
@@ -427,10 +425,10 @@ some of those endpoints to receive and give expeditions from and to GLS and cust
|
|
|
427
425
|
{
|
|
428
426
|
name: 'Pod',
|
|
429
427
|
description: `
|
|
430
|
-
Expeditions that have been delivered to a customer have a POD (Proof Of Delivery) associated to them that contains the
|
|
431
|
-
signature of the customer
|
|
428
|
+
Expeditions that have been picked up by or delivered to a customer have a POD (Proof Of Delivery) associated to them that contains the
|
|
429
|
+
signature of the customer.
|
|
432
430
|
|
|
433
|
-
Pods are created automatically by the API when an expedition is delivered to a customer.
|
|
431
|
+
Pods are created automatically by the API when an expedition is picked up by or delivered to a customer.
|
|
434
432
|
|
|
435
433
|
Super administrators, network administrators and shop users can use the [pods](#tag/Pods) endpoints to find the pods of the
|
|
436
434
|
expeditions they have access to.
|
|
@@ -586,13 +584,13 @@ Sent when a shop delivers an expedition to a driver.
|
|
|
586
584
|
|
|
587
585
|
## Expiration reminder event
|
|
588
586
|
|
|
589
|
-
Sent when the API detects in the background that it is time to remind the customer to pick up the expedition
|
|
587
|
+
Sent when the API detects in the background that it is time to remind the customer to pick up the expedition.
|
|
590
588
|
|
|
591
589
|
<SchemaDefinition schemaRef="#/components/schemas/expirationReminderEvent" />
|
|
592
590
|
|
|
593
591
|
## Expired event
|
|
594
592
|
|
|
595
|
-
Sent when the API detects in the background that
|
|
593
|
+
Sent when the API detects in the background that the expedition has expired.
|
|
596
594
|
|
|
597
595
|
<SchemaDefinition schemaRef="#/components/schemas/expiredEvent" />
|
|
598
596
|
|
|
@@ -640,10 +638,6 @@ These settings can be set at various levels of specificity:
|
|
|
640
638
|
- Network specific values: each network can have its custom settings, which override the default ones.
|
|
641
639
|
- Shop specific values: each shop can have its custom settings, which override the network and default ones.`,
|
|
642
640
|
},
|
|
643
|
-
{
|
|
644
|
-
name: 'Integrations',
|
|
645
|
-
description: `Find integrations configurations.`,
|
|
646
|
-
},
|
|
647
641
|
{
|
|
648
642
|
name: 'Super admins',
|
|
649
643
|
description: `Create and manage super admins.
|
|
@@ -740,7 +734,7 @@ at the parcel shop for a driver to retrieve it later.
|
|
|
740
734
|
|
|
741
735
|
### Status
|
|
742
736
|
|
|
743
|
-
The \`status.code\` property of an expedition indicates the situation of an expedition from the parcel shop
|
|
737
|
+
The \`status.code\` property of an expedition indicates the situation of an expedition from the parcel shop point of view:
|
|
744
738
|
|
|
745
739
|
- \`incoming\`: the expedition is on its way to the parcel shop. A driver or a customer is expected to come and leave it at the parcel shop.
|
|
746
740
|
- \`inShop\`: the parcel shop has received the expedition and it is waiting for the other person to retrieve it.
|
|
@@ -756,7 +750,7 @@ because it has a predetermined life cycle. The following endpoints update an exp
|
|
|
756
750
|
| :--- | :--- | :--- | :--- | :--- |
|
|
757
751
|
| [receiveFromDriver](#tag/Expeditions/paths/~1expeditions~1receiveFromDriver/post) | delivery | incoming | inShop | receivedFrom, expiration |
|
|
758
752
|
| [receiveAllFromDriver](#tag/Expeditions/paths/~1expeditions~1receiveAllFromDriver/post) | delivery | incoming | inShop | receivedFrom, expiration |
|
|
759
|
-
| [receiveFromCustomer](#tag/Expeditions/paths/~1expeditions~1receiveFromCustomer/post) | pickup | incoming | inShop | receivedFrom
|
|
753
|
+
| [receiveFromCustomer](#tag/Expeditions/paths/~1expeditions~1receiveFromCustomer/post) | pickup | incoming | inShop | receivedFrom |
|
|
760
754
|
| [giveToCustomer](#tag/Expeditions/paths/~1expeditions~1giveToCustomer/post) | delivery | inShop | delivered | givenTo |
|
|
761
755
|
| [giveToDriver](#tag/Expeditions/paths/~1expeditions~1giveToDriver/post) | delivery<br/>pickup | inShopExpired<br/>inShop | delivered<br/>delivered | givenTo<br/>givenTo |
|
|
762
756
|
| [redirect](#tag/Expeditions/paths/~1expeditions~1redirect/post) | any | any | incoming | clear everything |
|
|
@@ -777,6 +771,10 @@ Once created, sales representatives can be associated to parcel shops.`,
|
|
|
777
771
|
name: 'Historic records',
|
|
778
772
|
description: `Find historic records.`,
|
|
779
773
|
},
|
|
774
|
+
{
|
|
775
|
+
name: 'Integrations',
|
|
776
|
+
description: `Find integrations configurations.`,
|
|
777
|
+
},
|
|
780
778
|
];
|
|
781
779
|
|
|
782
780
|
const headers = {
|
|
@@ -2699,15 +2697,16 @@ Receives expeditions from a driver, changing their status code and adding more p
|
|
|
2699
2697
|
Each expedition is processed individually and its result returned, so it is possible that some expeditions are processed
|
|
2700
2698
|
and some are not. The result for each expedition depends on its situation:
|
|
2701
2699
|
|
|
2702
|
-
| Expedition
|
|
2703
|
-
| :---
|
|
2704
|
-
| found in no shop<br/>found in same shop | delivery + incoming | ok | inShop | receivedFrom, expiration |
|
|
2705
|
-
| found in
|
|
2706
|
-
| found in
|
|
2707
|
-
|
|
|
2708
|
-
|
|
|
2700
|
+
| Expedition | Type + Status code | Result | New status code | New status properties |
|
|
2701
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
2702
|
+
| found in no shop (*)<br/>found in same shop | delivery + incoming | ok | inShop | receivedFrom, expiration |
|
|
2703
|
+
| found in no shop | any other combination | not found | - | - |
|
|
2704
|
+
| found in same shop | any other combination | another situation | - | - |
|
|
2705
|
+
| found in another shop | - | another shop | - | - |
|
|
2706
|
+
| not found | - | not found | - | - |
|
|
2707
|
+
| server error | - | error | - | - |
|
|
2709
2708
|
|
|
2710
|
-
If the received expedition is not associated to a shop this operation will associate it to the shop receiving it.
|
|
2709
|
+
(*) If the received expedition is not associated to a shop this operation will associate it to the shop that is receiving it.
|
|
2711
2710
|
|
|
2712
2711
|
${securitySchemes.tokens}
|
|
2713
2712
|
${securitySchemes.shopUserRole}`,
|
|
@@ -2736,12 +2735,11 @@ ${securitySchemes.shopUserRole}`,
|
|
|
2736
2735
|
tags: ['Expeditions'],
|
|
2737
2736
|
summary: '[U] Receive all from driver',
|
|
2738
2737
|
description: `
|
|
2739
|
-
Receives all the \`incoming\` expeditions for this shop.
|
|
2740
|
-
|
|
2741
|
-
Calling this endpoint is equivalent to calling [receiveFromDriver](#tag/Expeditions/paths/~1expeditions~1receiveFromDriver/post) with all
|
|
2742
|
-
the \`_ids\` of the \`incoming\` expeditions. It returns how many expeditions have been processed.
|
|
2738
|
+
Receives all the \`delivery\` and \`incoming\` expeditions for this shop.
|
|
2743
2739
|
|
|
2744
|
-
|
|
2740
|
+
Calling this endpoint is equivalent to calling [receiveFromDriver](#tag/Expeditions/paths/~1expeditions~1receiveFromDriver/post) with the
|
|
2741
|
+
\`_ids\` of all the \`delivery\` expeditions in \`incoming\` status associated to the shop. It returns how many expeditions have been
|
|
2742
|
+
processed.
|
|
2745
2743
|
|
|
2746
2744
|
${securitySchemes.tokens}
|
|
2747
2745
|
${securitySchemes.shopUserRole}`,
|
|
@@ -2775,15 +2773,16 @@ Receives expeditions from a customer, changing their status code and adding more
|
|
|
2775
2773
|
Each expedition is processed individually and its result returned, so it is possible that some expeditions are processed
|
|
2776
2774
|
and some are not. The result for each expedition depends on its situation:
|
|
2777
2775
|
|
|
2778
|
-
| Expedition
|
|
2779
|
-
| :---
|
|
2780
|
-
| found in no shop<br/>found in same shop | pickup + incoming | ok | inShop | receivedFrom |
|
|
2781
|
-
| found in
|
|
2782
|
-
| found in
|
|
2783
|
-
|
|
|
2784
|
-
|
|
|
2776
|
+
| Expedition | Type + Status code | Result | New status code | New status properties |
|
|
2777
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
2778
|
+
| found in no shop (*)<br/>found in same shop | pickup + incoming | ok | inShop | receivedFrom |
|
|
2779
|
+
| found in no shop | any other combination | not found | - | - |
|
|
2780
|
+
| found in same shop | any other combination | another situation | - | - |
|
|
2781
|
+
| found in another shop | - | another shop | - | - |
|
|
2782
|
+
| not found | - | not found | - | - |
|
|
2783
|
+
| server error | - | error | - | - |
|
|
2785
2784
|
|
|
2786
|
-
If the received expedition is not associated to a shop this operation will associate it to the shop receiving it.
|
|
2785
|
+
(*) If the received expedition is not associated to a shop this operation will associate it to the shop that is receiving it.
|
|
2787
2786
|
|
|
2788
2787
|
${securitySchemes.tokens}
|
|
2789
2788
|
${securitySchemes.shopUserRole}`,
|
package/package.json
CHANGED
|
@@ -28,12 +28,7 @@ const receiveFromCustomerEvent = () => ({
|
|
|
28
28
|
type: 'object',
|
|
29
29
|
properties: {
|
|
30
30
|
_id: expedition().properties._id,
|
|
31
|
-
receiveFromCustomer: mergeSchemas(
|
|
32
|
-
processedWithCustomerWithPod(),
|
|
33
|
-
objectWithShopId(),
|
|
34
|
-
objectWithNetworkId(),
|
|
35
|
-
objectWithExpirationDate(),
|
|
36
|
-
),
|
|
31
|
+
receiveFromCustomer: mergeSchemas(processedWithCustomerWithPod(), objectWithShopId(), objectWithNetworkId()),
|
|
37
32
|
expedition: expedition(),
|
|
38
33
|
},
|
|
39
34
|
required: ['_id', 'receiveFromCustomer', 'expedition'],
|