Skip to content
This repository has been archived by the owner on May 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #57 from onoga/master
Browse files Browse the repository at this point in the history
msg_for, update tests
  • Loading branch information
source-c authored Jul 8, 2020
2 parents 91786ca + b7e83c6 commit dd66427
Show file tree
Hide file tree
Showing 21 changed files with 192 additions and 125 deletions.
5 changes: 5 additions & 0 deletions edi/json-schema/document.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"type": "string",
"description": "MD5 hash of the stringified document's body",
"pattern": "^[0-9a-f]{32}$"
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
}
10 changes: 10 additions & 0 deletions edi/json-schema/event_parcel.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
"document_id": {
"type": "string",
"description": "Corresonding document identifier"
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
},
Expand Down Expand Up @@ -143,6 +148,11 @@
"type": "boolean",
"description": "Is the parcel is of quasi-parcel type",
"default": false
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions edi/json-schema/fms_contragent_announcement.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
"comment": {
"type": "string",
"description": "Additional info"
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
}
5 changes: 5 additions & 0 deletions edi/json-schema/fms_emoney_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@
"target_wallet": {
"type": "string",
"description": "Target wallet reference, informal"
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
}
5 changes: 5 additions & 0 deletions edi/json-schema/order_payment.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
"type": "string",
"description": "Optionally identifies correction",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
}
5 changes: 5 additions & 0 deletions edi/json-schema/refill_payment.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
"comment": {
"type": "string",
"description": "Additional info"
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
}
5 changes: 5 additions & 0 deletions edi/json-schema/wms_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
},
"owner": {
"$ref": "#/definitions/uuid"
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
}
114 changes: 59 additions & 55 deletions edi/json-schema/wms_item_announcement.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,65 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "WMS item (movement) anouncement",
"definitions": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
},
"uuid_v1": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-1[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
}
},
"type": "object",
"required": [
"serial",
"item",
"reference"
],
"properties": {
"serial": {
"$ref": "#/definitions/uuid_v1"
},
"item": {
"oneOf": [
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "WMS item (movement) anouncement",
"definitions": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
},
"uuid_v1": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-1[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
}
},
"type": "object",
"required": [
"serial",
"item",
"reference"
],
"properties": {
"serial": {
"$ref": "#/definitions/uuid_v1"
},
"item": {
"oneOf": [
{
"type": "string",
"pattern": "^[^ ]{3,24}$"
},
{
"type": "array",
"items": {
"type": "string",
"pattern": "^[^ ]{3,24}$"
},
{
"type": "array",
"items": {
"type": "string",
"pattern": "^[^ ]{3,24}$"
}
}
]
},
"zone_from": {
"type": "string",
"pattern": "^[^ ]{3,64}$"
},
"zone_to": {
"type": "string",
"pattern": "^[^ ]{3,64}$"
},
"reference": {
"$ref": "#/definitions/uuid"
},
"version": {
"type": "string"
},
"origin": {
"$ref": "#/definitions/uuid"
},
"owner": {
"$ref": "#/definitions/uuid"
}
}
]
},
"zone_from": {
"type": "string",
"pattern": "^[^ ]{3,64}$"
},
"zone_to": {
"type": "string",
"pattern": "^[^ ]{3,64}$"
},
"reference": {
"$ref": "#/definitions/uuid"
},
"version": {
"type": "string"
},
"origin": {
"$ref": "#/definitions/uuid"
},
"owner": {
"$ref": "#/definitions/uuid"
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
}
5 changes: 5 additions & 0 deletions edi/json-schema/wms_registry_announcement.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"type": "string",
"description": "Event",
"enum": ["created", "updated", "closed"]
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
}
122 changes: 63 additions & 59 deletions edi/json-schema/wms_stocktaking_message.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,70 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "WMS stocktaking message",
"definitions": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
},
"uuid_v1": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-1[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
}
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "WMS stocktaking message",
"definitions": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
},
"type": "object",
"required": [
"serial",
"reference",
"message_type"
],
"properties": {
"serial": {
"$ref": "#/definitions/uuid_v1"
},
"reference": {
"$ref": "#/definitions/uuid"
},
"label":{
"type": "string",
"pattern": "^[^ ]{3,128}$"
},
"message_type": {
"type": "string",
"enum": [
"start",
"evaluation",
"error",
"finish"
]
},
"item": {
"oneOf": [
{
"uuid_v1": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-1[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
}
},
"type": "object",
"required": [
"serial",
"reference",
"message_type"
],
"properties": {
"serial": {
"$ref": "#/definitions/uuid_v1"
},
"reference": {
"$ref": "#/definitions/uuid"
},
"label": {
"type": "string",
"pattern": "^[^ ]{3,128}$"
},
"message_type": {
"type": "string",
"enum": [
"start",
"evaluation",
"error",
"finish"
]
},
"item": {
"oneOf": [
{
"type": "string",
"pattern": "^[^ ]{3,24}$"
},
{
"type": "array",
"items": {
"type": "string",
"pattern": "^[^ ]{3,24}$"
},
{
"type": "array",
"items": {
"type": "string",
"pattern": "^[^ ]{3,24}$"
}
}
]
},
"version": {
"type": "string"
},
"origin": {
"$ref": "#/definitions/uuid"
},
"owner": {
"$ref": "#/definitions/uuid"
}
}
]
},
"version": {
"type": "string"
},
"origin": {
"$ref": "#/definitions/uuid"
},
"owner": {
"$ref": "#/definitions/uuid"
}
},
"msg_for": {
"type": "string",
"description": "User id to proxy message for",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
3 changes: 2 additions & 1 deletion tests/edi/json-schema/document.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"body": {
"some": "body"
},
"checksum": "fd6b34c54a331ccbbfacade3ea4bd225"
"checksum": "fd6b34c54a331ccbbfacade3ea4bd225",
"msg_for": "deeaea34-ff10-48dd-bf54-82add4b931de"
}
4 changes: 3 additions & 1 deletion tests/edi/json-schema/event_parcel.change_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
3
],
"parcel_source": "external",
"external_ref": "some_ref",
"delivery_service": "novaposhta",
"is_quasi": true
"is_quasi": true,
"msg_for": "deeaea34-ff10-48dd-bf54-82add4b931de"
}
3 changes: 2 additions & 1 deletion tests/edi/json-schema/event_parcel.order_cacel.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"total_price": 310.12,
"money_back": true,
"money_dest": "card",
"document_id": "ABCDEFGHIJKLMNOP"
"document_id": "ABCDEFGHIJKLMNOP",
"msg_for": "deeaea34-ff10-48dd-bf54-82add4b931de"
}
3 changes: 2 additions & 1 deletion tests/edi/json-schema/fms_contragent_announcement.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"action": "deleted",
"reason": "self",
"merchant_id": "ABCDEFGHIJKLMNOPQR",
"comment": "ABCDEFGHIJK"
"comment": "ABCDEFGHIJK",
"msg_for": "deeaea34-ff10-48dd-bf54-82add4b931de"
}
Loading

0 comments on commit dd66427

Please sign in to comment.