@gls_spain/gps-common 34.12.0 → 34.13.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/CHANGELOG.md +9 -2
- package/open-api-spec/index.js +46 -1
- package/package.json +1 -1
- package/schemas/definitions/expeditions.js +12 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
# [34.
|
|
1
|
+
# [34.13.0](https://github.com/GLS-Spain/gps-common/compare/v34.12.0...v34.13.0) (2021-05-21)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
* new
|
|
6
|
+
* add new endpoint depositedFormDriver ([20f5035](https://github.com/GLS-Spain/gps-common/commit/20f5035ee16f1a5879ae064432a019284f0acc1e))
|
|
7
7
|
|
|
8
|
+
# [34.12.0](https://github.com/GLS-Spain/gps-common/compare/v34.11.1...v34.12.0) (2021-05-19)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* new end points ([6c82af3](https://github.com/GLS-Spain/gps-common/commit/6c82af32662a96ee6c01db2aff48e289cc9c1ea3))
|
|
14
|
+
|
|
8
15
|
## [34.11.1](https://github.com/GLS-Spain/gps-common/compare/v34.11.0...v34.11.1) (2021-05-17)
|
|
9
16
|
|
|
10
17
|
|
package/open-api-spec/index.js
CHANGED
|
@@ -134,7 +134,8 @@ const {
|
|
|
134
134
|
expireExpeditionRequest,
|
|
135
135
|
unexpireExpeditionRequest,
|
|
136
136
|
updateExpeditionDerivationRequest,
|
|
137
|
-
reminderResponse
|
|
137
|
+
reminderResponse,
|
|
138
|
+
processExpeditionsDepositedFromRequest
|
|
138
139
|
} = require('../schemas/definitions/expeditions');
|
|
139
140
|
const { defaults, getDefaultsResponse, updateDefaultsRequest, updateDefaultsResponse } = require('../schemas/definitions/defaults');
|
|
140
141
|
const { counters, getCountersResponse } = require('../schemas/definitions/counters');
|
|
@@ -150,6 +151,7 @@ const {
|
|
|
150
151
|
upsertShopEvent,
|
|
151
152
|
upsertNetworkEvent,
|
|
152
153
|
upsertSaleEvent,
|
|
154
|
+
depositedFromDriverEvent,
|
|
153
155
|
} = require('../schemas/definitions/gls-spain-integration-events');
|
|
154
156
|
const {
|
|
155
157
|
representative,
|
|
@@ -2953,6 +2955,49 @@ ${securitySchemes.shopUserRole}`,
|
|
|
2953
2955
|
},
|
|
2954
2956
|
},
|
|
2955
2957
|
},
|
|
2958
|
+
'/expeditions/depositedFromDriver': {
|
|
2959
|
+
post: {
|
|
2960
|
+
tags: ['Expeditions'],
|
|
2961
|
+
summary: '[U] Deposited from driver',
|
|
2962
|
+
description: `
|
|
2963
|
+
Deposited expeditions from a driver, adding more properties to status.
|
|
2964
|
+
|
|
2965
|
+
Each expedition is processed individually and its result returned, so it is possible that some expeditions are processed
|
|
2966
|
+
and some are not. The result for each expedition depends on its situation:
|
|
2967
|
+
|
|
2968
|
+
| Expedition | Type + Status code | Result | New status properties |
|
|
2969
|
+
| :--- | :--- | :--- | :--- |
|
|
2970
|
+
| found in no shop (*)<br/>found in same shop | delivery + incoming | ok | depositedFrom |
|
|
2971
|
+
| found in no shop | any other combination | not found | - |
|
|
2972
|
+
| found in same shop | any other combination | another situation | - |
|
|
2973
|
+
| found in another shop | - | another shop | - |
|
|
2974
|
+
| not found | - | not found | - |
|
|
2975
|
+
| server error | - | error | - |
|
|
2976
|
+
|
|
2977
|
+
(*) 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.
|
|
2978
|
+
|
|
2979
|
+
${securitySchemes.tokens}
|
|
2980
|
+
${securitySchemes.shopUserRole}`,
|
|
2981
|
+
requestBody: {
|
|
2982
|
+
content: { 'application/json': { schema: processExpeditionsDepositedFromRequest() } },
|
|
2983
|
+
required: true,
|
|
2984
|
+
},
|
|
2985
|
+
responses: {
|
|
2986
|
+
' 200': {
|
|
2987
|
+
description: 'Contains the result of the processing for each expedition.',
|
|
2988
|
+
content: { 'application/json': { schema: processExpeditionsResponse() } },
|
|
2989
|
+
},
|
|
2990
|
+
' 400': responses.badRequest,
|
|
2991
|
+
' 401': responses.invalidUserInCookieOrHeader,
|
|
2992
|
+
' 401 ': responses.invalidCookieOrHeader,
|
|
2993
|
+
' 401 ': responses.missingCookieOrHeader,
|
|
2994
|
+
' 401 ': responses.unauthorized,
|
|
2995
|
+
' 403': responses.forbidden,
|
|
2996
|
+
' 415': responses.unsupportedMediaType,
|
|
2997
|
+
' 500': responses.internalServerError,
|
|
2998
|
+
},
|
|
2999
|
+
},
|
|
3000
|
+
},
|
|
2956
3001
|
'/expeditions/receiveFromDriver': {
|
|
2957
3002
|
post: {
|
|
2958
3003
|
tags: ['Expeditions'],
|
package/package.json
CHANGED
|
@@ -719,6 +719,16 @@ const processExpeditionsWithCustomerRequest = () => ({
|
|
|
719
719
|
additionalProperties: false,
|
|
720
720
|
});
|
|
721
721
|
|
|
722
|
+
const processExpeditionsDepositedFromRequest = () => ({
|
|
723
|
+
type: 'object',
|
|
724
|
+
properties: {
|
|
725
|
+
expeditions: omit(findByIds(), 'title'),
|
|
726
|
+
driver: driver(),
|
|
727
|
+
},
|
|
728
|
+
required: ['expeditions', 'driver'],
|
|
729
|
+
additionalProperties: false,
|
|
730
|
+
});
|
|
731
|
+
|
|
722
732
|
const processExpeditionResultOk = () => mergeSchemas(objectWithUuid(), resultOk());
|
|
723
733
|
|
|
724
734
|
const processExpeditionResultNotFound = () => mergeSchemas(objectWithUuid(), resultNotFound());
|
|
@@ -883,5 +893,6 @@ module.exports = {
|
|
|
883
893
|
expireExpeditionRequest,
|
|
884
894
|
unexpireExpeditionRequest,
|
|
885
895
|
updateExpeditionDerivationRequest,
|
|
886
|
-
reminderResponse
|
|
896
|
+
reminderResponse,
|
|
897
|
+
processExpeditionsDepositedFromRequest
|
|
887
898
|
};
|