@shushed/helpers 0.0.202-v2-20251208085030 → 0.0.202

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.
Files changed (95) hide show
  1. package/dist/cjs/contracts/asset.schema.json +78 -0
  2. package/dist/cjs/contracts/category.schema.json +86 -0
  3. package/dist/cjs/contracts/country.schema.json +258 -0
  4. package/dist/cjs/contracts/currency.schema.json +177 -0
  5. package/dist/cjs/contracts/customer-segment.schema.json +32 -0
  6. package/dist/cjs/contracts/development-colour.schema.json +97 -0
  7. package/dist/cjs/contracts/index.js +48 -0
  8. package/dist/cjs/contracts/marketing-preferences.schema.json +41 -0
  9. package/dist/cjs/contracts/messages/ean-change.schema.json +22 -0
  10. package/dist/cjs/contracts/messages/index.js +29 -0
  11. package/dist/cjs/contracts/messages/order/delivered.schema.json +26 -0
  12. package/dist/cjs/contracts/messages/order/index.js +18 -0
  13. package/dist/cjs/contracts/messages/order/new.schema.json +32 -0
  14. package/dist/cjs/contracts/messages/order/processed.schema.json +15 -0
  15. package/dist/cjs/contracts/messages/order/return-initiated.schema.json +26 -0
  16. package/dist/cjs/contracts/messages/order/returned.schema.json +25 -0
  17. package/dist/cjs/contracts/messages/order/shipped.schema.json +26 -0
  18. package/dist/cjs/contracts/messages/product-category.schema.json +21 -0
  19. package/dist/cjs/contracts/messages/product-draft.schema.json +66 -0
  20. package/dist/cjs/contracts/messages/product.schema.json +29 -0
  21. package/dist/cjs/contracts/money.schema.json +54 -0
  22. package/dist/cjs/contracts/order/address.schema.json +127 -0
  23. package/dist/cjs/contracts/order/customer.schema.json +149 -0
  24. package/dist/cjs/contracts/order/index.js +31 -0
  25. package/dist/cjs/contracts/order/item.schema.json +98 -0
  26. package/dist/cjs/contracts/order/payment.schema.json +115 -0
  27. package/dist/cjs/contracts/order/shipment/index.js +29 -0
  28. package/dist/cjs/contracts/order/shipment/item/index.js +8 -0
  29. package/dist/cjs/contracts/order/shipment/item/returned.schema.json +30 -0
  30. package/dist/cjs/contracts/order/shipment/item.schema.json +22 -0
  31. package/dist/cjs/contracts/order/shipment/pos/index.js +10 -0
  32. package/dist/cjs/contracts/order/shipment/pos/outbound.schema.json +37 -0
  33. package/dist/cjs/contracts/order/shipment/pos/return.schema.json +31 -0
  34. package/dist/cjs/contracts/order/shipment/pos.schema.json +48 -0
  35. package/dist/cjs/contracts/order/shipment/shipped/index.js +10 -0
  36. package/dist/cjs/contracts/order/shipment/shipped/outbound.schema.json +34 -0
  37. package/dist/cjs/contracts/order/shipment/shipped/return.schema.json +43 -0
  38. package/dist/cjs/contracts/order/shipment/shipped.schema.json +52 -0
  39. package/dist/cjs/contracts/order/shipment.schema.json +58 -0
  40. package/dist/cjs/contracts/order.schema.json +231 -0
  41. package/dist/cjs/contracts/product-category.schema.json +34 -0
  42. package/dist/cjs/contracts/product-draft.schema.json +782 -0
  43. package/dist/cjs/contracts/product.schema.json +816 -0
  44. package/dist/cjs/contracts/total.schema.json +41 -0
  45. package/dist/cjs/dist-dereferenced/messages/order/delivered.js +1 -1
  46. package/dist/cjs/dist-dereferenced/messages/order/new.js +1 -1
  47. package/dist/cjs/dist-dereferenced/messages/order/processed.js +1 -1
  48. package/dist/cjs/dist-dereferenced/messages/order/return-initiated.js +1 -1
  49. package/dist/cjs/dist-dereferenced/messages/order/returned.js +1 -1
  50. package/dist/cjs/dist-dereferenced/messages/order/shipped.js +1 -1
  51. package/dist/cjs/dist-dereferenced/order/customer.js +1 -1
  52. package/dist/cjs/dist-dereferenced/order/item.js +1 -1
  53. package/dist/cjs/dist-dereferenced/order/orderMain.js +1 -1
  54. package/dist/cjs/dist-dereferenced/order/payment.js +1 -1
  55. package/dist/cjs/dist-dereferenced/order/shipment/pos/outbound.js +1 -1
  56. package/dist/cjs/dist-dereferenced/order/shipment/pos/return.js +1 -1
  57. package/dist/cjs/src-public/bcOrder.js +943 -0
  58. package/dist/cjs/src-public/dato.js +10 -287
  59. package/dist/cjs/src-public/index.js +3 -1
  60. package/dist/cjs/src-public/validate.js +34 -0
  61. package/dist/types/contracts/index.d.ts +15 -0
  62. package/dist/types/contracts/messages/index.d.ts +5 -0
  63. package/dist/types/contracts/messages/order/index.d.ts +6 -0
  64. package/dist/types/contracts/order/index.d.ts +6 -0
  65. package/dist/types/contracts/order/shipment/index.d.ts +6 -0
  66. package/dist/types/contracts/order/shipment/item/index.d.ts +1 -0
  67. package/dist/types/contracts/order/shipment/pos/index.d.ts +2 -0
  68. package/dist/types/contracts/order/shipment/shipped/index.d.ts +2 -0
  69. package/dist/types/dist-dereferenced/messages/order/delivered.d.ts +34 -10
  70. package/dist/types/dist-dereferenced/messages/order/new.d.ts +34 -10
  71. package/dist/types/dist-dereferenced/messages/order/processed.d.ts +34 -10
  72. package/dist/types/dist-dereferenced/messages/order/return-initiated.d.ts +34 -10
  73. package/dist/types/dist-dereferenced/messages/order/returned.d.ts +34 -10
  74. package/dist/types/dist-dereferenced/messages/order/shipped.d.ts +34 -10
  75. package/dist/types/dist-dereferenced/order/customer.d.ts +3 -0
  76. package/dist/types/dist-dereferenced/order/index.d.ts +34 -10
  77. package/dist/types/dist-dereferenced/order/item.d.ts +6 -3
  78. package/dist/types/dist-dereferenced/order/orderMain.d.ts +34 -10
  79. package/dist/types/dist-dereferenced/order/payment.d.ts +16 -0
  80. package/dist/types/dist-dereferenced/order/shipment/pos/outbound.d.ts +0 -1
  81. package/dist/types/dist-dereferenced/order/shipment/pos/return.d.ts +0 -1
  82. package/dist/types/dist-types/messages/order/delivered.d.ts +13 -5
  83. package/dist/types/dist-types/messages/order/new.d.ts +13 -5
  84. package/dist/types/dist-types/messages/order/processed.d.ts +13 -5
  85. package/dist/types/dist-types/messages/order/return-initiated.d.ts +13 -5
  86. package/dist/types/dist-types/messages/order/returned.d.ts +13 -5
  87. package/dist/types/dist-types/messages/order/shipped.d.ts +13 -5
  88. package/dist/types/dist-types/order/customer.d.ts +1 -0
  89. package/dist/types/dist-types/order/item.d.ts +4 -3
  90. package/dist/types/dist-types/order/orderMain.d.ts +13 -5
  91. package/dist/types/dist-types/order/payment.d.ts +4 -0
  92. package/dist/types/src-public/bcOrder.d.ts +84 -0
  93. package/dist/types/src-public/dato.d.ts +1 -34
  94. package/dist/types/src-public/index.d.ts +1 -0
  95. package/package.json +1 -1
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Order Shipment POS Return",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "$id": "https://shushed.example.com/order/shipment/pos/return.schema.json",
7
+ "description": "Represents a return shipment processed at a Point of Sale (POS) location, containing items being returned by the customer.",
8
+ "allOf": [
9
+ {
10
+ "$ref": "https://shushed.example.com/order/shipment/pos.schema.json"
11
+ },
12
+ {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "type": {
17
+ "type": ["string"],
18
+ "enum": ["POS-RETURN"],
19
+ "description": "Shipment type indicating a return processed at POS."
20
+ },
21
+ "items": {
22
+ "type": "array",
23
+ "items": {
24
+ "$ref": "https://shushed.example.com/order/shipment/item/returned.schema.json"
25
+ },
26
+ "description": "List of returned items included in the POS return shipment."
27
+ }
28
+ }
29
+ }
30
+ ]
31
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Order Shipment Outbound",
4
+ "type": "object",
5
+ "$id": "https://shushed.example.com/order/shipment/pos.schema.json",
6
+ "description": "Represents a shipment that originates from a Point of Sale (POS) location, including outbound or return types, associated with a store and a store associate.",
7
+ "allOf": [
8
+ {
9
+ "$ref": "https://shushed.example.com/order/shipment.schema.json"
10
+ },
11
+ {
12
+ "type": "object",
13
+ "properties": {
14
+ "type": {
15
+ "type": ["string"],
16
+ "enum": ["POS-OUTBOUND", "POS-RETURN"],
17
+ "description": "Indicates whether the shipment is an outbound POS shipment or a return."
18
+ },
19
+ "status": {
20
+ "type": ["string"],
21
+ "enum": ["RECEIVED"],
22
+ "description": "Current status of the POS shipment."
23
+ },
24
+ "store_id": {
25
+ "type": ["string", "null"],
26
+ "faker": { "custom.documentid": ["S", 3] },
27
+ "description": "Unique identifier of the store from which the POS shipment originated."
28
+ },
29
+ "store_name": {
30
+ "type": ["string", "null"],
31
+ "faker": { "address.city": [] },
32
+ "description": "Name of the store associated with the shipment."
33
+ },
34
+ "associate_id": {
35
+ "type": ["string", "null"],
36
+ "faker": { "custom.documentid": ["A", 3] },
37
+ "description": "Unique identifier of the store associate processing the shipment."
38
+ },
39
+ "associate_name": {
40
+ "type": ["string", "null"],
41
+ "faker": { "name.fullName": [] },
42
+ "description": "Full name of the store associate handling the transaction."
43
+ }
44
+ },
45
+ "required": ["store_id", "store_name", "associate_id", "associate_name"]
46
+ }
47
+ ]
48
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.OrderShipmentShippedReturn = exports.OrderShipmentShippedOutbound = void 0;
7
+ var outbound_schema_json_1 = require("./outbound.schema.json");
8
+ Object.defineProperty(exports, "OrderShipmentShippedOutbound", { enumerable: true, get: function () { return __importDefault(outbound_schema_json_1).default; } });
9
+ var return_schema_json_1 = require("./return.schema.json");
10
+ Object.defineProperty(exports, "OrderShipmentShippedReturn", { enumerable: true, get: function () { return __importDefault(return_schema_json_1).default; } });
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Order Shipment Shipped Outbound",
4
+ "type": "object",
5
+ "$id": "https://shushed.example.com/order/shipment/shipped/outbound.schema.json",
6
+ "description": "Represents an outbound shipment that has been dispatched from a fulfillment center to the customer. Includes the fulfillment provider and list of items shipped.",
7
+ "allOf": [
8
+ {
9
+ "$ref": "https://shushed.example.com/order/shipment.schema.json"
10
+ },
11
+ {
12
+ "type": "object",
13
+ "properties": {
14
+ "type": {
15
+ "type": ["string"],
16
+ "enum": ["SHIPPED-OUTBOUND"],
17
+ "description": "Identifies this shipment as an outbound shipment to the customer."
18
+ },
19
+ "shipped_by": {
20
+ "type": ["string"],
21
+ "enum": ["TORQUE", "GLOBALE"],
22
+ "description": "The fulfillment provider responsible for shipping the order."
23
+ },
24
+ "items": {
25
+ "type": "array",
26
+ "items": {
27
+ "$ref": "https://shushed.example.com/order/shipment/item.schema.json"
28
+ },
29
+ "description": "List of items included in the outbound shipment."
30
+ }
31
+ }
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Order Shipment Shipped Return",
4
+ "type": "object",
5
+ "$id": "https://shushed.example.com/order/shipment/shipped/return.schema.json",
6
+ "description": "Represents a shipment that has been returned by the customer, including the items that were sent back.",
7
+ "allOf": [
8
+ {
9
+ "$ref": "https://shushed.example.com/order/shipment.schema.json"
10
+ },
11
+ {
12
+ "type": "object",
13
+ "properties": {
14
+ "type": {
15
+ "type": [
16
+ "string"
17
+ ],
18
+ "enum": [
19
+ "SHIPPED-RETURN"
20
+ ],
21
+ "description": "Indicates this shipment is a returned shipment."
22
+ },
23
+ "shipped_by": {
24
+ "type": [
25
+ "string"
26
+ ],
27
+ "enum": [
28
+ "CUSTOMER"
29
+ ],
30
+ "description": "Specifies that the return was initiated by the customer."
31
+ },
32
+ "items": {
33
+ "type": "array",
34
+ "items": {
35
+ "$ref": "https://shushed.example.com/order/shipment/item.schema.json"
36
+ },
37
+ "description": "List of items returned in the shipment."
38
+ }
39
+ },
40
+ "required": ["type", "shipped_by", "items"]
41
+ }
42
+ ]
43
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Order Shipment Outbound",
4
+ "type": "object",
5
+ "$id": "https://shushed.example.com/order/shipment/shipped.schema.json",
6
+ "description": "Represents a shipment event for an order, either outbound or return, including courier, tracking, and class details.",
7
+ "additionalProperties": false,
8
+ "allOf": [
9
+ {
10
+ "$ref": "https://shushed.example.com/order/shipment.schema.json"
11
+ },
12
+ {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "type": {
17
+ "type": ["string"],
18
+ "enum": ["SHIPPED-OUTBOUND", "SHIPPED-RETURN"],
19
+ "description": "Indicates the direction of the shipment: outbound to customer or return from customer.",
20
+ "example": "SHIPPED-OUTBOUND"
21
+ },
22
+ "shipped_by": {
23
+ "type": ["string"],
24
+ "enum": ["TORQUE", "GLOBALE", "CUSTOMER"],
25
+ "description": "Party responsible for shipping: a warehouse partner (e.g., TORQUE), logistics partner (e.g., GLOBALE), or the customer themselves.",
26
+ "example": "TORQUE"
27
+ },
28
+ "courier_name": {
29
+ "type": ["string", "null"],
30
+ "enum": ["GLOBALE", "ROYALMAIL", "EVRI", "WAITROSE"],
31
+ "description": "Courier company used for shipping. May be null for customer-initiated returns.",
32
+ "example": "ROYALMAIL"
33
+ },
34
+ "tracking_code": {
35
+ "type": ["string", "null"],
36
+ "faker": {
37
+ "format": "uuid"
38
+ },
39
+ "description": "Tracking number provided by the courier. May be null if unavailable.",
40
+ "example": "PZ448969282GB"
41
+ },
42
+ "class_name": {
43
+ "type": ["string"],
44
+ "enum": ["STANDARD", "PRIORITY"],
45
+ "description": "Delivery service class used for the shipment.",
46
+ "example": "STANDARD"
47
+ }
48
+ },
49
+ "required": ["shipped_by", "courier_name", "tracking_code", "class_name"]
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Shipment",
4
+ "type": "object",
5
+ "$id": "https://shushed.example.com/order/shipment.schema.json",
6
+ "description": "Represents a shipment record which could be outbound or return, either from a warehouse or a point of sale (POS). Includes status, items, and ERP identifiers.",
7
+ "allOf": [
8
+ {
9
+ "$ref": "https://shushed.example.com/total.schema.json"
10
+ },
11
+ {
12
+ "type": "object",
13
+ "properties": {
14
+ "erp_id": {
15
+ "type": ["string"],
16
+ "faker": { "custom.documentid": ["SP", 9] },
17
+ "description": "Unique identifier for the shipment from the ERP system."
18
+ },
19
+ "type": {
20
+ "type": ["string"],
21
+ "enum": [
22
+ "SHIPPED-OUTBOUND",
23
+ "SHIPPED-RETURN",
24
+ "POS-OUTBOUND",
25
+ "POS-RETURN"
26
+ ],
27
+ "description": "Type of shipment. Can be shipped or returned from warehouse or POS."
28
+ },
29
+ "shipped_at": {
30
+ "type": ["string"],
31
+ "format": "date-time",
32
+ "description": "Date and time the shipment was shipped."
33
+ },
34
+ "status": {
35
+ "type": ["string"],
36
+ "enum": ["PENDING", "SHIPPED", "RECEIVED", "CANCELLED"],
37
+ "description": "Current status of the shipment."
38
+ },
39
+ "items": {
40
+ "type": ["array"],
41
+ "items": {
42
+ "type": "object",
43
+ "anyOf": [
44
+ {
45
+ "$ref": "https://shushed.example.com/order/shipment/item.schema.json"
46
+ },
47
+ {
48
+ "$ref": "https://shushed.example.com/order/shipment/item/returned.schema.json"
49
+ }
50
+ ]
51
+ },
52
+ "description": "List of items included in the shipment."
53
+ }
54
+ }
55
+ }
56
+ ],
57
+ "required": ["erp_id", "shipped_at", "status", "items"]
58
+ }
@@ -0,0 +1,231 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Order",
4
+ "type": "object",
5
+ "$id": "https://shushed.example.com/order.schema.json",
6
+ "properties": {
7
+ "status": {
8
+ "type": ["string"],
9
+ "enum": [
10
+ "NEW",
11
+ "PENDING",
12
+ "CONFIRMED",
13
+ "PROCESSING",
14
+ "PROCESSED",
15
+ "PACKED",
16
+ "SHIPPED",
17
+ "DELIVERED",
18
+ "PARTIALLY-SHIPPED",
19
+ "RETURNED",
20
+ "PARTIALLY-RETURNED",
21
+ "CANCELLED",
22
+ "ARCHIVED",
23
+ "FAILED"
24
+ ],
25
+ "description": "Current status of the order in the order lifecycle - Example: PENDING"
26
+ },
27
+ "erp_order_id": {
28
+ "type": "string",
29
+ "faker": { "custom.documentid": ["MOCK", "8"] },
30
+ "description": "Unique order identifier assigned by the ERP system - Example: XX12345678"
31
+ },
32
+ "centra_order_id": {
33
+ "type": ["integer", "null"],
34
+ "description": "Unique order number assigned by the Centra system (integer format) - Example: 23"
35
+ },
36
+ "sfcc_order_id": {
37
+ "type": ["string", "null"],
38
+ "description": "Salesforce Commerce Cloud order identifier, nullable if not applicable - Example: XX123456789 or null"
39
+ },
40
+ "globale_order_id": {
41
+ "type": ["string", "null"],
42
+ "faker": { "custom.documentid": ["GEMOCK", "16"] },
43
+ "description": "Identifier for Globale orders, nullable if not applicable - Example: GE00025734 or null"
44
+ },
45
+ "sitoo_order_id": {
46
+ "type": ["string", "null"],
47
+ "format": "uuid",
48
+ "description": "Sitoo POS system order identifier, nullable if not applicable - Example: XX10008732 or null"
49
+ },
50
+ "system_created_by": {
51
+ "type": "string",
52
+ "enum": ["POS", "ECOMMERCE", "SYSTEM"],
53
+ "description": "Origin system or actor that created the order record - Example: POS"
54
+ },
55
+ "ordered_at": {
56
+ "type": "string",
57
+ "format": "date-time",
58
+ "faker": {
59
+ "date.between": ["2024-01-01T00:00:00.000Z", "2025-04-30T00:00:00.000Z"]
60
+ },
61
+ "description": "Timestamp when the order was placed - Example: 2024-12-25T15:30:00Z"
62
+ },
63
+ "payments": {
64
+ "type": "array",
65
+ "items": { "$ref": "https://shushed.example.com/order/payment.schema.json" },
66
+ "faker": {
67
+ "minItems": 1,
68
+ "maxItems": 2,
69
+ "uniqueItems": true
70
+ },
71
+ "description": "List of payment transactions related to this order.",
72
+ "example": [
73
+ {
74
+ "type": "CHARGE",
75
+ "created_at": "2024-12-25T15:35:00Z",
76
+ "payment_method": "CREDIT-CARD",
77
+ "transaction_id": "TR123456789",
78
+ "card_number": "4111111111111111",
79
+ "journey_label": "CHECKOUT",
80
+ "psp_reference": "PSP987654321",
81
+ "card_brand": "VISA",
82
+ "status": "CAPTURED",
83
+ "amount": { "currency": "USD", "value": 15000 },
84
+ "created_by": "CUSTOMER"
85
+ }
86
+ ]
87
+ },
88
+ "is_anonymous": {
89
+ "type": ["boolean"],
90
+ "description": "Indicates if the order was placed by an anonymous user - Example: true or false"
91
+ },
92
+ "is_gift": {
93
+ "type": ["boolean"],
94
+ "description": "Indicates if the order is marked as a gift - Example: true or false"
95
+ },
96
+ "customer": {
97
+ "$ref": "https://shushed.example.com/order/customer.schema.json",
98
+ "description": "Customer details related to this order - Example: {}"
99
+ },
100
+ "billing_address": {
101
+ "anyOf": [
102
+ { "$ref": "https://shushed.example.com/order/address.schema.json" },
103
+ { "type": ["null"] }
104
+ ],
105
+ "description": "Billing address for the order, nullable if unavailable.",
106
+ "example": {
107
+ "first_name": "Alice",
108
+ "last_name": "Johnson",
109
+ "address1": "123 Main St",
110
+ "address2": "Apt 4B",
111
+ "city": "New York",
112
+ "region": "NY",
113
+ "post_code": "10001",
114
+ "country_code": "US",
115
+ "phone": "+1-202-555-0143"
116
+ }
117
+ },
118
+ "shipping_address": {
119
+ "anyOf": [
120
+ { "$ref": "https://shushed.example.com/order/address.schema.json" },
121
+ { "type": ["null"] }
122
+ ],
123
+ "description": "Shipping address for the order, nullable if unavailable.",
124
+ "example": {
125
+ "first_name": "Alice",
126
+ "last_name": "Johnson",
127
+ "address1": "123 Main St",
128
+ "address2": "Apt 4B",
129
+ "city": "New York",
130
+ "region": "NY",
131
+ "post_code": "10001",
132
+ "country_code": "US",
133
+ "phone": "+1-202-555-0143"
134
+ }
135
+ },
136
+ "collection_point_id": {
137
+ "type": [
138
+ "string",
139
+ "null"
140
+ ],
141
+ "description": "Collection point ID reference if applicable - Example: EVRI-S41902"
142
+ },
143
+ "is_pos": { "type": ["boolean"], "description": "Flag indicating if the order was placed via a POS system example: true or false" },
144
+ "shipments": {
145
+ "type": "array",
146
+ "minItems": 1,
147
+ "prefixItems": [
148
+ {
149
+ "anyOf": [
150
+ {
151
+ "$ref": "https://shushed.example.com/order/shipment/shipped/outbound.schema.json"
152
+ },
153
+ {
154
+ "$ref": "https://shushed.example.com/order/shipment/pos/outbound.schema.json"
155
+ }
156
+ ]
157
+ }
158
+ ],
159
+ "items": {
160
+ "anyOf": [
161
+ {
162
+ "$ref": "https://shushed.example.com/order/shipment/shipped/outbound.schema.json"
163
+ },
164
+ {
165
+ "$ref": "https://shushed.example.com/order/shipment/shipped/return.schema.json"
166
+ },
167
+ {
168
+ "$ref": "https://shushed.example.com/order/shipment/pos/outbound.schema.json"
169
+ },
170
+ {
171
+ "$ref": "https://shushed.example.com/order/shipment/pos/return.schema.json"
172
+ }
173
+ ]
174
+ },
175
+ "faker": {
176
+ "minItems": 1,
177
+ "maxItems": 2,
178
+ "uniqueItems": true
179
+ },
180
+ "description": "List of shipments related to the order, including outbound and return shipments",
181
+ "example": [
182
+ {
183
+ "erp_id": "SP123456789",
184
+ "type": "SHIPPED-OUTBOUND",
185
+ "shipped_at": "2024-12-26T10:00:00Z",
186
+ "status": "SHIPPED",
187
+ "items": [
188
+ {
189
+ "sku": "SKU123",
190
+ "quantity": 1,
191
+ "unit_price_net": { "currency": "USD", "value": 10000 },
192
+ "unit_price_gross": { "currency": "USD", "value": 12000 }
193
+ }
194
+ ]
195
+ }
196
+ ]
197
+ },
198
+ "items": {
199
+ "type": "array",
200
+ "minItems": 1,
201
+ "items": { "$ref": "https://shushed.example.com/order/item.schema.json" },
202
+ "faker": {
203
+ "minItems": 1,
204
+ "maxItems": 2,
205
+ "uniqueItems": true
206
+ },
207
+ "description": "List of items included in the order.",
208
+ "example": [
209
+ {
210
+ "sku": "SKU123",
211
+ "colour_id": "RED",
212
+ "style_id": "STYLE1",
213
+ "quantity": 1,
214
+ "unit_price_net": { "currency": "USD", "value": 10000 },
215
+ "unit_price_gross": { "currency": "USD", "value": 12000 },
216
+ "unit_price_status": "rrp",
217
+ "discount_amount_net": { "currency": "USD", "value": 0 },
218
+ "discount_amount_gross": { "currency": "USD", "value": 0 }
219
+ }
220
+ ]
221
+ },
222
+ "total": { "$ref": "https://shushed.example.com/total.schema.json", "description": "Total monetary value of the order." },
223
+ "return_total": { "$ref": "https://shushed.example.com/total.schema.json", "description": "Total monetary value of returned items." },
224
+ "net_total": { "$ref": "https://shushed.example.com/total.schema.json", "description": "Net total amount after discounts and returns." },
225
+ "shipping_method": {
226
+ "type": ["string", "null"],
227
+ "description": "Shipping method used for the order, nullable if not applicable - Example: EMAILDELIVERY, GLOBALE_HUB, GLOBALE_EXPRESS"
228
+ }
229
+ },
230
+ "required": ["erp_order_id", "status", "ordered_at", "items", "total"]
231
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://shushed.example.com/product-category.schema.json",
4
+ "title": "ProductCategory",
5
+ "description": "Schema representing all categories assigned to a product for a specific site.",
6
+ "additionalProperties": false,
7
+ "type": "object",
8
+ "properties": {
9
+ "product_id": {
10
+ "type": "string",
11
+ "description": "Unique identifier of the product."
12
+ },
13
+ "site_id": {
14
+ "type": "string",
15
+ "description": "Identifier or display name of the site/storefront where this category assignment applies."
16
+ },
17
+ "categories": {
18
+ "type": "array",
19
+ "description": "Array of category identifiers assigned to this product.",
20
+ "items": {
21
+ "type": "string"
22
+ },
23
+ "minItems": 0
24
+ }
25
+ },
26
+ "required": ["product_id", "site_id", "categories"],
27
+ "examples": [
28
+ {
29
+ "product_id": "prod123",
30
+ "site_id": "Linen Blend Petunia Wide Leg Trousers",
31
+ "categories": ["Shop", "Trousers"]
32
+ }
33
+ ]
34
+ }