@gls_spain/gps-common 35.10.4 → 35.10.6
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 +23 -9
- package/errors/CommunicationAlreadyExistsError.js +11 -0
- package/errors/CommunicationCannotBeDeletedError.js +11 -0
- package/errors/CommunicationDoesNotExistError.js +11 -0
- package/errors/index.js +11 -2
- package/open-api-spec/index.js +19 -1
- package/package.json +1 -1
- package/schemas/definitions/common.js +1 -1
- package/schemas/definitions/expeditions.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
## [35.10.
|
|
1
|
+
## [35.10.6](https://github.com/GLS-Spain/gps-common/compare/v35.10.5...v35.10.6) (2025-05-29)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
* add
|
|
7
|
-
|
|
8
|
-
## [35.10.3](https://github.com/GLS-Spain/gps-common/compare/v35.10.2...v35.10.3) (2025-02-20)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Bug Fixes
|
|
12
|
-
|
|
13
|
-
* rollback change for semantic-release ([f312d73](https://github.com/GLS-Spain/gps-common/commit/f312d737864c2c2a655d0c493d40a8f15526358b))
|
|
6
|
+
* add max lenght validation and add communcations errors ([315e28f](https://github.com/GLS-Spain/gps-common/commit/315e28faaee03e664690411e65cd41785de82609))
|
|
14
7
|
|
|
8
|
+
## [35.10.5](https://github.com/GLS-Spain/gps-common/compare/v35.10.4...v35.10.5) (2025-05-22)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* change tipe data validation retrieve ([beed47f](https://github.com/GLS-Spain/gps-common/commit/beed47f9f0706844b41de23717eaa57673394bb3))
|
|
14
|
+
|
|
15
|
+
## [35.10.4](https://github.com/GLS-Spain/gps-common/compare/v35.10.3...v35.10.4) (2025-05-09)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* add request schema validation for retrieve expedition ([e5e1ad2](https://github.com/GLS-Spain/gps-common/commit/e5e1ad24d60a8a79fad1e575159545de18abfa06))
|
|
21
|
+
|
|
22
|
+
## [35.10.3](https://github.com/GLS-Spain/gps-common/compare/v35.10.2...v35.10.3) (2025-02-20)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* rollback change for semantic-release ([f312d73](https://github.com/GLS-Spain/gps-common/commit/f312d737864c2c2a655d0c493d40a8f15526358b))
|
|
28
|
+
|
|
15
29
|
## [35.10.2](https://github.com/GLS-Spain/gps-common/compare/v35.10.1...v35.10.2) (2025-02-19)
|
|
16
30
|
|
|
17
31
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const { DatabaseError } = require('./DatabaseError');
|
|
2
|
+
|
|
3
|
+
class CommunicationAlreadyExistsError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Communication already exists.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'CommunicationAlreadyExistsError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = CommunicationAlreadyExistsError;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const { DatabaseError } = require('./DatabaseError');
|
|
2
|
+
|
|
3
|
+
class CommunicationCannotBeDeletedError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Communication cannot be deleted.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'CommunicationCannotBeDeletedError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = CommunicationCannotBeDeletedError;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const { DatabaseError } = require('./DatabaseError');
|
|
2
|
+
|
|
3
|
+
class CommunicationDoesNotExistError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Communication does not exist.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'CommunicationDoesNotExistError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = CommunicationDoesNotExistError;
|
package/errors/index.js
CHANGED
|
@@ -29,6 +29,9 @@ const RepresentativeCannotBeDeletedError = require('./RepresentativeCannotBeDele
|
|
|
29
29
|
const ZoneDoesNotExistError = require('./ZoneDoesNotExistError');
|
|
30
30
|
const ZoneAlreadyExistsError = require('./ZoneAlreadyExistsError');
|
|
31
31
|
const ZoneCannotBeDeletedError = require('./ZoneCannotBeDeletedError');
|
|
32
|
+
const CommunicationDoesNotExistError = require('./CommunicationDoesNotExistError');
|
|
33
|
+
const CommunicationAlreadyExistsError = require('./CommunicationAlreadyExistsError');
|
|
34
|
+
const CommunicationCannotBeDeletedError = require('./CommunicationCannotBeDeletedError');
|
|
32
35
|
const SaleDoesNotExistError = require('./SaleDoesNotExistError');
|
|
33
36
|
const SaleAlreadyExistsError = require('./SaleAlreadyExistsError');
|
|
34
37
|
const InconsistentSalesSettingsError = require('./InconsistentSalesSettingsError');
|
|
@@ -72,6 +75,9 @@ const errorsNames = {
|
|
|
72
75
|
ZoneDoesNotExistError: 'ZoneDoesNotExistError',
|
|
73
76
|
ZoneAlreadyExistsError: 'ZoneAlreadyExistsError',
|
|
74
77
|
ZoneCannotBeDeletedError: 'ZoneCannotBeDeletedError',
|
|
78
|
+
CommunicationDoesNotExistError: 'CommunicationDoesNotExistError',
|
|
79
|
+
CommunicationAlreadyExistsError: 'CommunicationAlreadyExistsError',
|
|
80
|
+
CommunicationCannotBeDeletedError: 'CommunicationCannotBeDeletedError',
|
|
75
81
|
SaleDoesNotExistError: 'SaleDoesNotExistError',
|
|
76
82
|
SaleAlreadyExistsError: 'SaleAlreadyExistsError',
|
|
77
83
|
InconsistentSalesSettingsError: 'InconsistentSalesSettingsError',
|
|
@@ -80,8 +86,8 @@ const errorsNames = {
|
|
|
80
86
|
GLSSpainError: 'GLSSpainError',
|
|
81
87
|
GLSRecordingError: 'GLSRecordingError',
|
|
82
88
|
LabelDoesNotExistError: 'LabelDoesNotExistError',
|
|
83
|
-
NifNotCorrectError:'NifNotCorrectError',
|
|
84
|
-
IbanNotCorrectError:'IbanNotCorrectError',
|
|
89
|
+
NifNotCorrectError: 'NifNotCorrectError',
|
|
90
|
+
IbanNotCorrectError: 'IbanNotCorrectError',
|
|
85
91
|
};
|
|
86
92
|
|
|
87
93
|
module.exports = {
|
|
@@ -116,6 +122,9 @@ module.exports = {
|
|
|
116
122
|
ZoneDoesNotExistError,
|
|
117
123
|
ZoneAlreadyExistsError,
|
|
118
124
|
ZoneCannotBeDeletedError,
|
|
125
|
+
CommunicationDoesNotExistError,
|
|
126
|
+
CommunicationAlreadyExistsError,
|
|
127
|
+
CommunicationCannotBeDeletedError,
|
|
119
128
|
SaleDoesNotExistError,
|
|
120
129
|
SaleAlreadyExistsError,
|
|
121
130
|
InconsistentSalesSettingsError,
|
package/open-api-spec/index.js
CHANGED
|
@@ -40,6 +40,9 @@ const {
|
|
|
40
40
|
ZoneDoesNotExistError,
|
|
41
41
|
ZoneAlreadyExistsError,
|
|
42
42
|
ZoneCannotBeDeletedError,
|
|
43
|
+
CommunicationDoesNotExistError,
|
|
44
|
+
CommunicationAlreadyExistsError,
|
|
45
|
+
CommunicationCannotBeDeletedError,
|
|
43
46
|
SaleDoesNotExistError,
|
|
44
47
|
SaleAlreadyExistsError,
|
|
45
48
|
InconsistentSalesSettingsError,
|
|
@@ -930,6 +933,9 @@ const errors = {
|
|
|
930
933
|
zoneDoesNotExist: new ZoneDoesNotExistError(),
|
|
931
934
|
zoneAlreadyExists: new ZoneAlreadyExistsError(),
|
|
932
935
|
zoneCannotBeDeleted: new ZoneCannotBeDeletedError(),
|
|
936
|
+
communicationDoesNotExist: new CommunicationDoesNotExistError(),
|
|
937
|
+
communicationAlreadyExists: new CommunicationAlreadyExistsError(),
|
|
938
|
+
communicationCannotBeDeleted: new CommunicationCannotBeDeletedError(),
|
|
933
939
|
saleDoesNotExist: new SaleDoesNotExistError(),
|
|
934
940
|
saleAlreadyExists: new SaleAlreadyExistsError(),
|
|
935
941
|
inconsistentSalesSettings: new InconsistentSalesSettingsError(),
|
|
@@ -1088,6 +1094,18 @@ const responses = {
|
|
|
1088
1094
|
description: 'The zone cannot be deleted.',
|
|
1089
1095
|
content: { 'application/json': { schema: specificErrorResponse(errors.zoneCannotBeDeleted) } },
|
|
1090
1096
|
},
|
|
1097
|
+
communicationDoesNotExist: {
|
|
1098
|
+
description: 'The communication does not exist.',
|
|
1099
|
+
content: { 'application/json': { schema: specificErrorResponse(errors.communicationDoesNotExist) } },
|
|
1100
|
+
},
|
|
1101
|
+
communicationAlreadyExists: {
|
|
1102
|
+
description: 'The communication already exists.',
|
|
1103
|
+
content: { 'application/json': { schema: specificErrorResponse(errors.communicationAlreadyExists) } },
|
|
1104
|
+
},
|
|
1105
|
+
communicationCannotBeDeleted: {
|
|
1106
|
+
description: 'The communication cannot be deleted.',
|
|
1107
|
+
content: { 'application/json': { schema: specificErrorResponse(errors.communicationCannotBeDeleted) } },
|
|
1108
|
+
},
|
|
1091
1109
|
saleDoesNotExist: {
|
|
1092
1110
|
description: 'The sale does not exist.',
|
|
1093
1111
|
content: { 'application/json': { schema: specificErrorResponse(errors.saleDoesNotExist) } },
|
|
@@ -2994,7 +3012,7 @@ ${securitySchemes.superAdminRole}`,
|
|
|
2994
3012
|
description: 'Contains the result of the processing for each expedition.',
|
|
2995
3013
|
content: { 'application/json': { schema: processExpeditionsResponse() } },
|
|
2996
3014
|
},
|
|
2997
|
-
' 400': responses.badRequest,
|
|
3015
|
+
' 400': responses.badRequest,
|
|
2998
3016
|
' 401': responses.invalidUserInCookieOrHeader,
|
|
2999
3017
|
' 401 ': responses.invalidCookieOrHeader,
|
|
3000
3018
|
' 401 ': responses.missingCookieOrHeader,
|
package/package.json
CHANGED
|
@@ -422,7 +422,7 @@ const fiscal = () => ({
|
|
|
422
422
|
address: address(),
|
|
423
423
|
paymentMethod: { type: 'string', enum: ['transfer', 'confirming'] },
|
|
424
424
|
dueDays: { type: 'integer', minimum: 0 },
|
|
425
|
-
activity: { type: 'string', trim: true, description: 'IAE' },
|
|
425
|
+
activity: { type: 'string', trim: true, description: 'IAE', maxLength: 50 },
|
|
426
426
|
retention: { type: 'integer', description: 'invoice retention percentage' },
|
|
427
427
|
},
|
|
428
428
|
required: ['iban', 'businessName', 'nif', 'contacts', 'address', 'paymentMethod', 'dueDays', 'activity', 'retention'],
|
|
@@ -960,9 +960,9 @@ const expireExpeditionRequest = () => ({
|
|
|
960
960
|
const retrieveExpeditionRequest = () => ({
|
|
961
961
|
type: 'object',
|
|
962
962
|
properties: {
|
|
963
|
-
|
|
963
|
+
codexp: { type: 'integer' },
|
|
964
964
|
},
|
|
965
|
-
required: ['
|
|
965
|
+
required: ['codexp'],
|
|
966
966
|
additionalProperties: false,
|
|
967
967
|
});
|
|
968
968
|
|