Skip to content

Commit

Permalink
[MODORDSTOR-357] - Implement the capability to send the modified stat…
Browse files Browse the repository at this point in the history
…e using a transactional outbox for Piece
  • Loading branch information
imerabishvili committed Nov 8, 2023
1 parent c865c45 commit f335466
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 2 deletions.
35 changes: 35 additions & 0 deletions mod-orders-storage/examples/piece_audit_event.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"id": "99fb699a-cdf1-11e9-a9d9-f2801f1b9aa1",
"action": "Edit",
"pieceId": "c4abf6c3-4bd5-4464-999b-c66cfb6f1cf9",
"userId": "58edf8c3-89e4-559c-9aed-aae637a3f40b",
"eventDate": "2022-11-10T09:30:00.333Z",
"actionDate": "2022-11-10T09:29:00.578Z",
"pieceSnapshot":
{
"id": "5e317dc2-deeb-4429-b2a1-91e5cd0fd5f7",
"caption": "Tutorial Volume 5",
"comment": "Special Edition",
"format": "Electronic",
"itemId": "522a501a-56b5-48d9-b28a-3a8f02482d97",
"locationId": "53cf956f-c1df-410b-8bea-27f712cca7c0",
"poLineId": "d471d766-8dbb-4609-999a-02681dea6c22",
"titleId": "9a665b22-9fe5-4c95-b4ee-837a5433c95d",
"displayOnHolding": false,
"enumeration": "Volume 1",
"chronology": "2021",
"discoverySuppress": false,
"copyNumber": "94753",
"receivingStatus": "Expected",
"supplement": true,
"receiptDate": "2018-10-11T00:00:00.000Z",
"claimingInterval": 0,
"statusUpdatedDate": "2018-10-11T00:00:00.000Z",
"metadata": {
"createdDate": "2022-11-10T09:22:15.808Z",
"updatedDate": "2022-11-10T09:29:00.578Z",
"createdByUserId": "58edf8c3-89e4-559c-9aed-aae637a3f40b",
"updatedByUserId": "58edf8c3-89e4-559c-9aed-aae637a3f40b"
}
}
}
6 changes: 5 additions & 1 deletion mod-orders-storage/examples/piece_get.sample
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
"supplement": true,
"receiptDate": "2018-10-11T00:00:00.000Z",
"claimingInterval": 0,
"statusUpdatedDate": "2018-10-11T00:00:00.000Z"
"statusUpdatedDate": "2018-10-11T00:00:00.000Z",
"metadata": {
"createdDate": "2018-08-19T00:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
3 changes: 2 additions & 1 deletion mod-orders-storage/schemas/outbox_event_log.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"type": "string",
"enum": [
"Order",
"OrderLine"
"OrderLine",
"Piece"
]
},
"action": {
Expand Down
6 changes: 6 additions & 0 deletions mod-orders-storage/schemas/piece.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Piece details",
"type": "object",
"javaName": "Piece",
"properties": {
"id": {
"description": "UUID of this piece record",
Expand Down Expand Up @@ -99,6 +100,11 @@
"default": 0
}
},
"metadata": {
"type": "object",
"$ref": "../../../raml-util/schemas/metadata.schema",
"readonly": true
},
"additionalProperties": false,
"required": [
"format",
Expand Down
40 changes: 40 additions & 0 deletions mod-orders-storage/schemas/piece_audit_event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Piece audit event",
"type": "object",
"properties": {
"id": {
"description": "UUID of the event",
"$ref": "../../common/schemas/uuid.json"
},
"action": {
"description": "Action for piece (Create, Edit or Delete)",
"type": "string",
"$ref": "event_action.json"
},
"pieceId": {
"description": "UUID of the piece",
"$ref": "../../common/schemas/uuid.json"
},
"userId": {
"description": "UUID of the user who performed the action",
"$ref": "../../common/schemas/uuid.json"
},
"eventDate": {
"description": "Date time when event triggered",
"format": "date-time",
"type": "string"
},
"actionDate": {
"description": "Date time when piece action occurred",
"format": "date-time",
"type": "string"
},
"pieceSnapshot": {
"description": "Full snapshot of the piece",
"type": "object",
"$ref": "piece.json"
}
},
"additionalProperties": false
}

0 comments on commit f335466

Please sign in to comment.