@gls_spain/gps-common 31.0.3 → 32.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.
@@ -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/historic-records.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/historic-records.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" />
@@ -537,6 +540,11 @@
537
540
  <workItem from="1585171020202" duration="389000" />
538
541
  <workItem from="1585200026785" duration="2273000" />
539
542
  <workItem from="1585233345225" duration="1174000" />
543
+ <workItem from="1585251412197" duration="856000" />
544
+ <workItem from="1585290769759" duration="503000" />
545
+ <workItem from="1585309502233" duration="144000" />
546
+ <workItem from="1585319154346" duration="599000" />
547
+ <workItem from="1585377577645" duration="2447000" />
540
548
  </task>
541
549
  <servers />
542
550
  </component>
@@ -592,22 +600,22 @@
592
600
  <screen x="0" y="23" width="2048" height="1129" />
593
601
  </state>
594
602
  <state x="606" y="280" key="EditFileWatcherDialog/0.23.2048.1129@0.23.2048.1129" timestamp="1580283934403" />
595
- <state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1585251545014">
603
+ <state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1585380996925">
596
604
  <screen x="0" y="23" width="2048" height="1129" />
597
605
  </state>
598
- <state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1585251545014" />
599
- <state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1585251545014">
606
+ <state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1585380996925" />
607
+ <state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1585380996924">
600
608
  <screen x="0" y="23" width="2048" height="1129" />
601
609
  </state>
602
- <state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1585251545014" />
603
- <state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1585251545013">
610
+ <state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1585380996924" />
611
+ <state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1585380996924">
604
612
  <screen x="0" y="23" width="2048" height="1129" />
605
613
  </state>
606
- <state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1585251545013" />
607
- <state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1585251545014">
614
+ <state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1585380996924" />
615
+ <state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1585380996925">
608
616
  <screen x="0" y="23" width="2048" height="1129" />
609
617
  </state>
610
- <state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1585251545014" />
618
+ <state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1585380996925" />
611
619
  <state x="0" y="23" width="2048" height="1129" key="SettingsEditor" timestamp="1580283935326">
612
620
  <screen x="0" y="23" width="2048" height="1129" />
613
621
  </state>
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [32.0.0](https://github.com/GLS-Spain/gps-common/compare/v31.0.3...v32.0.0) (2020-03-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * change historic record actionDetails for actionKeys ([7f9acc5](https://github.com/GLS-Spain/gps-common/commit/7f9acc5f746a16b42a58bbc99379381a84ac9f49))
7
+
8
+
9
+ ### BREAKING CHANGES
10
+
11
+ * historic records schema has changed
12
+
1
13
  ## [31.0.3](https://github.com/GLS-Spain/gps-common/compare/v31.0.2...v31.0.3) (2020-03-26)
2
14
 
3
15
 
@@ -441,24 +441,21 @@ expeditions they have access to.
441
441
  name: 'Historic records introduction',
442
442
  'x-displayName': 'Historic records',
443
443
  description: `
444
- Every time the API creates, updates or deletes a resource, it stores a historic record of: the action, the full document as it was after
444
+ Every time the API creates, updates or deletes a resource it stores a historic record of the action, the full document as it was after
445
445
  the action, the time it occurred and the user that made it.
446
446
 
447
447
  The only exception are \`pods\` which have no records because they are created when their expeditions are delivered and they are never
448
- updated or deleted.
448
+ updated. They are also never deleted because they need to remain accessible via the historic records of expeditions.
449
449
 
450
450
  These historic records serve two purposes:
451
451
 
452
452
  - They allow to track the full history of a document.
453
453
  - They are the basis for the [integrations](#tag/Integrations-introduction) with other systems.
454
454
 
455
- The \`actionDetails\` field adds more information about the action when necessary, for example:
455
+ The \`actionKeys\` lists the paths of the updated fields for an \`update\` action. The depth of the paths may vary:
456
456
 
457
- - An expedition reception from a customer is an \`update\` action with the \`receiveFromCustomer\` and \`price\` details.
458
- - An update of an expedition packages is an \`update\` action with a \`price\` detail.
459
- - An automatic background expiration of an expedition is an \`update\` action with an \`expired\` detail.
460
-
461
- The values in \`actionDetails\` only apply to certain combinations of \`type\` and \`action\`.
457
+ - Usually it is just the root key, for example an update of any field in a shop address is just \`address\`.
458
+ - Some updated are more specific, for example delivering an expedition is \`status.code\` and \`status.givenTo\`.
462
459
 
463
460
  The \`integrations\` field is where each integration stores what it did with it. Its properties are the names of the integrations and
464
461
  their values the result of that integration for that record.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gls_spain/gps-common",
3
- "version": "31.0.3",
3
+ "version": "32.0.0",
4
4
  "description": "Errors, schemas and documentation for the Parcel Shops project",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -20,25 +20,14 @@ const historicRecord = () => ({
20
20
  type: 'string',
21
21
  enum: ['defaults', 'superAdmin', 'network', 'networkAdmin', 'zone', 'representative', 'shop', 'shopUser', 'expedition'],
22
22
  },
23
+ document: { oneOf: [defaults(), superAdmin(), network(), networkAdmin(), zone(), representative(), shop(), shopUser(), expedition()] },
23
24
  action: { type: 'string', enum: ['create', 'update', 'delete'] },
24
- actionDetails: {
25
+ actionKeys: {
25
26
  type: 'array',
26
- items: {
27
- type: 'string',
28
- enum: [
29
- 'receiveFromDriver',
30
- 'receiveFromCustomer',
31
- 'giveToDriver',
32
- 'giveToCustomer',
33
- 'redirect',
34
- 'expirationReminder',
35
- 'expire',
36
- 'price',
37
- ],
38
- },
27
+ items: { type: 'string' },
28
+ description: 'the list of updated keys in an update action, e.g ["name", "status.code"]',
39
29
  },
40
- actor: { type: 'string', description: 'the username of the user who made the action' },
41
- document: { oneOf: [defaults(), superAdmin(), network(), networkAdmin(), zone(), representative(), shop(), shopUser(), expedition()] },
30
+ actor: { type: 'string', description: 'who made the action, e.g. username of the user, name of the script' },
42
31
  integrations: {
43
32
  type: 'object',
44
33
  additionalProperties: {
@@ -54,7 +43,7 @@ const historicRecord = () => ({
54
43
  description: 'one property per integration where the property name is the name of the integration',
55
44
  },
56
45
  },
57
- required: ['_id', 'createdAt', 'updatedAt', 'deletable', 'type', 'action', 'actionDetails', 'actor', 'document', 'integrations'],
46
+ required: ['_id', 'createdAt', 'updatedAt', 'deletable', 'type', 'document', 'action', 'actionKeys', 'actor', 'integrations'],
58
47
  additionalProperties: false,
59
48
  });
60
49