@gls_spain/gps-common 34.4.1 → 34.5.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.
@@ -1,7 +1,10 @@
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$/open-api-spec/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/open-api-spec/index.js" afterDir="false" />
6
+ <change beforePath="$PROJECT_DIR$/schemas/definitions/sales.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/sales.js" afterDir="false" />
7
+ </list>
5
8
  <option name="SHOW_DIALOG" value="false" />
6
9
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
7
10
  <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -120,8 +123,8 @@
120
123
  </configuration>
121
124
  <recent_temporary>
122
125
  <list>
123
- <item itemvalue="npm.build-documentation" />
124
126
  <item itemvalue="JavaScript Debug.documentation.html (1)" />
127
+ <item itemvalue="npm.build-documentation" />
125
128
  <item itemvalue="npm.test" />
126
129
  <item itemvalue="npm.semantic-release" />
127
130
  <item itemvalue="npm.commit" />
@@ -624,6 +627,13 @@
624
627
  <workItem from="1600679037395" duration="238000" />
625
628
  <workItem from="1600875504930" duration="94000" />
626
629
  <workItem from="1601025758747" duration="988000" />
630
+ <workItem from="1601027058809" duration="203000" />
631
+ <workItem from="1601366983507" duration="49000" />
632
+ <workItem from="1601370976937" duration="339000" />
633
+ <workItem from="1601551727472" duration="27000" />
634
+ <workItem from="1603700811892" duration="525000" />
635
+ <workItem from="1603705612447" duration="352000" />
636
+ <workItem from="1603706953993" duration="293000" />
627
637
  </task>
628
638
  <servers />
629
639
  </component>
@@ -666,22 +676,22 @@
666
676
  <screen x="0" y="23" width="2048" height="1129" />
667
677
  </state>
668
678
  <state x="762" y="341" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.23.2048.1129@0.23.2048.1129" timestamp="1595577705727" />
669
- <state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1601026389150">
679
+ <state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1603700951862">
670
680
  <screen x="0" y="23" width="2048" height="1129" />
671
681
  </state>
672
- <state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1601026389150" />
673
- <state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1601026389149">
682
+ <state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1603700951862" />
683
+ <state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1603700951862">
674
684
  <screen x="0" y="23" width="2048" height="1129" />
675
685
  </state>
676
- <state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1601026389149" />
677
- <state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1601026389149">
686
+ <state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1603700951862" />
687
+ <state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1603700951862">
678
688
  <screen x="0" y="23" width="2048" height="1129" />
679
689
  </state>
680
- <state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1601026389149" />
681
- <state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1601026389149">
690
+ <state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1603700951862" />
691
+ <state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1603700951862">
682
692
  <screen x="0" y="23" width="2048" height="1129" />
683
693
  </state>
684
- <state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1601026389149" />
694
+ <state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1603700951862" />
685
695
  <state x="725" y="342" width="736" height="612" key="find.popup" timestamp="1598206991663">
686
696
  <screen x="0" y="23" width="2048" height="1129" />
687
697
  </state>
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [34.5.1](https://github.com/GLS-Spain/gps-common/compare/v34.5.0...v34.5.1) (2020-10-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * change super admin find sales by network and shop to only shop ([18e52f6](https://github.com/GLS-Spain/gps-common/commit/18e52f65718ba2a49cc11980198922d4e2aed1f7))
7
+
8
+ # [34.5.0](https://github.com/GLS-Spain/gps-common/compare/v34.4.1...v34.5.0) (2020-10-26)
9
+
10
+
11
+ ### Features
12
+
13
+ * add find expeditions by sale ([7a85fb7](https://github.com/GLS-Spain/gps-common/commit/7a85fb713ee95da08725f8bd7ace7ecaef8c0d71))
14
+
1
15
  ## [34.4.1](https://github.com/GLS-Spain/gps-common/compare/v34.4.0...v34.4.1) (2020-09-25)
2
16
 
3
17
 
@@ -2624,7 +2624,10 @@ An expedition can be associated on creation to either one shop, one network or m
2624
2624
 
2625
2625
  - Provide \`shop\` when it can be received only in a specific shop. The network will be inserted automatically.
2626
2626
  - Provide \`network\` when it can be received at any shop in one network. On reception the shop will be added to the expedition.
2627
- - Provide \`network\` and \`otherNetworks\` when it can be received in any shop in more than one network. On reception the network and shop will be set and the other networks removed.
2627
+ - Provide \`network\` and \`otherNetworks\` when it can be received in any shop in more than one network. On reception the network and shop
2628
+ will be set and the other networks removed.
2629
+
2630
+ If a provided network does not exist the API will return a \`500 NetworkDoesNotExistError\`.
2628
2631
 
2629
2632
  If the provided shop does not exist the API will return a \`500 ShopDoesNotExistError\`, if it is not enabled it will return a
2630
2633
  \`500 ShopNotEnabledError\`, and if it is readonly it will return a \`500 ShopCannotBeUpdatedError\`.
@@ -2632,9 +2635,8 @@ If the provided shop does not exist the API will return a \`500 ShopDoesNotExist
2632
2635
  When providing a shop one can also provide a sale if the expedition is created because of it. If the provided sale does not
2633
2636
  exist the API will return a \`500 SaleDoesNotExistError\`.
2634
2637
 
2635
- If a provided network does not exist the API will return a \`500 NetworkDoesNotExistError\`.
2636
-
2637
- The \`status.code\` of a new expedition cannot be specified and it will always be \`incoming\`.
2638
+ The \`status.code\` of a new expedition cannot be specified and will be \`incoming\` when the expedition has no \`sale\` and \`inShop\`
2639
+ when it does.
2638
2640
 
2639
2641
  ${securitySchemes.tokens}
2640
2642
  ${securitySchemes.superAdminRole}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gls_spain/gps-common",
3
- "version": "34.4.1",
3
+ "version": "34.5.1",
4
4
  "description": "Errors, schemas and documentation for the Parcel Shops project",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -483,6 +483,16 @@ const findByCode = () => ({
483
483
  additionalProperties: false,
484
484
  });
485
485
 
486
+ const findBySale = () => ({
487
+ title: 'find by sale',
488
+ type: 'object',
489
+ properties: {
490
+ sale: objectWithUuid(),
491
+ },
492
+ required: ['sale'],
493
+ additionalProperties: false,
494
+ });
495
+
486
496
  const findExpeditionsSuperAdminRequest = () =>
487
497
  findRequest({
488
498
  oneOf: [
@@ -494,11 +504,14 @@ const findExpeditionsSuperAdminRequest = () =>
494
504
  findByShop(),
495
505
  findByShopAndStatus(),
496
506
  findByCode(),
507
+ findBySale(),
497
508
  ],
498
509
  });
499
510
 
500
511
  const findExpeditionsNetworkAdminRequest = () =>
501
- findRequest({ oneOf: [findById(), findByShop(), findByShopAndStatus(), findByNoShop(), findByNoShopAndStatus(), findByCode()] });
512
+ findRequest({
513
+ oneOf: [findById(), findByShop(), findByShopAndStatus(), findByNoShop(), findByNoShopAndStatus(), findByCode(), findBySale()],
514
+ });
502
515
 
503
516
  const findExpeditionsShopUserRequest = () =>
504
517
  findRequest({
@@ -510,6 +523,7 @@ const findExpeditionsShopUserRequest = () =>
510
523
  findByNoShop(),
511
524
  findByNoShopAndStatus(),
512
525
  findByCode(),
526
+ findBySale(),
513
527
  ],
514
528
  });
515
529
 
@@ -152,9 +152,7 @@ const findByNetwork = () => mergeSchemas(objectWithNetworkId(), { title: 'find b
152
152
 
153
153
  const findByShop = () => mergeSchemas(objectWithShopId(), { title: 'find by shop' });
154
154
 
155
- const findByNetworkAndShop = () => mergeSchemas(objectWithNetworkId(), objectWithShopId(), { title: 'find by network and shop' });
156
-
157
- const findSalesSuperAdminRequest = () => findRequest({ oneOf: [findByNetwork(), findByNetworkAndShop(), findById()] });
155
+ const findSalesSuperAdminRequest = () => findRequest({ oneOf: [findByNetwork(), findByShop(), findById()] });
158
156
 
159
157
  const findSalesNetworkAdminRequest = () => findRequest({ oneOf: [findAll(), findByShop(), findById()] });
160
158