@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.
- package/dist/cjs/contracts/asset.schema.json +78 -0
- package/dist/cjs/contracts/category.schema.json +86 -0
- package/dist/cjs/contracts/country.schema.json +258 -0
- package/dist/cjs/contracts/currency.schema.json +177 -0
- package/dist/cjs/contracts/customer-segment.schema.json +32 -0
- package/dist/cjs/contracts/development-colour.schema.json +97 -0
- package/dist/cjs/contracts/index.js +48 -0
- package/dist/cjs/contracts/marketing-preferences.schema.json +41 -0
- package/dist/cjs/contracts/messages/ean-change.schema.json +22 -0
- package/dist/cjs/contracts/messages/index.js +29 -0
- package/dist/cjs/contracts/messages/order/delivered.schema.json +26 -0
- package/dist/cjs/contracts/messages/order/index.js +18 -0
- package/dist/cjs/contracts/messages/order/new.schema.json +32 -0
- package/dist/cjs/contracts/messages/order/processed.schema.json +15 -0
- package/dist/cjs/contracts/messages/order/return-initiated.schema.json +26 -0
- package/dist/cjs/contracts/messages/order/returned.schema.json +25 -0
- package/dist/cjs/contracts/messages/order/shipped.schema.json +26 -0
- package/dist/cjs/contracts/messages/product-category.schema.json +21 -0
- package/dist/cjs/contracts/messages/product-draft.schema.json +66 -0
- package/dist/cjs/contracts/messages/product.schema.json +29 -0
- package/dist/cjs/contracts/money.schema.json +54 -0
- package/dist/cjs/contracts/order/address.schema.json +127 -0
- package/dist/cjs/contracts/order/customer.schema.json +149 -0
- package/dist/cjs/contracts/order/index.js +31 -0
- package/dist/cjs/contracts/order/item.schema.json +98 -0
- package/dist/cjs/contracts/order/payment.schema.json +115 -0
- package/dist/cjs/contracts/order/shipment/index.js +29 -0
- package/dist/cjs/contracts/order/shipment/item/index.js +8 -0
- package/dist/cjs/contracts/order/shipment/item/returned.schema.json +30 -0
- package/dist/cjs/contracts/order/shipment/item.schema.json +22 -0
- package/dist/cjs/contracts/order/shipment/pos/index.js +10 -0
- package/dist/cjs/contracts/order/shipment/pos/outbound.schema.json +37 -0
- package/dist/cjs/contracts/order/shipment/pos/return.schema.json +31 -0
- package/dist/cjs/contracts/order/shipment/pos.schema.json +48 -0
- package/dist/cjs/contracts/order/shipment/shipped/index.js +10 -0
- package/dist/cjs/contracts/order/shipment/shipped/outbound.schema.json +34 -0
- package/dist/cjs/contracts/order/shipment/shipped/return.schema.json +43 -0
- package/dist/cjs/contracts/order/shipment/shipped.schema.json +52 -0
- package/dist/cjs/contracts/order/shipment.schema.json +58 -0
- package/dist/cjs/contracts/order.schema.json +231 -0
- package/dist/cjs/contracts/product-category.schema.json +34 -0
- package/dist/cjs/contracts/product-draft.schema.json +782 -0
- package/dist/cjs/contracts/product.schema.json +816 -0
- package/dist/cjs/contracts/total.schema.json +41 -0
- package/dist/cjs/dist-dereferenced/messages/order/delivered.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/new.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/processed.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/return-initiated.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/returned.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/shipped.js +1 -1
- package/dist/cjs/dist-dereferenced/order/customer.js +1 -1
- package/dist/cjs/dist-dereferenced/order/item.js +1 -1
- package/dist/cjs/dist-dereferenced/order/orderMain.js +1 -1
- package/dist/cjs/dist-dereferenced/order/payment.js +1 -1
- package/dist/cjs/dist-dereferenced/order/shipment/pos/outbound.js +1 -1
- package/dist/cjs/dist-dereferenced/order/shipment/pos/return.js +1 -1
- package/dist/cjs/src-public/bcOrder.js +943 -0
- package/dist/cjs/src-public/dato.js +10 -287
- package/dist/cjs/src-public/index.js +3 -1
- package/dist/cjs/src-public/validate.js +34 -0
- package/dist/types/contracts/index.d.ts +15 -0
- package/dist/types/contracts/messages/index.d.ts +5 -0
- package/dist/types/contracts/messages/order/index.d.ts +6 -0
- package/dist/types/contracts/order/index.d.ts +6 -0
- package/dist/types/contracts/order/shipment/index.d.ts +6 -0
- package/dist/types/contracts/order/shipment/item/index.d.ts +1 -0
- package/dist/types/contracts/order/shipment/pos/index.d.ts +2 -0
- package/dist/types/contracts/order/shipment/shipped/index.d.ts +2 -0
- package/dist/types/dist-dereferenced/messages/order/delivered.d.ts +34 -10
- package/dist/types/dist-dereferenced/messages/order/new.d.ts +34 -10
- package/dist/types/dist-dereferenced/messages/order/processed.d.ts +34 -10
- package/dist/types/dist-dereferenced/messages/order/return-initiated.d.ts +34 -10
- package/dist/types/dist-dereferenced/messages/order/returned.d.ts +34 -10
- package/dist/types/dist-dereferenced/messages/order/shipped.d.ts +34 -10
- package/dist/types/dist-dereferenced/order/customer.d.ts +3 -0
- package/dist/types/dist-dereferenced/order/index.d.ts +34 -10
- package/dist/types/dist-dereferenced/order/item.d.ts +6 -3
- package/dist/types/dist-dereferenced/order/orderMain.d.ts +34 -10
- package/dist/types/dist-dereferenced/order/payment.d.ts +16 -0
- package/dist/types/dist-dereferenced/order/shipment/pos/outbound.d.ts +0 -1
- package/dist/types/dist-dereferenced/order/shipment/pos/return.d.ts +0 -1
- package/dist/types/dist-types/messages/order/delivered.d.ts +13 -5
- package/dist/types/dist-types/messages/order/new.d.ts +13 -5
- package/dist/types/dist-types/messages/order/processed.d.ts +13 -5
- package/dist/types/dist-types/messages/order/return-initiated.d.ts +13 -5
- package/dist/types/dist-types/messages/order/returned.d.ts +13 -5
- package/dist/types/dist-types/messages/order/shipped.d.ts +13 -5
- package/dist/types/dist-types/order/customer.d.ts +1 -0
- package/dist/types/dist-types/order/item.d.ts +4 -3
- package/dist/types/dist-types/order/orderMain.d.ts +13 -5
- package/dist/types/dist-types/order/payment.d.ts +4 -0
- package/dist/types/src-public/bcOrder.d.ts +84 -0
- package/dist/types/src-public/dato.d.ts +1 -34
- package/dist/types/src-public/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Address",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"$id": "https://shushed.example.com/order/address.schema.json",
|
|
6
|
+
"description": "Represents a postal address for billing or shipping purposes.",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"address_id": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Internal address ID"
|
|
12
|
+
},
|
|
13
|
+
"sfcc_customer_id": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"sitoo_customer_id": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"bc_customer_id": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"centra_customer_id": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"is_default_billing": {
|
|
26
|
+
"type": "boolean"
|
|
27
|
+
},
|
|
28
|
+
"is_default_shipping": {
|
|
29
|
+
"type": "boolean"
|
|
30
|
+
},
|
|
31
|
+
"scv_household_id": {
|
|
32
|
+
"type": [
|
|
33
|
+
"string",
|
|
34
|
+
"null"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"is_last_used_shipping": {
|
|
38
|
+
"type": "boolean"
|
|
39
|
+
},
|
|
40
|
+
"is_retrieved_from_payment_method": {
|
|
41
|
+
"type": "boolean"
|
|
42
|
+
},
|
|
43
|
+
"opt_in_mail": {
|
|
44
|
+
"type": "boolean"
|
|
45
|
+
},
|
|
46
|
+
"company_name": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"maxLength": 30
|
|
49
|
+
},
|
|
50
|
+
"first_name": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"maxLength": 30,
|
|
53
|
+
"minLength": 1,
|
|
54
|
+
"faker": { "name.firstName": [] },
|
|
55
|
+
"description": "Recipient's first name."
|
|
56
|
+
},
|
|
57
|
+
"last_name": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"maxLength": 30,
|
|
60
|
+
"minLength": 1,
|
|
61
|
+
"faker": { "name.lastName": [] },
|
|
62
|
+
"description": "Recipient's last name."
|
|
63
|
+
},
|
|
64
|
+
"address1": {
|
|
65
|
+
"type": ["string"],
|
|
66
|
+
"minLength": 1,
|
|
67
|
+
"maxLength": 30,
|
|
68
|
+
"faker": { "address.streetAddress": [] },
|
|
69
|
+
"description": "Primary street address."
|
|
70
|
+
},
|
|
71
|
+
"address2": {
|
|
72
|
+
"type": ["string", "null"],
|
|
73
|
+
"maxLength": 30,
|
|
74
|
+
"faker": { "address.secondaryAddress": [] },
|
|
75
|
+
"description": "Additional address line (e.g., apartment or suite number)."
|
|
76
|
+
},
|
|
77
|
+
"city": {
|
|
78
|
+
"type": ["string"],
|
|
79
|
+
"maxLength": 30,
|
|
80
|
+
"minLength": 1,
|
|
81
|
+
"faker": { "address.city": [] },
|
|
82
|
+
"description": "City or locality of the address."
|
|
83
|
+
},
|
|
84
|
+
"post_code": {
|
|
85
|
+
"type": ["string", "null"],
|
|
86
|
+
"maxLength": 20,
|
|
87
|
+
"pattern": "^[A-Z0-9 ]*$",
|
|
88
|
+
"faker": { "address.zipCode": [] },
|
|
89
|
+
"description": "Postal code (uppercase letters and numbers with spaces; optional for countries without postal codes).",
|
|
90
|
+
"examples": ["SW1A 1AA", "90210", null]
|
|
91
|
+
},
|
|
92
|
+
"country_code": {
|
|
93
|
+
"$ref": "https://shushed.example.com/country.schema.json",
|
|
94
|
+
"faker": {
|
|
95
|
+
"helpers.arrayElement": ["GB", "US", "IR"]
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"phone": {
|
|
99
|
+
"type": ["string", "null"],
|
|
100
|
+
"maxLength": 30,
|
|
101
|
+
"faker": { "phone.phone.number": [] },
|
|
102
|
+
"description": "Phone number associated with the address."
|
|
103
|
+
},
|
|
104
|
+
"click_collect_id": {
|
|
105
|
+
"type": [
|
|
106
|
+
"string",
|
|
107
|
+
"null"
|
|
108
|
+
],
|
|
109
|
+
"description": "Click & Collect reference if applicable"
|
|
110
|
+
},
|
|
111
|
+
"created_at": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"format": "date-time"
|
|
114
|
+
},
|
|
115
|
+
"last_modified_at": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"format": "date-time"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"required": [
|
|
121
|
+
"first_name",
|
|
122
|
+
"last_name",
|
|
123
|
+
"address1",
|
|
124
|
+
"city",
|
|
125
|
+
"country_code"
|
|
126
|
+
]
|
|
127
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Customer",
|
|
4
|
+
"$id": "https://shushed.example.com/order/customer.schema.json",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"first_name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"maxLength": 30,
|
|
11
|
+
"description": "Customer first name - Example: Alice. Business Central field: First Name HU (ID 50054, Text[30])"
|
|
12
|
+
},
|
|
13
|
+
"last_name": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"maxLength": 30,
|
|
16
|
+
"description": "Customer last name - Example: Johnson. Business Central field: Last Name HU (ID 50056, Text[30])"
|
|
17
|
+
},
|
|
18
|
+
"sfcc_id": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "Salesforce Commerce Cloud customer identifier - Example: SFCC123456"
|
|
21
|
+
},
|
|
22
|
+
"bc_customer_id": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"maxLength": 20,
|
|
25
|
+
"description": "Business Central customer id - Example: CUST00012345"
|
|
26
|
+
},
|
|
27
|
+
"merged_bc_customer_ids": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": {
|
|
30
|
+
"type": "string"
|
|
31
|
+
},
|
|
32
|
+
"description": "Business Central customer ids that were result of merge",
|
|
33
|
+
"example": ["CUST00011111", "CUST00022222"]
|
|
34
|
+
},
|
|
35
|
+
"centra_id": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "Centra system customer ID"
|
|
38
|
+
},
|
|
39
|
+
"sitoo_id": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Sitoo POS system customer ID"
|
|
42
|
+
},
|
|
43
|
+
"scv_customer_id": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Single customer view customer id - Example: SCV123456789"
|
|
46
|
+
},
|
|
47
|
+
"addresses": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": { "$ref": "https://shushed.example.com/order/address.schema.json" },
|
|
50
|
+
"description": "Array of addresses related to the customer"
|
|
51
|
+
},
|
|
52
|
+
"default_shipping_address": {
|
|
53
|
+
"$ref": "https://shushed.example.com/order/address.schema.json",
|
|
54
|
+
"description": "Preferred shipping address"
|
|
55
|
+
},
|
|
56
|
+
"phone": {
|
|
57
|
+
"type": ["string", "null"],
|
|
58
|
+
"description": "Primary customer phone (root-level), may be null when unknown"
|
|
59
|
+
},
|
|
60
|
+
"email": {
|
|
61
|
+
"type": ["string", "null"],
|
|
62
|
+
"format": "email",
|
|
63
|
+
"description": "Normalized and lowercased email. Null if invalid.",
|
|
64
|
+
"example": "alice.johnson@example.com"
|
|
65
|
+
},
|
|
66
|
+
"opt_in_email": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"description": "Marketing email opt_in_email - Example: true"
|
|
69
|
+
},
|
|
70
|
+
"opt_in_phone": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"description": "Marketing phone (SMS) opt_in_phone - Example: false"
|
|
73
|
+
},
|
|
74
|
+
"opt_in_3rdparty": {
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"description": "Marketing 3rd party rentals opt_in_3rdparty - Example: true"
|
|
77
|
+
},
|
|
78
|
+
"segments": {
|
|
79
|
+
"type": "array",
|
|
80
|
+
"items": { "type": "string" },
|
|
81
|
+
"description": "Customer segmentation tags",
|
|
82
|
+
"example": ["VIP", "NewsletterSubscriber"]
|
|
83
|
+
},
|
|
84
|
+
"registered_at": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"format": "date-time",
|
|
87
|
+
"description": "Customer registration timestamp - Example: 2024-01-15T10:30:00Z"
|
|
88
|
+
},
|
|
89
|
+
"scv_first_purchase_at": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"format": "date-time",
|
|
92
|
+
"description": "Single customer view first purchase at - Example: 2024-03-20T14:00:00Z"
|
|
93
|
+
},
|
|
94
|
+
"scv_last_purchase_at": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"format": "date-time",
|
|
97
|
+
"description": "Single customer view last purchase at - Example: 2025-06-01T11:15:00Z"
|
|
98
|
+
},
|
|
99
|
+
"scv_linked_customer_ids": {
|
|
100
|
+
"type": "array",
|
|
101
|
+
"items": { "type": "string" },
|
|
102
|
+
"description": "Single customer view linked customer ids",
|
|
103
|
+
"example": ["SCV987654321", "SCV123987654"]
|
|
104
|
+
},
|
|
105
|
+
"scv_total_transactions": {
|
|
106
|
+
"type": "integer",
|
|
107
|
+
"minimum": 0,
|
|
108
|
+
"description": "Single customer view total number of transactions - Example: 42"
|
|
109
|
+
},
|
|
110
|
+
"scv_total_demand": {
|
|
111
|
+
"type": "integer",
|
|
112
|
+
"minimum": 0,
|
|
113
|
+
"description": "Single customer view total demand count - Example: 35"
|
|
114
|
+
},
|
|
115
|
+
"scv_total_demand_cost": {
|
|
116
|
+
"type": "number",
|
|
117
|
+
"minimum": 0,
|
|
118
|
+
"description": "Single customer view total cost of demand - Example: 15000.75"
|
|
119
|
+
},
|
|
120
|
+
"scv_total_returns": {
|
|
121
|
+
"type": "integer",
|
|
122
|
+
"minimum": 0,
|
|
123
|
+
"description": "Single customer view total number of returned items - Example: 3"
|
|
124
|
+
},
|
|
125
|
+
"scv_total_returns_cost": {
|
|
126
|
+
"type": "number",
|
|
127
|
+
"minimum": 0,
|
|
128
|
+
"description": "Single customer view total cost of returned items - Example: 1200.50"
|
|
129
|
+
},
|
|
130
|
+
"last_modified_by": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"description": "Indicates the source of the last modification. Example: 'Integrations'"
|
|
133
|
+
},
|
|
134
|
+
"is_deleted": {
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"description": "Soft delete marker for the customer. If true, the customer is considered deleted but their data remains stored."
|
|
137
|
+
},
|
|
138
|
+
"other_bc_ids": {
|
|
139
|
+
"type": "array",
|
|
140
|
+
"items": {
|
|
141
|
+
"type": "string"
|
|
142
|
+
},
|
|
143
|
+
"description": "IDs of customer records in BC that share this customer's email"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"required": [
|
|
147
|
+
"email"
|
|
148
|
+
]
|
|
149
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.OrderShipment = exports.OrderPayment = exports.OrderItem = exports.OrderCustomer = exports.OrderAddress = void 0;
|
|
21
|
+
var address_schema_json_1 = require("./address.schema.json");
|
|
22
|
+
Object.defineProperty(exports, "OrderAddress", { enumerable: true, get: function () { return __importDefault(address_schema_json_1).default; } });
|
|
23
|
+
var customer_schema_json_1 = require("./customer.schema.json");
|
|
24
|
+
Object.defineProperty(exports, "OrderCustomer", { enumerable: true, get: function () { return __importDefault(customer_schema_json_1).default; } });
|
|
25
|
+
var item_schema_json_1 = require("./item.schema.json");
|
|
26
|
+
Object.defineProperty(exports, "OrderItem", { enumerable: true, get: function () { return __importDefault(item_schema_json_1).default; } });
|
|
27
|
+
var payment_schema_json_1 = require("./payment.schema.json");
|
|
28
|
+
Object.defineProperty(exports, "OrderPayment", { enumerable: true, get: function () { return __importDefault(payment_schema_json_1).default; } });
|
|
29
|
+
var shipment_schema_json_1 = require("./shipment.schema.json");
|
|
30
|
+
Object.defineProperty(exports, "OrderShipment", { enumerable: true, get: function () { return __importDefault(shipment_schema_json_1).default; } });
|
|
31
|
+
__exportStar(require("./shipment"), exports);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Item",
|
|
4
|
+
"$id": "https://shushed.example.com/order/item.schema.json",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"description": "Represents a single purchasable item in an order, including style, quantity, pricing, and applicable discounts.",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "https://shushed.example.com/total.schema.json"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"sku": {
|
|
15
|
+
"type": ["string"],
|
|
16
|
+
"faker": { "custom.sku": [] },
|
|
17
|
+
"description": "Stock Keeping Unit identifier for the item.Combination of style code and colour code and "
|
|
18
|
+
},
|
|
19
|
+
"linked_style_id": {
|
|
20
|
+
"type": ["string", "null"],
|
|
21
|
+
"faker": { "custom.style": [] },
|
|
22
|
+
"description": "Style ID of the parent item if this is a variation."
|
|
23
|
+
},
|
|
24
|
+
"colour_id": {
|
|
25
|
+
"type": ["string", "null"],
|
|
26
|
+
"faker": { "custom.color": [] },
|
|
27
|
+
"description": "Code from Object Colorway - Example: 3203, null if not applicable (e.g., non-product items like NEWSLETTER)"
|
|
28
|
+
},
|
|
29
|
+
"style_id": {
|
|
30
|
+
"type": ["string", "null"],
|
|
31
|
+
"faker": { "custom.style": [] },
|
|
32
|
+
"description": "Code from Object style - Example: 000697, null if not applicable (e.g., non-product items like NEWSLETTER)"
|
|
33
|
+
},
|
|
34
|
+
"product_id": {
|
|
35
|
+
"type": ["string", "null"],
|
|
36
|
+
"description": "Code from Object style and colour - Example: 000697-3203"
|
|
37
|
+
},
|
|
38
|
+
"colour_name": {
|
|
39
|
+
"type": ["string"],
|
|
40
|
+
"faker": { "color.human": [] },
|
|
41
|
+
"description": "Node Name from Object Colorway - Example: Toffee Brown"
|
|
42
|
+
},
|
|
43
|
+
"size_name": {
|
|
44
|
+
"type": ["string"],
|
|
45
|
+
"faker": { "custom.size": [] },
|
|
46
|
+
"description": "HS_ColorwayAttr_SizeRangeNodeName from Object ColorwayAttributes - Example: 10-16"
|
|
47
|
+
},
|
|
48
|
+
"preorder_date": {
|
|
49
|
+
"type": ["string", "null"],
|
|
50
|
+
"format": "date",
|
|
51
|
+
"description": "Expected availability date if the item is on preorder."
|
|
52
|
+
},
|
|
53
|
+
"quantity": {
|
|
54
|
+
"type": ["integer"],
|
|
55
|
+
"minimum": 0,
|
|
56
|
+
"faker": { "minimum": 0, "maximum": 10 },
|
|
57
|
+
"description": "Number of units ordered. Represented as integer."
|
|
58
|
+
},
|
|
59
|
+
"unit_price_status": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"enum": ["rrp", "perm", "pos"],
|
|
62
|
+
"description": "Pricing status: rrp (Full Price), perm (Markdown), pos (Promotional)."
|
|
63
|
+
},
|
|
64
|
+
"returned_quantity": {
|
|
65
|
+
"type": ["integer"],
|
|
66
|
+
"minimum": 0,
|
|
67
|
+
"faker": { "maximum": 1 },
|
|
68
|
+
"description": "Number of units returned. Represented as integer."
|
|
69
|
+
},
|
|
70
|
+
"unit_price_net": {
|
|
71
|
+
"$ref": "https://shushed.example.com/money.schema.json",
|
|
72
|
+
"description": "Net unit price before tax. Represented as integer."
|
|
73
|
+
},
|
|
74
|
+
"unit_price_gross": {
|
|
75
|
+
"$ref": "https://shushed.example.com/money.schema.json",
|
|
76
|
+
"description": "Gross unit price in smallest currency unit. Represented as integer."
|
|
77
|
+
},
|
|
78
|
+
"discount_code": {
|
|
79
|
+
"type": ["string", "null"],
|
|
80
|
+
"faker": { "format": "uuid" },
|
|
81
|
+
"description": "Code applied to trigger a discount, if any."
|
|
82
|
+
},
|
|
83
|
+
"cost_net": {
|
|
84
|
+
"$ref": "https://shushed.example.com/money.schema.json"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"required": [
|
|
88
|
+
"sku",
|
|
89
|
+
"colour_id",
|
|
90
|
+
"style_id",
|
|
91
|
+
"quantity",
|
|
92
|
+
"unit_price_net",
|
|
93
|
+
"unit_price_gross",
|
|
94
|
+
"unit_price_status"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Payment",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"$id": "https://shushed.example.com/order/payment.schema.json",
|
|
6
|
+
"description": "Details of a payment or refund transaction, including amount, method, and status.",
|
|
7
|
+
"additionalProperties": true,
|
|
8
|
+
"properties": {
|
|
9
|
+
"type": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"enum": ["REFUND", "CHARGE"],
|
|
12
|
+
"description": "Indicates whether the transaction is a customer charge or a refund."
|
|
13
|
+
},
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"created_at": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "date-time",
|
|
18
|
+
"faker": {
|
|
19
|
+
"date.between": ["2024-01-01T00:00:00.000Z", "2025-04-30T00:00:00.000Z"]
|
|
20
|
+
},
|
|
21
|
+
"description": "Timestamp when the payment was placed (ISO 8601).",
|
|
22
|
+
"example": "2024-07-09T14:30:00Z",
|
|
23
|
+
"nullable": true
|
|
24
|
+
},
|
|
25
|
+
"payment_method": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": [
|
|
28
|
+
"MOTO",
|
|
29
|
+
"CREDIT-CARD",
|
|
30
|
+
"GIFT-CARD",
|
|
31
|
+
"PAYPAL",
|
|
32
|
+
"APPLE-PAY",
|
|
33
|
+
"OTHER"
|
|
34
|
+
],
|
|
35
|
+
"description": "The method used for the transaction."
|
|
36
|
+
},
|
|
37
|
+
"transaction_id": {
|
|
38
|
+
"type": ["string"],
|
|
39
|
+
"faker": { "custom.documentid": ["TR", 10] },
|
|
40
|
+
"description": "Internal transaction reference ID."
|
|
41
|
+
},
|
|
42
|
+
"card_number": {
|
|
43
|
+
"type": ["string", "null"],
|
|
44
|
+
"faker": { "finance.creditCardNumber": [] },
|
|
45
|
+
"description": "Masked card number used for payment, if applicable."
|
|
46
|
+
},
|
|
47
|
+
"card_holder": {
|
|
48
|
+
"type": ["string", "null"],
|
|
49
|
+
"description": "Name on the card. Examples: '' (empty for test), 'John Doe' (real-world)"
|
|
50
|
+
},
|
|
51
|
+
"card_token": {
|
|
52
|
+
"type": ["string", "null"],
|
|
53
|
+
"description": "Token representing the card. Examples: '' (empty for test), 'tok_1234567890' (real-world)"
|
|
54
|
+
},
|
|
55
|
+
"expiration_month": {
|
|
56
|
+
"type": ["integer", "null"],
|
|
57
|
+
"minimum": 1,
|
|
58
|
+
"maximum": 12,
|
|
59
|
+
"description": "Card expiration month. Null indicates empty for test purpose. Real-world example: 10."
|
|
60
|
+
},
|
|
61
|
+
"expiration_year": {
|
|
62
|
+
"type": ["integer", "null"],
|
|
63
|
+
"minimum": 2023,
|
|
64
|
+
"maximum": 2085,
|
|
65
|
+
"description": "Card expiration year. Null indicates empty for test purpose. Real-world example: 2026."
|
|
66
|
+
},
|
|
67
|
+
"journey_label": {
|
|
68
|
+
"type": ["string"],
|
|
69
|
+
"enum": ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM"],
|
|
70
|
+
"description": "Channel through which the payment was initiated."
|
|
71
|
+
},
|
|
72
|
+
"psp_reference": {
|
|
73
|
+
"type": ["string"],
|
|
74
|
+
"faker": { "custom.documentid": ["PSP", 10] },
|
|
75
|
+
"description": "Reference provided by the Payment Service Provider (PSP)."
|
|
76
|
+
},
|
|
77
|
+
"card_brand": {
|
|
78
|
+
"type": ["string", "null"],
|
|
79
|
+
"faker": { "finance.creditCardIssuer": [] },
|
|
80
|
+
"description": "Brand of the card used (e.g., Visa, Mastercard), if applicable."
|
|
81
|
+
},
|
|
82
|
+
"status": {
|
|
83
|
+
"type": ["string"],
|
|
84
|
+
"enum": ["CAPTURED", "FAILED", "FAILED-3DS", "CANCELLED"],
|
|
85
|
+
"description": "Current status of the transaction."
|
|
86
|
+
},
|
|
87
|
+
"amount": {
|
|
88
|
+
"$ref": "https://shushed.example.com/money.schema.json",
|
|
89
|
+
"description": "Monetary value of the transaction."
|
|
90
|
+
},
|
|
91
|
+
"created_by": {
|
|
92
|
+
"anyOf": [
|
|
93
|
+
{
|
|
94
|
+
"type": "string",
|
|
95
|
+
"enum": ["CUSTOMER", "SYSTEM"]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"type": "string",
|
|
99
|
+
"format": "email"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"description": "Originator of the transaction: 'CUSTOMER', 'SYSTEM', or email address for refunds."
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"required": [
|
|
106
|
+
"created_at",
|
|
107
|
+
"payment_method",
|
|
108
|
+
"transaction_id",
|
|
109
|
+
"psp_reference",
|
|
110
|
+
"status",
|
|
111
|
+
"amount",
|
|
112
|
+
"created_by",
|
|
113
|
+
"journey_label"
|
|
114
|
+
]
|
|
115
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.OrderShipmentShipped = exports.OrderShipmentPOS = exports.OrderShipmentItem = void 0;
|
|
21
|
+
var item_schema_json_1 = require("./item.schema.json");
|
|
22
|
+
Object.defineProperty(exports, "OrderShipmentItem", { enumerable: true, get: function () { return __importDefault(item_schema_json_1).default; } });
|
|
23
|
+
var pos_schema_json_1 = require("./pos.schema.json");
|
|
24
|
+
Object.defineProperty(exports, "OrderShipmentPOS", { enumerable: true, get: function () { return __importDefault(pos_schema_json_1).default; } });
|
|
25
|
+
var shipped_schema_json_1 = require("./shipped.schema.json");
|
|
26
|
+
Object.defineProperty(exports, "OrderShipmentShipped", { enumerable: true, get: function () { return __importDefault(shipped_schema_json_1).default; } });
|
|
27
|
+
__exportStar(require("./item"), exports);
|
|
28
|
+
__exportStar(require("./pos"), exports);
|
|
29
|
+
__exportStar(require("./shipped"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
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.OrderShipmentItemReturned = void 0;
|
|
7
|
+
var returned_schema_json_1 = require("./returned.schema.json");
|
|
8
|
+
Object.defineProperty(exports, "OrderShipmentItemReturned", { enumerable: true, get: function () { return __importDefault(returned_schema_json_1).default; } });
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Order Shipment Item Returned",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"description": "Represents a returned item within a shipment, including the return reason and its code. Extends the basic shipment item schema.",
|
|
6
|
+
"$id": "https://shushed.example.com/order/shipment/item/returned.schema.json",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "https://shushed.example.com/order/shipment/item.schema.json"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"returnReasonCode": {
|
|
15
|
+
"type": ["string"],
|
|
16
|
+
"faker": { "custom.documentid": ["R", 2] },
|
|
17
|
+
"description": "Internal return reason code used for processing and analytics."
|
|
18
|
+
},
|
|
19
|
+
"returnReason": {
|
|
20
|
+
"type": ["string", "null"],
|
|
21
|
+
"faker": {
|
|
22
|
+
"helpers.arrayElement": [["Too Large", "Defect", "Not my colour"]]
|
|
23
|
+
},
|
|
24
|
+
"description": "Human-readable explanation for the return, such as defect or sizing issue."
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": ["returnReasonCode", "returnReason"]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Order Shipment Item",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"description": "Represents a single line item included in a shipment, typically corresponding to a specific product and quantity.",
|
|
6
|
+
"$id": "https://shushed.example.com/order/shipment/item.schema.json",
|
|
7
|
+
"properties": {
|
|
8
|
+
"lineNumber": {
|
|
9
|
+
"type": ["integer"],
|
|
10
|
+
"minimum": 0,
|
|
11
|
+
"faker": { "datatype.number": [1, 1] },
|
|
12
|
+
"description": "Line number of the item in the order. Used for item referencing and tracking."
|
|
13
|
+
},
|
|
14
|
+
"quantity": {
|
|
15
|
+
"type": ["integer"],
|
|
16
|
+
"minimum": 1,
|
|
17
|
+
"faker": { "datatype.number": [2, 1] },
|
|
18
|
+
"description": "The number of units of the item shipped."
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": ["lineNumber", "quantity"]
|
|
22
|
+
}
|
|
@@ -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.OrderShipmentPOSReturn = exports.OrderShipmentPOSOutbound = void 0;
|
|
7
|
+
var outbound_schema_json_1 = require("./outbound.schema.json");
|
|
8
|
+
Object.defineProperty(exports, "OrderShipmentPOSOutbound", { 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, "OrderShipmentPOSReturn", { enumerable: true, get: function () { return __importDefault(return_schema_json_1).default; } });
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Order Shipment POS Outbound",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"$id": "https://shushed.example.com/order/shipment/pos/outbound.schema.json",
|
|
6
|
+
"description": "Represents an outbound shipment from a Point of Sale (POS) location, fulfilled by a logistics partner like TORQUE or GLOBALE.",
|
|
7
|
+
"additionalProperties": false,
|
|
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-OUTBOUND"],
|
|
19
|
+
"description": "Shipment type indicating POS outbound fulfillment."
|
|
20
|
+
},
|
|
21
|
+
"shipped_by": {
|
|
22
|
+
"type": ["string"],
|
|
23
|
+
"enum": ["TORQUE", "GLOBALE"],
|
|
24
|
+
"description": "Logistics provider that fulfilled the POS outbound shipment."
|
|
25
|
+
},
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": {
|
|
29
|
+
"$ref": "https://shushed.example.com/order/shipment/item.schema.json"
|
|
30
|
+
},
|
|
31
|
+
"description": "List of items included in the POS outbound shipment."
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": ["type", "shipped_by", "items"]
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|