@gls_spain/gps-common 34.3.0 → 34.4.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.
@@ -2,10 +2,9 @@
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 afterPath="$PROJECT_DIR$/errors/ShopCannotSellError.js" afterDir="false" />
6
- <change beforePath="$PROJECT_DIR$/errors/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/errors/index.js" afterDir="false" />
7
5
  <change beforePath="$PROJECT_DIR$/open-api-spec/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/open-api-spec/index.js" afterDir="false" />
8
- <change beforePath="$PROJECT_DIR$/schemas/definitions/shops.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/shops.js" afterDir="false" />
6
+ <change beforePath="$PROJECT_DIR$/schemas/definitions/representatives.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/representatives.js" afterDir="false" />
7
+ <change beforePath="$PROJECT_DIR$/schemas/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/index.js" afterDir="false" />
9
8
  </list>
10
9
  <option name="SHOW_DIALOG" value="false" />
11
10
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -125,8 +124,8 @@
125
124
  </configuration>
126
125
  <recent_temporary>
127
126
  <list>
128
- <item itemvalue="JavaScript Debug.documentation.html (1)" />
129
127
  <item itemvalue="npm.build-documentation" />
128
+ <item itemvalue="JavaScript Debug.documentation.html (1)" />
130
129
  <item itemvalue="npm.test" />
131
130
  <item itemvalue="npm.semantic-release" />
132
131
  <item itemvalue="npm.commit" />
@@ -625,7 +624,10 @@
625
624
  <workItem from="1599675057970" duration="1442000" />
626
625
  <workItem from="1599722212402" duration="763000" />
627
626
  <workItem from="1600358026541" duration="773000" />
628
- <workItem from="1600676045368" duration="641000" />
627
+ <workItem from="1600676045368" duration="1246000" />
628
+ <workItem from="1600679037395" duration="238000" />
629
+ <workItem from="1600875504930" duration="94000" />
630
+ <workItem from="1601025758747" duration="856000" />
629
631
  </task>
630
632
  <servers />
631
633
  </component>
@@ -668,22 +670,22 @@
668
670
  <screen x="0" y="23" width="2048" height="1129" />
669
671
  </state>
670
672
  <state x="762" y="341" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.23.2048.1129@0.23.2048.1129" timestamp="1595577705727" />
671
- <state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1600358643265">
673
+ <state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1601026389150">
672
674
  <screen x="0" y="23" width="2048" height="1129" />
673
675
  </state>
674
- <state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1600358643265" />
675
- <state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1600358643265">
676
+ <state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1601026389150" />
677
+ <state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1601026389149">
676
678
  <screen x="0" y="23" width="2048" height="1129" />
677
679
  </state>
678
- <state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1600358643265" />
679
- <state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1600358643265">
680
+ <state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1601026389149" />
681
+ <state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1601026389149">
680
682
  <screen x="0" y="23" width="2048" height="1129" />
681
683
  </state>
682
- <state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1600358643265" />
683
- <state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1600358643265">
684
+ <state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1601026389149" />
685
+ <state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1601026389149">
684
686
  <screen x="0" y="23" width="2048" height="1129" />
685
687
  </state>
686
- <state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1600358643265" />
688
+ <state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1601026389149" />
687
689
  <state x="725" y="342" width="736" height="612" key="find.popup" timestamp="1598206991663">
688
690
  <screen x="0" y="23" width="2048" height="1129" />
689
691
  </state>
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [34.4.0](https://github.com/GLS-Spain/gps-common/compare/v34.3.0...v34.4.0) (2020-09-25)
2
+
3
+
4
+ ### Features
5
+
6
+ * add GET representatives/getOwn ([7e3f5bf](https://github.com/GLS-Spain/gps-common/commit/7e3f5bfd3675f328f9b4f080661a92b9a55202b6))
7
+
1
8
  # [34.3.0](https://github.com/GLS-Spain/gps-common/compare/v34.2.0...v34.3.0) (2020-09-21)
2
9
 
3
10
 
@@ -148,6 +148,7 @@ const {
148
148
  findRepresentativesRequest,
149
149
  findRepresentativesResponse,
150
150
  listRepresentativesNamesResponse,
151
+ getOwnRepresentativesResponse,
151
152
  updateRepresentativeRequest,
152
153
  updateRepresentativeResponse,
153
154
  getRepresentativeCommissionsRequest,
@@ -2066,6 +2067,31 @@ ${securitySchemes.superAdminRole}`,
2066
2067
  },
2067
2068
  },
2068
2069
  },
2070
+ '/representatives/getOwn': {
2071
+ get: {
2072
+ tags: ['Sales representatives'],
2073
+ summary: '[U] Get own',
2074
+ description: `
2075
+ Gets the opening and managing representatives of the user's own shop.
2076
+
2077
+ ${securitySchemes.tokens}
2078
+ ${securitySchemes.shopUserRole}`,
2079
+ responses: {
2080
+ ' 200': {
2081
+ description: 'Contains the opening and managing representative of the shop.',
2082
+ content: { 'application/json': { schema: getOwnRepresentativesResponse() } },
2083
+ },
2084
+ ' 400': responses.badRequest,
2085
+ ' 401': responses.invalidUserInCookieOrHeader,
2086
+ ' 401 ': responses.invalidCookieOrHeader,
2087
+ ' 401 ': responses.missingCookieOrHeader,
2088
+ ' 401 ': responses.unauthorized,
2089
+ ' 403': responses.forbidden,
2090
+ ' 415': responses.unsupportedMediaType,
2091
+ ' 500': responses.internalServerError,
2092
+ },
2093
+ },
2094
+ },
2069
2095
  '/representatives/find': {
2070
2096
  post: {
2071
2097
  tags: ['Sales representatives'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gls_spain/gps-common",
3
- "version": "34.3.0",
3
+ "version": "34.4.0",
4
4
  "description": "Errors, schemas and documentation for the Parcel Shops project",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -76,6 +76,16 @@ const listRepresentativesNamesResponse = () => ({
76
76
  additionalProperties: false,
77
77
  });
78
78
 
79
+ const getOwnRepresentativesResponse = () => ({
80
+ type: 'object',
81
+ properties: {
82
+ openingRepresentative: representative(),
83
+ managingRepresentative: representative(),
84
+ },
85
+ required: ['openingRepresentative', 'managingRepresentative'],
86
+ additionalProperties: false,
87
+ });
88
+
79
89
  const updateRepresentativeRequest = () =>
80
90
  updateRequest(
81
91
  findById(),
@@ -168,6 +178,7 @@ module.exports = {
168
178
  findRepresentativesRequest,
169
179
  findRepresentativesResponse,
170
180
  listRepresentativesNamesResponse,
181
+ getOwnRepresentativesResponse,
171
182
  updateRepresentativeRequest,
172
183
  updateRepresentativeResponse,
173
184
  getRepresentativeCommissionsRequest,
package/schemas/index.js CHANGED
@@ -83,6 +83,7 @@ const {
83
83
  findRepresentativesRequest,
84
84
  findRepresentativesResponse,
85
85
  listRepresentativesNamesResponse,
86
+ getOwnRepresentativesResponse,
86
87
  updateRepresentativeRequest,
87
88
  updateRepresentativeResponse,
88
89
  getRepresentativeCommissionsRequest,
@@ -214,6 +215,7 @@ const podsFindResponse = response(findPodsResponse(), 'podsFindResponse');
214
215
  const representativesCreateRequest = request(createRepresentativeRequest(), 'representativesCreateRequest');
215
216
  const representativesCreateResponse = response(createRepresentativeResponse(), 'representativesCreateResponse');
216
217
  const representativesListNamesResponse = response(listRepresentativesNamesResponse(), 'representativesListNamesResponse');
218
+ const representativesGetOwnResponse = response(getOwnRepresentativesResponse(), 'representativesGetOwnResponse');
217
219
  const representativesFindRequest = request(findRepresentativesRequest(), 'representativesFindRequest');
218
220
  const representativesFindResponse = response(findRepresentativesResponse(), 'representativesFindResponse');
219
221
  const representativesUpdateRequest = request(updateRepresentativeRequest(), 'representativesUpdateRequest');
@@ -338,6 +340,7 @@ module.exports = {
338
340
  representativesCreateRequest,
339
341
  representativesCreateResponse,
340
342
  representativesListNamesResponse,
343
+ representativesGetOwnResponse,
341
344
  representativesFindRequest,
342
345
  representativesFindResponse,
343
346
  representativesUpdateRequest,