@gls_spain/gps-common 28.0.0 → 29.0.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 +31 -14
- package/CHANGELOG.md +20 -0
- package/errors/DatabaseNotEmptyError.js +3 -1
- package/errors/DefaultsDoNotExistError.js +3 -1
- package/errors/ExpeditionAlreadyExistsError.js +3 -1
- package/errors/ExpeditionCannotBeDeletedError.js +3 -1
- package/errors/ExpeditionCannotBeUpdatedError.js +3 -1
- package/errors/ExpeditionDoesNotExistError.js +3 -1
- package/errors/NetworkAlreadyExistsError.js +3 -1
- package/errors/NetworkCannotBeDeletedError.js +3 -1
- package/errors/NetworkDoesNotExistError.js +3 -1
- package/errors/RepresentativeAlreadyExistsError.js +3 -1
- package/errors/RepresentativeCannotBeDeletedError.js +3 -1
- package/errors/RepresentativeDoesNotExistError.js +3 -1
- package/errors/ShopAlreadyExistsError.js +3 -1
- package/errors/ShopCannotBeDeletedError.js +3 -1
- package/errors/ShopDoesNotExistError.js +3 -1
- package/errors/ShopNotEnabledError.js +3 -1
- package/errors/UserAlreadyExistsError.js +3 -1
- package/errors/UserCannotBeDeletedError.js +3 -1
- package/errors/UserCannotBeUpdatedError.js +3 -1
- package/errors/UserDoesNotExistError.js +3 -1
- package/errors/WrongNetworkError.js +3 -1
- package/errors/WrongPasswordError.js +3 -1
- package/errors/WrongShopError.js +3 -1
- package/errors/ZoneAlreadyExistsError.js +3 -1
- package/errors/ZoneCannotBeDeletedError.js +3 -1
- package/errors/ZoneDoesNotExistError.js +3 -1
- package/errors/index.js +0 -3
- package/package.json +2 -1
- package/schemas/definitions/common.js +0 -7
- package/schemas/definitions/expeditions.js +3 -5
- package/schemas/definitions/historic-records.js +2 -1
- package/schemas/definitions/integrations.js +1 -0
- package/schemas/definitions/networks.js +3 -14
- package/schemas/definitions/representatives.js +1 -2
- package/schemas/definitions/shops.js +2 -4
- package/schemas/definitions/users.js +10 -46
- package/errors/JobDoesNotExistError.js +0 -9
package/.idea/workspace.xml
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
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=""
|
|
4
|
+
<list default="true" id="c2833e40-3178-44f3-9bc5-203849985c7f" name="Default Changelist" comment="">
|
|
5
|
+
<change beforePath="$PROJECT_DIR$/schemas/definitions/common.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/common.js" afterDir="false" />
|
|
6
|
+
<change beforePath="$PROJECT_DIR$/schemas/definitions/expeditions.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/expeditions.js" afterDir="false" />
|
|
7
|
+
<change beforePath="$PROJECT_DIR$/schemas/definitions/networks.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/networks.js" afterDir="false" />
|
|
8
|
+
<change beforePath="$PROJECT_DIR$/schemas/definitions/representatives.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/representatives.js" afterDir="false" />
|
|
9
|
+
<change beforePath="$PROJECT_DIR$/schemas/definitions/shops.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/shops.js" afterDir="false" />
|
|
10
|
+
<change beforePath="$PROJECT_DIR$/schemas/definitions/users.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/users.js" afterDir="false" />
|
|
11
|
+
</list>
|
|
5
12
|
<option name="SHOW_DIALOG" value="false" />
|
|
6
13
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
7
14
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -123,8 +130,8 @@
|
|
|
123
130
|
</configuration>
|
|
124
131
|
<recent_temporary>
|
|
125
132
|
<list>
|
|
126
|
-
<item itemvalue="npm.build-documentation" />
|
|
127
133
|
<item itemvalue="JavaScript Debug.documentation.html (1)" />
|
|
134
|
+
<item itemvalue="npm.build-documentation" />
|
|
128
135
|
<item itemvalue="npm.test" />
|
|
129
136
|
<item itemvalue="Jest.index.test.js" />
|
|
130
137
|
<item itemvalue="Jest.#errors" />
|
|
@@ -494,6 +501,12 @@
|
|
|
494
501
|
<workItem from="1584201225736" duration="2801000" />
|
|
495
502
|
<workItem from="1584260636797" duration="3021000" />
|
|
496
503
|
<workItem from="1584264807456" duration="5446000" />
|
|
504
|
+
<workItem from="1584276339691" duration="500000" />
|
|
505
|
+
<workItem from="1584279223548" duration="443000" />
|
|
506
|
+
<workItem from="1584283992678" duration="388000" />
|
|
507
|
+
<workItem from="1584288029270" duration="191000" />
|
|
508
|
+
<workItem from="1584291295326" duration="639000" />
|
|
509
|
+
<workItem from="1584346563581" duration="3239000" />
|
|
497
510
|
</task>
|
|
498
511
|
<servers />
|
|
499
512
|
</component>
|
|
@@ -533,6 +546,10 @@
|
|
|
533
546
|
</option>
|
|
534
547
|
</component>
|
|
535
548
|
<component name="WindowStateProjectService">
|
|
549
|
+
<state x="762" y="341" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog" timestamp="1584283363756">
|
|
550
|
+
<screen x="0" y="23" width="2048" height="1129" />
|
|
551
|
+
</state>
|
|
552
|
+
<state x="762" y="341" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.23.2048.1129@0.23.2048.1129" timestamp="1584283363756" />
|
|
536
553
|
<state x="100" y="123" width="1848" height="929" key="DiffContextDialog" timestamp="1579112408515">
|
|
537
554
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
538
555
|
</state>
|
|
@@ -541,33 +558,33 @@
|
|
|
541
558
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
542
559
|
</state>
|
|
543
560
|
<state x="606" y="280" key="EditFileWatcherDialog/0.23.2048.1129@0.23.2048.1129" timestamp="1580283934403" />
|
|
544
|
-
<state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="
|
|
561
|
+
<state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1584346574395">
|
|
545
562
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
546
563
|
</state>
|
|
547
|
-
<state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
548
|
-
<state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="
|
|
564
|
+
<state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1584346574395" />
|
|
565
|
+
<state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1584346574395">
|
|
549
566
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
550
567
|
</state>
|
|
551
|
-
<state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
552
|
-
<state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="
|
|
568
|
+
<state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1584346574395" />
|
|
569
|
+
<state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1584346574395">
|
|
553
570
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
554
571
|
</state>
|
|
555
|
-
<state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
556
|
-
<state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="
|
|
572
|
+
<state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1584346574395" />
|
|
573
|
+
<state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1584346574395">
|
|
557
574
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
558
575
|
</state>
|
|
559
|
-
<state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
576
|
+
<state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1584346574395" />
|
|
560
577
|
<state x="0" y="23" width="2048" height="1129" key="SettingsEditor" timestamp="1580283935326">
|
|
561
578
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
562
579
|
</state>
|
|
563
580
|
<state x="0" y="23" width="2048" height="1129" key="SettingsEditor/0.23.2048.1129@0.23.2048.1129" timestamp="1580283935326" />
|
|
564
|
-
<state x="1351" y="124" width="697" height="951" key="find.popup" timestamp="
|
|
581
|
+
<state x="1351" y="124" width="697" height="951" key="find.popup" timestamp="1584363161427">
|
|
565
582
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
566
583
|
</state>
|
|
567
|
-
<state x="1351" y="124" width="697" height="951" key="find.popup/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
568
|
-
<state x="689" y="276" width="670" height="676" key="search.everywhere.popup" timestamp="
|
|
584
|
+
<state x="1351" y="124" width="697" height="951" key="find.popup/0.23.2048.1129@0.23.2048.1129" timestamp="1584363161427" />
|
|
585
|
+
<state x="689" y="276" width="670" height="676" key="search.everywhere.popup" timestamp="1584284016106">
|
|
569
586
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
570
587
|
</state>
|
|
571
|
-
<state x="689" y="276" width="670" height="676" key="search.everywhere.popup/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
588
|
+
<state x="689" y="276" width="670" height="676" key="search.everywhere.popup/0.23.2048.1129@0.23.2048.1129" timestamp="1584284016106" />
|
|
572
589
|
</component>
|
|
573
590
|
</project>
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [29.0.0](https://github.com/GLS-Spain/gps-common/compare/v28.0.1...v29.0.0) (2020-03-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add deletable to historic records and integrations ([b81042d](https://github.com/GLS-Spain/gps-common/commit/b81042d4a25e9d3895a1b2907feba19a5121e016))
|
|
7
|
+
* remove tags and integrations, add users permissions ([9caf2bf](https://github.com/GLS-Spain/gps-common/commit/9caf2bfa1387d515da7198e751b6363731b099e2))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* changed networks, shops, expeditions, users and representatives schemas
|
|
13
|
+
|
|
14
|
+
## [28.0.1](https://github.com/GLS-Spain/gps-common/compare/v28.0.0...v28.0.1) (2020-03-15)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* remove job error, change all errors to extend DatabaseError ([03bb9ae](https://github.com/GLS-Spain/gps-common/commit/03bb9aeb40c0a758cc09ad7cecc7bc674817d4f2))
|
|
20
|
+
|
|
1
21
|
# [28.0.0](https://github.com/GLS-Spain/gps-common/compare/v27.2.0...v28.0.0) (2020-03-15)
|
|
2
22
|
|
|
3
23
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class DatabaseNotEmptyError extends DatabaseError {
|
|
2
4
|
constructor(message = 'The database cannot be initialized because it is not empty.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class DefaultsDoNotExistError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Defaults do not exist.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ExpeditionAlreadyExistsError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Expedition already exists.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ExpeditionCannotBeDeletedError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Expedition cannot be deleted.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ExpeditionCannotBeUpdatedError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Expedition cannot be updated.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ExpeditionDoesNotExistError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Expedition does not exist.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class NetworkAlreadyExistsError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Network already exists.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class NetworkCannotBeDeletedError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Network cannot be deleted.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class NetworkDoesNotExistError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Network does not exist.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class RepresentativeAlreadyExistsError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Representative already exists.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class RepresentativeCannotBeDeletedError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Representative cannot be deleted.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class RepresentativeDoesNotExistError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Representative does not exist.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ShopAlreadyExistsError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Shop already exists.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ShopCannotBeDeletedError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Shop cannot be deleted.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ShopDoesNotExistError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Shop does not exist.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class UserAlreadyExistsError extends DatabaseError {
|
|
2
4
|
constructor(message = 'User already exists.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class UserCannotBeDeletedError extends DatabaseError {
|
|
2
4
|
constructor(message = 'User cannot be deleted.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class UserCannotBeUpdatedError extends DatabaseError {
|
|
2
4
|
constructor(message = 'User cannot be updated.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class UserDoesNotExistError extends DatabaseError {
|
|
2
4
|
constructor(message = 'User does not exist.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class WrongNetworkError extends DatabaseError {
|
|
2
4
|
constructor(message = 'The provided network is not the right one.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class WrongPasswordError extends DatabaseError {
|
|
2
4
|
constructor(message = 'The provided password is not the right one.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
package/errors/WrongShopError.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class WrongShopError extends DatabaseError {
|
|
2
4
|
constructor(message = 'The provided shop is not the right one.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ZoneAlreadyExistsError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Zone already exists.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ZoneCannotBeDeletedError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Zone cannot be deleted.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ZoneDoesNotExistError extends DatabaseError {
|
|
2
4
|
constructor(message = 'Zone does not exist.') {
|
|
3
5
|
// noinspection JSCheckFunctionSignatures
|
|
4
6
|
super(message);
|
package/errors/index.js
CHANGED
|
@@ -18,7 +18,6 @@ const ExpeditionAlreadyExistsError = require('./ExpeditionAlreadyExistsError');
|
|
|
18
18
|
const ExpeditionCannotBeUpdatedError = require('./ExpeditionCannotBeUpdatedError');
|
|
19
19
|
const ExpeditionCannotBeDeletedError = require('./ExpeditionCannotBeDeletedError');
|
|
20
20
|
const DefaultsDoNotExistError = require('./DefaultsDoNotExistError');
|
|
21
|
-
const JobDoesNotExistError = require('./JobDoesNotExistError');
|
|
22
21
|
const RepresentativeDoesNotExistError = require('./RepresentativeDoesNotExistError');
|
|
23
22
|
const RepresentativeAlreadyExistsError = require('./RepresentativeAlreadyExistsError');
|
|
24
23
|
const RepresentativeCannotBeDeletedError = require('./RepresentativeCannotBeDeletedError');
|
|
@@ -47,7 +46,6 @@ const errorsNames = {
|
|
|
47
46
|
ExpeditionCannotBeUpdatedError: 'ExpeditionCannotBeUpdatedError',
|
|
48
47
|
ExpeditionCannotBeDeletedError: 'ExpeditionCannotBeDeletedError',
|
|
49
48
|
DefaultsDoNotExistError: 'DefaultsDoNotExistError',
|
|
50
|
-
JobDoesNotExistError: 'JobDoesNotExistError',
|
|
51
49
|
RepresentativeDoesNotExistError: 'RepresentativeDoesNotExistError',
|
|
52
50
|
RepresentativeAlreadyExistsError: 'RepresentativeAlreadyExistsError',
|
|
53
51
|
RepresentativeCannotBeDeletedError: 'RepresentativeCannotBeDeletedError',
|
|
@@ -77,7 +75,6 @@ module.exports = {
|
|
|
77
75
|
ExpeditionCannotBeUpdatedError,
|
|
78
76
|
ExpeditionCannotBeDeletedError,
|
|
79
77
|
DefaultsDoNotExistError,
|
|
80
|
-
JobDoesNotExistError,
|
|
81
78
|
RepresentativeDoesNotExistError,
|
|
82
79
|
RepresentativeAlreadyExistsError,
|
|
83
80
|
RepresentativeCannotBeDeletedError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gls_spain/gps-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "29.0.0",
|
|
4
4
|
"description": "Errors, schemas and documentation for the Parcel Shops project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@gls_spain/ajv-options": "^1.1.0",
|
|
50
50
|
"@gls_spain/common-errors": "^1.0.0",
|
|
51
51
|
"@gls_spain/common-json-schemas": "^1.1.0",
|
|
52
|
+
"@gls_spain/mongodb": "^1.0.3",
|
|
52
53
|
"@gls_spain/winston-transports": "^1.0.0",
|
|
53
54
|
"lodash": "^4.17.15",
|
|
54
55
|
"winston": "^3.2.1",
|
|
@@ -104,12 +104,6 @@ const objectWithUuidAndName = () => ({
|
|
|
104
104
|
additionalProperties: false,
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
const tags = () => ({
|
|
108
|
-
type: 'array',
|
|
109
|
-
items: { type: 'string', trim: true },
|
|
110
|
-
uniqueItems: true,
|
|
111
|
-
});
|
|
112
|
-
|
|
113
107
|
const contact = () => ({
|
|
114
108
|
title: 'contact',
|
|
115
109
|
type: 'object',
|
|
@@ -167,7 +161,6 @@ module.exports = {
|
|
|
167
161
|
timezone,
|
|
168
162
|
timezoneNames,
|
|
169
163
|
objectWithUuidAndName,
|
|
170
|
-
tags,
|
|
171
164
|
contact,
|
|
172
165
|
fiscal,
|
|
173
166
|
findByFiscal,
|
|
@@ -17,7 +17,7 @@ const {
|
|
|
17
17
|
mergeSchemas,
|
|
18
18
|
pickProperties,
|
|
19
19
|
} = require('@gls_spain/common-json-schemas');
|
|
20
|
-
const { date, findById, findByIds
|
|
20
|
+
const { date, findById, findByIds } = require('./common');
|
|
21
21
|
const { address } = require('./common');
|
|
22
22
|
const { network, objectWithNetworkId } = require('./networks');
|
|
23
23
|
const { shop, objectWithShopId } = require('./shops');
|
|
@@ -125,8 +125,8 @@ const expedition = () => ({
|
|
|
125
125
|
deletable: { type: 'boolean' },
|
|
126
126
|
network: {
|
|
127
127
|
type: 'object',
|
|
128
|
-
properties: { ...pickProperties(network(), ['_id', 'name'
|
|
129
|
-
required: ['_id', 'name'
|
|
128
|
+
properties: { ...pickProperties(network(), ['_id', 'name']) },
|
|
129
|
+
required: ['_id', 'name'],
|
|
130
130
|
additionalProperties: false,
|
|
131
131
|
},
|
|
132
132
|
shop: {
|
|
@@ -325,7 +325,6 @@ const createExpeditionWithShop = () => ({
|
|
|
325
325
|
'packages',
|
|
326
326
|
'notes',
|
|
327
327
|
]),
|
|
328
|
-
tags: tags(),
|
|
329
328
|
},
|
|
330
329
|
required: [
|
|
331
330
|
'shop',
|
|
@@ -372,7 +371,6 @@ const createExpeditionWithNetwork = () => ({
|
|
|
372
371
|
'packages',
|
|
373
372
|
'notes',
|
|
374
373
|
]),
|
|
375
|
-
tags: tags(),
|
|
376
374
|
},
|
|
377
375
|
required: [
|
|
378
376
|
'network',
|
|
@@ -10,6 +10,7 @@ const baseHistoricRecord = () => ({
|
|
|
10
10
|
_id: uuid(),
|
|
11
11
|
createdAt: datetime(),
|
|
12
12
|
updatedAt: datetime(),
|
|
13
|
+
deletable: { type: 'boolean' },
|
|
13
14
|
action: { type: 'string', enum: ['create', 'update', 'delete'] },
|
|
14
15
|
actionExtras: { type: 'array', items: { type: 'string' }, description: 'additional details about the action, e.g. what was updated' },
|
|
15
16
|
actor: { type: 'string', description: 'the username of the user who made the action' },
|
|
@@ -19,7 +20,7 @@ const baseHistoricRecord = () => ({
|
|
|
19
20
|
type: 'object',
|
|
20
21
|
properties: {
|
|
21
22
|
at: datetime(),
|
|
22
|
-
result: { type: 'string', enum: ['completed', 'failed', 'ignored', 'blocked', 'needsReview'] },
|
|
23
|
+
result: { type: 'string', enum: ['inProgress', 'completed', 'failed', 'ignored', 'blocked', 'needsReview'] },
|
|
23
24
|
message: { type: 'string' },
|
|
24
25
|
},
|
|
25
26
|
required: ['at', 'result', 'message'],
|
|
@@ -9,6 +9,7 @@ const integration = () => ({
|
|
|
9
9
|
_id: uuid(),
|
|
10
10
|
createdAt: datetime(),
|
|
11
11
|
updatedAt: datetime(),
|
|
12
|
+
deletable: { type: 'boolean' },
|
|
12
13
|
name: { type: 'string' },
|
|
13
14
|
enabled: { type: 'boolean' },
|
|
14
15
|
networks: mergeSchemas(omit(findByIds(), 'title'), { description: 'the integration only applies to these networks' }),
|
|
@@ -12,7 +12,7 @@ const {
|
|
|
12
12
|
deleteResponse,
|
|
13
13
|
pickProperties,
|
|
14
14
|
} = require('@gls_spain/common-json-schemas');
|
|
15
|
-
const { findAll, findById, findByName, objectWithUuidAndName,
|
|
15
|
+
const { findAll, findById, findByName, objectWithUuidAndName, contact, fiscal } = require('./common');
|
|
16
16
|
const { defaults, derivationSettings, expirationSettings } = require('./defaults');
|
|
17
17
|
|
|
18
18
|
const network = () => ({
|
|
@@ -25,7 +25,6 @@ const network = () => ({
|
|
|
25
25
|
deletable: { type: 'boolean' },
|
|
26
26
|
defaults: defaults(),
|
|
27
27
|
name: { type: 'string', trim: true },
|
|
28
|
-
integrations: { type: 'array', items: { type: 'string', enum: ['gls'] }, uniqueItems: true },
|
|
29
28
|
contacts: {
|
|
30
29
|
type: 'array',
|
|
31
30
|
items: contact(),
|
|
@@ -34,7 +33,7 @@ const network = () => ({
|
|
|
34
33
|
derivationSettings: derivationSettings(),
|
|
35
34
|
expirationSettings: expirationSettings(),
|
|
36
35
|
},
|
|
37
|
-
required: ['_id', 'createdAt', 'updatedAt', 'deletable', 'defaults', 'name', '
|
|
36
|
+
required: ['_id', 'createdAt', 'updatedAt', 'deletable', 'defaults', 'name', 'contacts'],
|
|
38
37
|
additionalProperties: false,
|
|
39
38
|
});
|
|
40
39
|
|
|
@@ -49,17 +48,7 @@ const createNetworkRequest = () =>
|
|
|
49
48
|
createRequest({
|
|
50
49
|
type: 'object',
|
|
51
50
|
properties: {
|
|
52
|
-
...pickProperties(network(), [
|
|
53
|
-
'_id',
|
|
54
|
-
'createdAt',
|
|
55
|
-
'name',
|
|
56
|
-
'integrations',
|
|
57
|
-
'contacts',
|
|
58
|
-
'fiscal',
|
|
59
|
-
'derivationSettings',
|
|
60
|
-
'expirationSettings',
|
|
61
|
-
]),
|
|
62
|
-
tags: tags(),
|
|
51
|
+
...pickProperties(network(), ['_id', 'createdAt', 'name', 'contacts', 'fiscal', 'derivationSettings', 'expirationSettings']),
|
|
63
52
|
},
|
|
64
53
|
required: ['name'],
|
|
65
54
|
additionalProperties: false,
|
|
@@ -16,7 +16,7 @@ const {
|
|
|
16
16
|
deleteResponse,
|
|
17
17
|
pickProperties,
|
|
18
18
|
} = require('@gls_spain/common-json-schemas');
|
|
19
|
-
const { findAll, findById, findByName, objectWithUuidAndName
|
|
19
|
+
const { findAll, findById, findByName, objectWithUuidAndName } = require('./common');
|
|
20
20
|
const { zone } = require('./zones');
|
|
21
21
|
|
|
22
22
|
const representative = () => ({
|
|
@@ -58,7 +58,6 @@ const createRepresentativeRequest = () =>
|
|
|
58
58
|
properties: {
|
|
59
59
|
...pickProperties(representative(), ['_id', 'createdAt', 'name', 'emails', 'phones', 'nif']),
|
|
60
60
|
zones: setRepresentativesZones(),
|
|
61
|
-
tags: tags(),
|
|
62
61
|
},
|
|
63
62
|
required: ['name', 'nif'],
|
|
64
63
|
additionalProperties: false,
|
|
@@ -24,7 +24,6 @@ const {
|
|
|
24
24
|
findByCircularArea,
|
|
25
25
|
findByPolygonalArea,
|
|
26
26
|
timezone,
|
|
27
|
-
tags,
|
|
28
27
|
contact,
|
|
29
28
|
fiscal,
|
|
30
29
|
findByFiscal,
|
|
@@ -96,8 +95,8 @@ const shop = () => ({
|
|
|
96
95
|
defaults: defaults(),
|
|
97
96
|
network: {
|
|
98
97
|
type: 'object',
|
|
99
|
-
properties: { ...pickProperties(network(), ['_id', 'name', '
|
|
100
|
-
required: ['_id', 'name'
|
|
98
|
+
properties: { ...pickProperties(network(), ['_id', 'name', 'derivationSettings', 'expirationSettings']) },
|
|
99
|
+
required: ['_id', 'name'],
|
|
101
100
|
additionalProperties: false,
|
|
102
101
|
},
|
|
103
102
|
zone: {
|
|
@@ -215,7 +214,6 @@ const createShopRequest = () =>
|
|
|
215
214
|
'derivationSettings',
|
|
216
215
|
'expirationSettings',
|
|
217
216
|
]),
|
|
218
|
-
tags: tags(),
|
|
219
217
|
},
|
|
220
218
|
required: ['network', 'status', 'name', 'address', 'openingSchedule', 'timezone'],
|
|
221
219
|
additionalProperties: false,
|
|
@@ -16,7 +16,7 @@ const {
|
|
|
16
16
|
mergeSchemas,
|
|
17
17
|
pickProperties,
|
|
18
18
|
} = require('@gls_spain/common-json-schemas');
|
|
19
|
-
const { address, findAll, findById, findByName
|
|
19
|
+
const { address, findAll, findById, findByName } = require('./common');
|
|
20
20
|
const { network, objectWithNetworkId } = require('./networks');
|
|
21
21
|
const { shop, objectWithShopId } = require('./shops');
|
|
22
22
|
|
|
@@ -34,7 +34,7 @@ const baseUser = () => ({
|
|
|
34
34
|
description: 'a unique username that cannot be changed later',
|
|
35
35
|
},
|
|
36
36
|
loginEnabled: { type: 'boolean' },
|
|
37
|
-
|
|
37
|
+
permissions: { type: 'array', items: { type: 'string', enum: ['canReceiveAllFromDriver'] }, uniqueItems: true },
|
|
38
38
|
role: { type: 'string' },
|
|
39
39
|
name: { type: 'string', trim: true },
|
|
40
40
|
emails: { type: 'array', items: email(), uniqueItems: true },
|
|
@@ -42,7 +42,7 @@ const baseUser = () => ({
|
|
|
42
42
|
nif: { type: 'string', trim: true },
|
|
43
43
|
address: address(),
|
|
44
44
|
},
|
|
45
|
-
required: ['_id', 'createdAt', 'updatedAt', 'username', 'deletable', 'loginEnabled', '
|
|
45
|
+
required: ['_id', 'createdAt', 'updatedAt', 'username', 'deletable', 'loginEnabled', 'permissions', 'role', 'name', 'emails', 'phones'],
|
|
46
46
|
additionalProperties: false,
|
|
47
47
|
});
|
|
48
48
|
|
|
@@ -55,8 +55,8 @@ const networkAdmin = () =>
|
|
|
55
55
|
role: { enum: ['networkAdmin'] },
|
|
56
56
|
network: {
|
|
57
57
|
type: 'object',
|
|
58
|
-
properties: { ...pickProperties(network(), ['_id', 'name'
|
|
59
|
-
required: ['_id', 'name'
|
|
58
|
+
properties: { ...pickProperties(network(), ['_id', 'name']) },
|
|
59
|
+
required: ['_id', 'name'],
|
|
60
60
|
additionalProperties: false,
|
|
61
61
|
},
|
|
62
62
|
},
|
|
@@ -70,8 +70,8 @@ const shopUser = () =>
|
|
|
70
70
|
role: { enum: ['shopUser'] },
|
|
71
71
|
network: {
|
|
72
72
|
type: 'object',
|
|
73
|
-
properties: { ...pickProperties(network(), ['_id', 'name'
|
|
74
|
-
required: ['_id', 'name'
|
|
73
|
+
properties: { ...pickProperties(network(), ['_id', 'name']) },
|
|
74
|
+
required: ['_id', 'name'],
|
|
75
75
|
additionalProperties: false,
|
|
76
76
|
},
|
|
77
77
|
shop: {
|
|
@@ -88,19 +88,7 @@ const createSuperAdminRequest = () =>
|
|
|
88
88
|
createRequest({
|
|
89
89
|
type: 'object',
|
|
90
90
|
properties: {
|
|
91
|
-
...pickProperties(superAdmin(), [
|
|
92
|
-
'_id',
|
|
93
|
-
'createdAt',
|
|
94
|
-
'username',
|
|
95
|
-
'loginEnabled',
|
|
96
|
-
'integrations',
|
|
97
|
-
'name',
|
|
98
|
-
'emails',
|
|
99
|
-
'phones',
|
|
100
|
-
'nif',
|
|
101
|
-
'address',
|
|
102
|
-
]),
|
|
103
|
-
tags: tags(),
|
|
91
|
+
...pickProperties(superAdmin(), ['_id', 'createdAt', 'username', 'loginEnabled', 'name', 'emails', 'phones', 'nif', 'address']),
|
|
104
92
|
password: password(),
|
|
105
93
|
},
|
|
106
94
|
required: ['username', 'loginEnabled', 'name', 'password'],
|
|
@@ -145,19 +133,7 @@ const createNetworkAdminRequest = () =>
|
|
|
145
133
|
{
|
|
146
134
|
type: 'object',
|
|
147
135
|
properties: {
|
|
148
|
-
...pickProperties(networkAdmin(), [
|
|
149
|
-
'_id',
|
|
150
|
-
'createdAt',
|
|
151
|
-
'username',
|
|
152
|
-
'loginEnabled',
|
|
153
|
-
'integrations',
|
|
154
|
-
'name',
|
|
155
|
-
'emails',
|
|
156
|
-
'phones',
|
|
157
|
-
'nif',
|
|
158
|
-
'address',
|
|
159
|
-
]),
|
|
160
|
-
tags: tags(),
|
|
136
|
+
...pickProperties(networkAdmin(), ['_id', 'createdAt', 'username', 'loginEnabled', 'name', 'emails', 'phones', 'nif', 'address']),
|
|
161
137
|
password: password(),
|
|
162
138
|
},
|
|
163
139
|
required: ['username', 'loginEnabled', 'name', 'password'],
|
|
@@ -236,19 +212,7 @@ const createShopUserRequest = () =>
|
|
|
236
212
|
{
|
|
237
213
|
type: 'object',
|
|
238
214
|
properties: {
|
|
239
|
-
...pickProperties(shopUser(), [
|
|
240
|
-
'_id',
|
|
241
|
-
'createdAt',
|
|
242
|
-
'username',
|
|
243
|
-
'loginEnabled',
|
|
244
|
-
'integrations',
|
|
245
|
-
'name',
|
|
246
|
-
'emails',
|
|
247
|
-
'phones',
|
|
248
|
-
'nif',
|
|
249
|
-
'address',
|
|
250
|
-
]),
|
|
251
|
-
tags: tags(),
|
|
215
|
+
...pickProperties(shopUser(), ['_id', 'createdAt', 'username', 'loginEnabled', 'name', 'emails', 'phones', 'nif', 'address']),
|
|
252
216
|
password: password(),
|
|
253
217
|
},
|
|
254
218
|
required: ['username', 'loginEnabled', 'name', 'password'],
|