@gls_spain/gps-common 27.2.0 → 28.0.1

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.
Files changed (39) hide show
  1. package/.idea/workspace.xml +67 -20
  2. package/CHANGELOG.md +21 -0
  3. package/errors/DatabaseNotEmptyError.js +3 -1
  4. package/errors/DefaultsDoNotExistError.js +3 -1
  5. package/errors/ExpeditionAlreadyExistsError.js +3 -1
  6. package/errors/ExpeditionCannotBeDeletedError.js +3 -1
  7. package/errors/ExpeditionCannotBeUpdatedError.js +3 -1
  8. package/errors/ExpeditionDoesNotExistError.js +3 -1
  9. package/errors/NetworkAlreadyExistsError.js +3 -1
  10. package/errors/NetworkCannotBeDeletedError.js +3 -1
  11. package/errors/NetworkDoesNotExistError.js +3 -1
  12. package/errors/RepresentativeAlreadyExistsError.js +3 -1
  13. package/errors/RepresentativeCannotBeDeletedError.js +3 -1
  14. package/errors/RepresentativeDoesNotExistError.js +3 -1
  15. package/errors/ShopAlreadyExistsError.js +3 -1
  16. package/errors/ShopCannotBeDeletedError.js +3 -1
  17. package/errors/ShopDoesNotExistError.js +3 -1
  18. package/errors/ShopNotEnabledError.js +3 -1
  19. package/errors/UserAlreadyExistsError.js +3 -1
  20. package/errors/UserCannotBeDeletedError.js +3 -1
  21. package/errors/UserCannotBeUpdatedError.js +3 -1
  22. package/errors/UserDoesNotExistError.js +3 -1
  23. package/errors/WrongNetworkError.js +3 -1
  24. package/errors/WrongPasswordError.js +3 -1
  25. package/errors/WrongShopError.js +3 -1
  26. package/errors/ZoneAlreadyExistsError.js +3 -1
  27. package/errors/ZoneCannotBeDeletedError.js +3 -1
  28. package/errors/ZoneDoesNotExistError.js +3 -1
  29. package/errors/index.js +0 -3
  30. package/open-api-spec/index.js +274 -151
  31. package/package.json +2 -1
  32. package/schemas/definitions/common.js +4 -2
  33. package/schemas/definitions/expeditions.js +121 -37
  34. package/schemas/definitions/{integration-events.js → gls-spain-integration-events.js} +14 -7
  35. package/schemas/definitions/historic-records.js +119 -0
  36. package/schemas/definitions/integrations.js +28 -0
  37. package/schemas/index.js +23 -14
  38. package/errors/JobDoesNotExistError.js +0 -9
  39. package/schemas/definitions/jobs.js +0 -124
@@ -2,16 +2,36 @@
2
2
  <project version="4">
3
3
  <component name="ChangeListManager">
4
4
  <list default="true" id="c2833e40-3178-44f3-9bc5-203849985c7f" name="Default Changelist" comment="">
5
- <change beforePath="$PROJECT_DIR$/index.test.js" beforeDir="false" afterPath="$PROJECT_DIR$/index.test.js" afterDir="false" />
5
+ <change beforePath="$PROJECT_DIR$/errors/DatabaseNotEmptyError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/DatabaseNotEmptyError.js" afterDir="false" />
6
+ <change beforePath="$PROJECT_DIR$/errors/DefaultsDoNotExistError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/DefaultsDoNotExistError.js" afterDir="false" />
7
+ <change beforePath="$PROJECT_DIR$/errors/ExpeditionAlreadyExistsError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ExpeditionAlreadyExistsError.js" afterDir="false" />
8
+ <change beforePath="$PROJECT_DIR$/errors/ExpeditionCannotBeDeletedError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ExpeditionCannotBeDeletedError.js" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/errors/ExpeditionCannotBeUpdatedError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ExpeditionCannotBeUpdatedError.js" afterDir="false" />
10
+ <change beforePath="$PROJECT_DIR$/errors/ExpeditionDoesNotExistError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ExpeditionDoesNotExistError.js" afterDir="false" />
11
+ <change beforePath="$PROJECT_DIR$/errors/JobDoesNotExistError.js" beforeDir="false" />
12
+ <change beforePath="$PROJECT_DIR$/errors/NetworkAlreadyExistsError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/NetworkAlreadyExistsError.js" afterDir="false" />
13
+ <change beforePath="$PROJECT_DIR$/errors/NetworkCannotBeDeletedError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/NetworkCannotBeDeletedError.js" afterDir="false" />
14
+ <change beforePath="$PROJECT_DIR$/errors/NetworkDoesNotExistError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/NetworkDoesNotExistError.js" afterDir="false" />
15
+ <change beforePath="$PROJECT_DIR$/errors/RepresentativeAlreadyExistsError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/RepresentativeAlreadyExistsError.js" afterDir="false" />
16
+ <change beforePath="$PROJECT_DIR$/errors/RepresentativeCannotBeDeletedError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/RepresentativeCannotBeDeletedError.js" afterDir="false" />
17
+ <change beforePath="$PROJECT_DIR$/errors/RepresentativeDoesNotExistError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/RepresentativeDoesNotExistError.js" afterDir="false" />
18
+ <change beforePath="$PROJECT_DIR$/errors/ShopAlreadyExistsError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ShopAlreadyExistsError.js" afterDir="false" />
19
+ <change beforePath="$PROJECT_DIR$/errors/ShopCannotBeDeletedError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ShopCannotBeDeletedError.js" afterDir="false" />
20
+ <change beforePath="$PROJECT_DIR$/errors/ShopDoesNotExistError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ShopDoesNotExistError.js" afterDir="false" />
21
+ <change beforePath="$PROJECT_DIR$/errors/ShopNotEnabledError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ShopNotEnabledError.js" afterDir="false" />
22
+ <change beforePath="$PROJECT_DIR$/errors/UserAlreadyExistsError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/UserAlreadyExistsError.js" afterDir="false" />
23
+ <change beforePath="$PROJECT_DIR$/errors/UserCannotBeDeletedError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/UserCannotBeDeletedError.js" afterDir="false" />
24
+ <change beforePath="$PROJECT_DIR$/errors/UserCannotBeUpdatedError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/UserCannotBeUpdatedError.js" afterDir="false" />
25
+ <change beforePath="$PROJECT_DIR$/errors/UserDoesNotExistError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/UserDoesNotExistError.js" afterDir="false" />
26
+ <change beforePath="$PROJECT_DIR$/errors/WrongNetworkError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/WrongNetworkError.js" afterDir="false" />
27
+ <change beforePath="$PROJECT_DIR$/errors/WrongPasswordError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/WrongPasswordError.js" afterDir="false" />
28
+ <change beforePath="$PROJECT_DIR$/errors/WrongShopError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/WrongShopError.js" afterDir="false" />
29
+ <change beforePath="$PROJECT_DIR$/errors/ZoneAlreadyExistsError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ZoneAlreadyExistsError.js" afterDir="false" />
30
+ <change beforePath="$PROJECT_DIR$/errors/ZoneCannotBeDeletedError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ZoneCannotBeDeletedError.js" afterDir="false" />
31
+ <change beforePath="$PROJECT_DIR$/errors/ZoneDoesNotExistError.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/ZoneDoesNotExistError.js" afterDir="false" />
32
+ <change beforePath="$PROJECT_DIR$/errors/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/index.js" afterDir="false" />
6
33
  <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
7
34
  <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
8
- <change beforePath="$PROJECT_DIR$/schemas/definitions/common.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/common.js" afterDir="false" />
9
- <change beforePath="$PROJECT_DIR$/schemas/definitions/expeditions.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/expeditions.js" afterDir="false" />
10
- <change beforePath="$PROJECT_DIR$/schemas/definitions/networks.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/networks.js" afterDir="false" />
11
- <change beforePath="$PROJECT_DIR$/schemas/definitions/representatives.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/representatives.js" afterDir="false" />
12
- <change beforePath="$PROJECT_DIR$/schemas/definitions/shops.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/shops.js" afterDir="false" />
13
- <change beforePath="$PROJECT_DIR$/schemas/definitions/users.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/users.js" afterDir="false" />
14
- <change beforePath="$PROJECT_DIR$/schemas/definitions/zones.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/zones.js" afterDir="false" />
15
35
  </list>
16
36
  <option name="SHOW_DIALOG" value="false" />
17
37
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -49,6 +69,7 @@
49
69
  <component name="PropertiesComponent">
50
70
  <property name="ASKED_SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
51
71
  <property name="NewWatcherDialog.advanced.open" value="true" />
72
+ <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
52
73
  <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
53
74
  <property name="WebServerToolWindowFactoryState" value="false" />
54
75
  <property name="javascript.nodejs.core.library.configured.version" value="10.15.3" />
@@ -134,8 +155,8 @@
134
155
  <recent_temporary>
135
156
  <list>
136
157
  <item itemvalue="npm.test" />
137
- <item itemvalue="npm.build-documentation" />
138
158
  <item itemvalue="JavaScript Debug.documentation.html (1)" />
159
+ <item itemvalue="npm.build-documentation" />
139
160
  <item itemvalue="Jest.index.test.js" />
140
161
  <item itemvalue="Jest.#errors" />
141
162
  </list>
@@ -488,7 +509,25 @@
488
509
  <workItem from="1582099262907" duration="387000" />
489
510
  <workItem from="1582154278772" duration="110000" />
490
511
  <workItem from="1582185898197" duration="1121000" />
491
- <workItem from="1582216910927" duration="2067000" />
512
+ <workItem from="1582216910927" duration="2774000" />
513
+ <workItem from="1582273610435" duration="306000" />
514
+ <workItem from="1582285559382" duration="771000" />
515
+ <workItem from="1582753457734" duration="206000" />
516
+ <workItem from="1583135423594" duration="766000" />
517
+ <workItem from="1583989933434" duration="1573000" />
518
+ <workItem from="1584001364382" duration="390000" />
519
+ <workItem from="1584088637527" duration="1396000" />
520
+ <workItem from="1584102452907" duration="6035000" />
521
+ <workItem from="1584124065065" duration="500000" />
522
+ <workItem from="1584127502708" duration="1529000" />
523
+ <workItem from="1584172241164" duration="4374000" />
524
+ <workItem from="1584184482897" duration="3931000" />
525
+ <workItem from="1584201225736" duration="2801000" />
526
+ <workItem from="1584260636797" duration="3021000" />
527
+ <workItem from="1584264807456" duration="5446000" />
528
+ <workItem from="1584276339691" duration="500000" />
529
+ <workItem from="1584279223548" duration="443000" />
530
+ <workItem from="1584283992678" duration="250000" />
492
531
  </task>
493
532
  <servers />
494
533
  </component>
@@ -528,6 +567,10 @@
528
567
  </option>
529
568
  </component>
530
569
  <component name="WindowStateProjectService">
570
+ <state x="762" y="341" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog" timestamp="1584283363756">
571
+ <screen x="0" y="23" width="2048" height="1129" />
572
+ </state>
573
+ <state x="762" y="341" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.23.2048.1129@0.23.2048.1129" timestamp="1584283363756" />
531
574
  <state x="100" y="123" width="1848" height="929" key="DiffContextDialog" timestamp="1579112408515">
532
575
  <screen x="0" y="23" width="2048" height="1129" />
533
576
  </state>
@@ -536,29 +579,33 @@
536
579
  <screen x="0" y="23" width="2048" height="1129" />
537
580
  </state>
538
581
  <state x="606" y="280" key="EditFileWatcherDialog/0.23.2048.1129@0.23.2048.1129" timestamp="1580283934403" />
539
- <state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1582220329984">
582
+ <state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1584284240273">
540
583
  <screen x="0" y="23" width="2048" height="1129" />
541
584
  </state>
542
- <state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1582220329984" />
543
- <state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1582220329984">
585
+ <state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1584284240273" />
586
+ <state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1584284240273">
544
587
  <screen x="0" y="23" width="2048" height="1129" />
545
588
  </state>
546
- <state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1582220329984" />
547
- <state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1582220329984">
589
+ <state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1584284240273" />
590
+ <state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1584284240273">
548
591
  <screen x="0" y="23" width="2048" height="1129" />
549
592
  </state>
550
- <state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1582220329984" />
551
- <state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1582220329984">
593
+ <state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1584284240273" />
594
+ <state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1584284240273">
552
595
  <screen x="0" y="23" width="2048" height="1129" />
553
596
  </state>
554
- <state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1582220329984" />
597
+ <state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1584284240273" />
555
598
  <state x="0" y="23" width="2048" height="1129" key="SettingsEditor" timestamp="1580283935326">
556
599
  <screen x="0" y="23" width="2048" height="1129" />
557
600
  </state>
558
601
  <state x="0" y="23" width="2048" height="1129" key="SettingsEditor/0.23.2048.1129@0.23.2048.1129" timestamp="1580283935326" />
559
- <state x="1351" y="124" width="697" height="951" key="find.popup" timestamp="1580294138788">
602
+ <state x="1351" y="124" width="697" height="951" key="find.popup" timestamp="1584284225630">
603
+ <screen x="0" y="23" width="2048" height="1129" />
604
+ </state>
605
+ <state x="1351" y="124" width="697" height="951" key="find.popup/0.23.2048.1129@0.23.2048.1129" timestamp="1584284225630" />
606
+ <state x="689" y="276" width="670" height="676" key="search.everywhere.popup" timestamp="1584284016106">
560
607
  <screen x="0" y="23" width="2048" height="1129" />
561
608
  </state>
562
- <state x="1351" y="124" width="697" height="951" key="find.popup/0.23.2048.1129@0.23.2048.1129" timestamp="1580294138788" />
609
+ <state x="689" y="276" width="670" height="676" key="search.everywhere.popup/0.23.2048.1129@0.23.2048.1129" timestamp="1584284016106" />
563
610
  </component>
564
611
  </project>
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [28.0.1](https://github.com/GLS-Spain/gps-common/compare/v28.0.0...v28.0.1) (2020-03-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove job error, change all errors to extend DatabaseError ([03bb9ae](https://github.com/GLS-Spain/gps-common/commit/03bb9aeb40c0a758cc09ad7cecc7bc674817d4f2))
7
+
8
+ # [28.0.0](https://github.com/GLS-Spain/gps-common/compare/v27.2.0...v28.0.0) (2020-03-15)
9
+
10
+
11
+ ### Features
12
+
13
+ * change expeditions to allow no shop until reception ([ebb7ed7](https://github.com/GLS-Spain/gps-common/commit/ebb7ed70de3d2a76435cb9677016a11d3c698769))
14
+ * remove jobs endpoints, add historic records and integrations ([65d8b50](https://github.com/GLS-Spain/gps-common/commit/65d8b503363489934c09f19ee1001b2d5f3884cf))
15
+
16
+
17
+ ### BREAKING CHANGES
18
+
19
+ * jobs replaced by historic records and integrations
20
+ * expeditions may have no shop until reception
21
+
1
22
  # [27.2.0](https://github.com/GLS-Spain/gps-common/compare/v27.1.1...v27.2.0) (2020-02-20)
2
23
 
3
24
 
@@ -1,4 +1,6 @@
1
- class DatabaseNotEmptyError extends Error {
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
- class DefaultsDoNotExistError extends Error {
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
- class ExpeditionAlreadyExistsError extends Error {
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
- class ExpeditionCannotBeDeletedError extends Error {
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
- class ExpeditionCannotBeUpdatedError extends Error {
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
- class ExpeditionDoesNotExistError extends Error {
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
- class NetworkAlreadyExistsError extends Error {
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
- class NetworkCannotBeDeletedError extends Error {
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
- class NetworkDoesNotExistError extends Error {
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
- class RepresentativeAlreadyExistsError extends Error {
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
- class RepresentativeCannotBeDeletedError extends Error {
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
- class RepresentativeDoesNotExistError extends Error {
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
- class ShopAlreadyExistsError extends Error {
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
- class ShopCannotBeDeletedError extends Error {
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
- class ShopDoesNotExistError extends Error {
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
- class ShopNotEnabledError extends Error {
1
+ const { DatabaseError } = require('@gls_spain/mongodb');
2
+
3
+ class ShopNotEnabledError extends DatabaseError {
2
4
  constructor(message = 'Shop is not enabled.') {
3
5
  // noinspection JSCheckFunctionSignatures
4
6
  super(message);
@@ -1,4 +1,6 @@
1
- class UserAlreadyExistsError extends Error {
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
- class UserCannotBeDeletedError extends Error {
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
- class UserCannotBeUpdatedError extends Error {
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
- class UserDoesNotExistError extends Error {
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
- class WrongNetworkError extends Error {
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
- class WrongPasswordError extends Error {
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);
@@ -1,4 +1,6 @@
1
- class WrongShopError extends Error {
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
- class ZoneAlreadyExistsError extends Error {
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
- class ZoneCannotBeDeletedError extends Error {
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
- class ZoneDoesNotExistError extends Error {
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,