@shushed/helpers 0.0.291 → 0.0.293
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 +2 -2
- package/dist/cjs/dist-dereferenced/asset.js +1 -1
- package/dist/cjs/dist-dereferenced/development-colour.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/product.js +1 -1
- package/dist/cjs/dist-dereferenced/product.js +1 -1
- package/dist/cjs/src-public/bcOrder.js +35 -47
- package/dist/types/dist-dereferenced/asset.d.ts +1 -1
- package/dist/types/dist-dereferenced/development-colour.d.ts +1 -1
- package/dist/types/dist-dereferenced/messages/product.d.ts +1 -1
- package/dist/types/dist-dereferenced/product.d.ts +1 -1
- package/package.json +1 -1
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
},
|
|
72
72
|
"file_name": {
|
|
73
73
|
"type": "string",
|
|
74
|
-
"pattern": "^[
|
|
75
|
-
"description": "The
|
|
74
|
+
"pattern": "^[A-Za-z0-9-_.]+$",
|
|
75
|
+
"description": "The filename of the asset. Upper/Lowercase, underscores, dashes, no spaces"
|
|
76
76
|
},
|
|
77
77
|
"is_product": {
|
|
78
78
|
"type": "boolean",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Asset", "type": "object", "additionalProperties": false, "properties": { "product_id": { "type": "string" }, "dash_id": { "type": "string" }, "md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" }, "dash_folder_path": { "type": "string" }, "source_url": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "width": { "type": "integer", "minimum": 0 }, "height": { "type": "integer", "minimum": 0 }, "meta": { "type": "object", "additionalProperties": true }, "content_type": { "type": "string", "pattern": "^[a-z0-9-/]+$" }, "file_name": { "type": "string", "pattern": "^[
|
|
3
|
+
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Asset", "type": "object", "additionalProperties": false, "properties": { "product_id": { "type": "string" }, "dash_id": { "type": "string" }, "md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" }, "dash_folder_path": { "type": "string" }, "source_url": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "width": { "type": "integer", "minimum": 0 }, "height": { "type": "integer", "minimum": 0 }, "meta": { "type": "object", "additionalProperties": true }, "content_type": { "type": "string", "pattern": "^[a-z0-9-/]+$" }, "file_name": { "type": "string", "pattern": "^[A-Za-z0-9-_.]+$" }, "is_product": { "type": "boolean" } }, "required": ["source_url", "content_type", "last_modified_at"], "$id": "https://shushed.example.com/asset.json" };
|
|
4
4
|
exports.default = schema;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Development Colour", "type": "object", "additionalProperties": false, "properties": { "colour_id": { "type": "string" }, "name": { "type": ["string", "null"] }, "rgb": { "anyOf": [{ "type": "null" }, { "type": "array", "items": { "type": "number" } }] }, "cmyk": { "anyOf": [{ "type": "null" }, { "type": "array", "items": { "type": "number" } }] }, "pantone": { "anyOf": [{ "type": "null" }, { "type": "object", "properties": { "name": { "type": "string" }, "system": { "type": "string", "pattern": "^[A-Z0-9-]+$" }, "id": { "type": "string", "pattern": "^[A-Z0-9-]+$" } } }] }, "display_name": { "type": ["string", "null"], "pattern": "^[ a-z-]+$" }, "family_display_name": { "type": ["string", "null"], "pattern": "^[ a-z]+$" }, "source_asset": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Asset", "type": "object", "additionalProperties": false, "properties": { "product_id": { "type": "string" }, "dash_id": { "type": "string" }, "md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" }, "dash_folder_path": { "type": "string" }, "source_url": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "width": { "type": "integer", "minimum": 0 }, "height": { "type": "integer", "minimum": 0 }, "meta": { "type": "object", "additionalProperties": true }, "content_type": { "type": "string", "pattern": "^[a-z0-9-/]+$" }, "file_name": { "type": "string", "pattern": "^[
|
|
3
|
+
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Development Colour", "type": "object", "additionalProperties": false, "properties": { "colour_id": { "type": "string" }, "name": { "type": ["string", "null"] }, "rgb": { "anyOf": [{ "type": "null" }, { "type": "array", "items": { "type": "number" } }] }, "cmyk": { "anyOf": [{ "type": "null" }, { "type": "array", "items": { "type": "number" } }] }, "pantone": { "anyOf": [{ "type": "null" }, { "type": "object", "properties": { "name": { "type": "string" }, "system": { "type": "string", "pattern": "^[A-Z0-9-]+$" }, "id": { "type": "string", "pattern": "^[A-Z0-9-]+$" } } }] }, "display_name": { "type": ["string", "null"], "pattern": "^[ a-z-]+$" }, "family_display_name": { "type": ["string", "null"], "pattern": "^[ a-z]+$" }, "source_asset": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Asset", "type": "object", "additionalProperties": false, "properties": { "product_id": { "type": "string" }, "dash_id": { "type": "string" }, "md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" }, "dash_folder_path": { "type": "string" }, "source_url": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "width": { "type": "integer", "minimum": 0 }, "height": { "type": "integer", "minimum": 0 }, "meta": { "type": "object", "additionalProperties": true }, "content_type": { "type": "string", "pattern": "^[a-z0-9-/]+$" }, "file_name": { "type": "string", "pattern": "^[A-Za-z0-9-_.]+$" }, "is_product": { "type": "boolean" } }, "required": ["source_url", "content_type", "last_modified_at"] } }, "required": ["colour_id"], "$id": "https://shushed.example.com/development-colour.schema.json" };
|
|
4
4
|
exports.default = schema;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ProductChange", "additionalProperties": false, "allOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Product", "additionalProperties": false, "type": "object", "properties": { "product_id": { "type": "string" }, "slug": { "type": ["string"] }, "style_id": { "type": ["string"] }, "colour_id": { "type": "string" }, "style_name": { "type": "string" }, "display_name": { "type": ["string"] }, "buffer_quantity": { "type": "integer", "minimum": 0 }, "display_type": { "type": "string", "enum": ["Out-of-stock", "Permanently-unavailable"] }, "available_to_sell_from": { "type": ["string", "null"], "format": "date" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "colour_family_name": { "type": "string" }, "colour_name": { "type": "string" }, "display_tags": { "type": "array", "items": { "type": "string" } }, "images": { "type": "array", "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Asset", "type": "object", "additionalProperties": false, "properties": { "product_id": { "type": "string" }, "dash_id": { "type": "string" }, "md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" }, "dash_folder_path": { "type": "string" }, "source_url": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "width": { "type": "integer", "minimum": 0 }, "height": { "type": "integer", "minimum": 0 }, "meta": { "type": "object", "additionalProperties": true }, "content_type": { "type": "string", "pattern": "^[a-z0-9-/]+$" }, "file_name": { "type": "string", "pattern": "^[
|
|
3
|
+
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ProductChange", "additionalProperties": false, "allOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Product", "additionalProperties": false, "type": "object", "properties": { "product_id": { "type": "string" }, "slug": { "type": ["string"] }, "style_id": { "type": ["string"] }, "colour_id": { "type": "string" }, "style_name": { "type": "string" }, "display_name": { "type": ["string"] }, "buffer_quantity": { "type": "integer", "minimum": 0 }, "display_type": { "type": "string", "enum": ["Out-of-stock", "Permanently-unavailable"] }, "available_to_sell_from": { "type": ["string", "null"], "format": "date" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "colour_family_name": { "type": "string" }, "colour_name": { "type": "string" }, "display_tags": { "type": "array", "items": { "type": "string" } }, "images": { "type": "array", "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Asset", "type": "object", "additionalProperties": false, "properties": { "product_id": { "type": "string" }, "dash_id": { "type": "string" }, "md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" }, "dash_folder_path": { "type": "string" }, "source_url": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "width": { "type": "integer", "minimum": 0 }, "height": { "type": "integer", "minimum": 0 }, "meta": { "type": "object", "additionalProperties": true }, "content_type": { "type": "string", "pattern": "^[a-z0-9-/]+$" }, "file_name": { "type": "string", "pattern": "^[A-Za-z0-9-_.]+$" }, "is_product": { "type": "boolean" } }, "required": ["source_url", "content_type", "last_modified_at"] } }, "sizerange_code": { "type": "string" }, "variants": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "name": { "type": ["string"] }, "ean": { "type": ["string", "null"] } }, "required": ["code", "name"] } }, "vat_rate_uk": { "type": ["number", "null"], "minimum": 0 }, "supply_chain": { "type": "object", "properties": { "hs_code_us": { "type": ["string", "null"] }, "hs_code_uk": { "type": ["string", "null"] }, "mid_code": { "type": ["string", "null"] }, "country_of_origin": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Country", "type": "string", "enum": ["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CD", "CG", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "UM", "US", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"] }, "port_of_origin": { "type": "string" }, "packing_method": { "type": ["string", "null"], "enum": ["Standard", "Hanging"] }, "is_bought_in_product": { "type": "boolean" } }, "required": [] }, "merch": { "type": "object", "properties": { "strategy_type": { "type": "string" }, "category": { "type": "string" }, "subcategory": { "type": "string" }, "seasons": { "type": ["array"], "items": { "type": "string" } }, "drops": { "type": ["array"], "items": { "type": "string" } }, "complete_the_look": { "type": ["array"], "items": { "type": "string" } } }, "required": [] }, "principal_category": { "type": ["string", "null"] }, "category_assignments": { "type": "array", "items": { "type": "object", "properties": { "display_path": { "type": "array", "items": { "type": "string" } }, "path": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "id": { "type": "string" } } } }, "attributes": { "type": "object", "properties": { "price": { "type": ["number", "null"] }, "rrp": { "type": ["number", "null"] }, "stock_quantity_score": { "type": "number" }, "stock_availability": { "type": "number" }, "measurement_chart": { "type": ["string", "null"] }, "markdown_price": { "type": ["number", "null"] }, "cost_price": { "type": ["number", "null"] }, "sizeguide_type": { "type": ["string", "null"] }, "brand": { "type": ["string", "null"] }, "shoes_type": { "type": ["string", "null"] }, "seo_url_name": { "type": "string", "pattern": "^[a-z0-9-]+$" }, "seo_title": { "type": ["string", "null"] }, "seo_description": { "type": ["string", "null"] }, "fit_description": { "type": ["string", "null"] }, "fabric_care": { "type": ["string", "null"] }, "weight": { "type": ["number", "null"] }, "average_weight": { "type": ["number", "null"] }, "main_fibre": { "type": ["string", "null"] }, "main_metal": { "type": ["string", "null"] }, "designer": { "type": ["string", "null"] }, "certificate_code": { "type": ["string", "null"] }, "pattern_name": { "type": ["string", "null"] }, "fit_type": { "type": ["string", "null"] }, "trousers_fit": { "type": ["string", "null"], "nullable": true }, "trousers_length": { "type": ["string", "null"] }, "dresses_skirts_length": { "type": ["string", "null"] }, "coats_jackets_type": { "type": ["string", "null"] }, "dresses_skirts_type": { "type": ["string", "null"] }, "bag_type": { "type": ["string", "null"] }, "product_category": { "type": ["string", "null"] }, "product_type": { "type": ["string", "null"] }, "metal": { "type": ["string", "null"] }, "care_instructions": { "type": "array", "items": { "type": "string" } }, "sleeve_length": { "type": ["string", "null"] }, "heel_height": { "type": ["string", "null"] }, "occasion": { "type": ["string", "null"] }, "has_quantity_on_po": { "type": ["boolean", "null"] } }, "required": [] }, "markets": { "type": "array", "items": { "type": "string" } }, "markets_overrides": { "type": "object", "additionalProperties": false, "patternProperties": { ".*": { "type": "object", "additionalProperties": false, "properties": { "locale": { "type": "string", "pattern": "^[a-z]{2}-[A-Z]{2}$" }, "market": { "type": "string" }, "slug": { "$ref": "#/allOf/0/properties/slug" }, "style_name": { "$ref": "#/allOf/0/properties/style_name" }, "display_name": { "$ref": "#/allOf/0/properties/display_name" }, "display_type": { "$ref": "#/allOf/0/properties/display_type" }, "available_to_sell_from": { "$ref": "#/allOf/0/properties/available_to_sell_from" }, "colour_family_name": { "$ref": "#/allOf/0/properties/colour_family_name" }, "colour_name": { "$ref": "#/allOf/0/properties/colour_name" }, "display_tags": { "$ref": "#/allOf/0/properties/display_tags" }, "last_online_at": { "type": ["string", "null"], "format": "date-time" }, "variants": { "type": "array", "items": { "type": "object", "properties": { "code": { "$ref": "#/allOf/0/properties/variants/items/properties/code" }, "name": { "$ref": "#/allOf/0/properties/variants/items/properties/name" } }, "required": ["code", "name"] } }, "attributes": { "$ref": "#/allOf/0/properties/attributes" } }, "required": ["locale", "market"] } } } }, "required": ["product_id", "style_id", "colour_id", "display_name"] }, { "type": "object", "additionalProperties": false, "required": ["product_id", "style_id", "variants", "images", "attributes", "created_at", "last_modified_at", "colour_family_name"] }], "$id": "https://shushed.example.com/messages/product-change.schema.json" };
|
|
4
4
|
exports.default = schema;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Product", "additionalProperties": false, "type": "object", "properties": { "product_id": { "type": "string" }, "slug": { "type": ["string"] }, "style_id": { "type": ["string"] }, "colour_id": { "type": "string" }, "style_name": { "type": "string" }, "display_name": { "type": ["string"] }, "buffer_quantity": { "type": "integer", "minimum": 0 }, "display_type": { "type": "string", "enum": ["Out-of-stock", "Permanently-unavailable"] }, "available_to_sell_from": { "type": ["string", "null"], "format": "date" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "colour_family_name": { "type": "string" }, "colour_name": { "type": "string" }, "display_tags": { "type": "array", "items": { "type": "string" } }, "images": { "type": "array", "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Asset", "type": "object", "additionalProperties": false, "properties": { "product_id": { "type": "string" }, "dash_id": { "type": "string" }, "md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" }, "dash_folder_path": { "type": "string" }, "source_url": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "width": { "type": "integer", "minimum": 0 }, "height": { "type": "integer", "minimum": 0 }, "meta": { "type": "object", "additionalProperties": true }, "content_type": { "type": "string", "pattern": "^[a-z0-9-/]+$" }, "file_name": { "type": "string", "pattern": "^[
|
|
3
|
+
const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Product", "additionalProperties": false, "type": "object", "properties": { "product_id": { "type": "string" }, "slug": { "type": ["string"] }, "style_id": { "type": ["string"] }, "colour_id": { "type": "string" }, "style_name": { "type": "string" }, "display_name": { "type": ["string"] }, "buffer_quantity": { "type": "integer", "minimum": 0 }, "display_type": { "type": "string", "enum": ["Out-of-stock", "Permanently-unavailable"] }, "available_to_sell_from": { "type": ["string", "null"], "format": "date" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "colour_family_name": { "type": "string" }, "colour_name": { "type": "string" }, "display_tags": { "type": "array", "items": { "type": "string" } }, "images": { "type": "array", "items": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Asset", "type": "object", "additionalProperties": false, "properties": { "product_id": { "type": "string" }, "dash_id": { "type": "string" }, "md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" }, "dash_folder_path": { "type": "string" }, "source_url": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" }, "width": { "type": "integer", "minimum": 0 }, "height": { "type": "integer", "minimum": 0 }, "meta": { "type": "object", "additionalProperties": true }, "content_type": { "type": "string", "pattern": "^[a-z0-9-/]+$" }, "file_name": { "type": "string", "pattern": "^[A-Za-z0-9-_.]+$" }, "is_product": { "type": "boolean" } }, "required": ["source_url", "content_type", "last_modified_at"] } }, "sizerange_code": { "type": "string" }, "variants": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "name": { "type": ["string"] }, "ean": { "type": ["string", "null"] } }, "required": ["code", "name"] } }, "vat_rate_uk": { "type": ["number", "null"], "minimum": 0 }, "supply_chain": { "type": "object", "properties": { "hs_code_us": { "type": ["string", "null"] }, "hs_code_uk": { "type": ["string", "null"] }, "mid_code": { "type": ["string", "null"] }, "country_of_origin": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Country", "type": "string", "enum": ["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CD", "CG", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "UM", "US", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"] }, "port_of_origin": { "type": "string" }, "packing_method": { "type": ["string", "null"], "enum": ["Standard", "Hanging"] }, "is_bought_in_product": { "type": "boolean" } }, "required": [] }, "merch": { "type": "object", "properties": { "strategy_type": { "type": "string" }, "category": { "type": "string" }, "subcategory": { "type": "string" }, "seasons": { "type": ["array"], "items": { "type": "string" } }, "drops": { "type": ["array"], "items": { "type": "string" } }, "complete_the_look": { "type": ["array"], "items": { "type": "string" } } }, "required": [] }, "principal_category": { "type": ["string", "null"] }, "category_assignments": { "type": "array", "items": { "type": "object", "properties": { "display_path": { "type": "array", "items": { "type": "string" } }, "path": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "id": { "type": "string" } } } }, "attributes": { "type": "object", "properties": { "price": { "type": ["number", "null"] }, "rrp": { "type": ["number", "null"] }, "stock_quantity_score": { "type": "number" }, "stock_availability": { "type": "number" }, "measurement_chart": { "type": ["string", "null"] }, "markdown_price": { "type": ["number", "null"] }, "cost_price": { "type": ["number", "null"] }, "sizeguide_type": { "type": ["string", "null"] }, "brand": { "type": ["string", "null"] }, "shoes_type": { "type": ["string", "null"] }, "seo_url_name": { "type": "string", "pattern": "^[a-z0-9-]+$" }, "seo_title": { "type": ["string", "null"] }, "seo_description": { "type": ["string", "null"] }, "fit_description": { "type": ["string", "null"] }, "fabric_care": { "type": ["string", "null"] }, "weight": { "type": ["number", "null"] }, "average_weight": { "type": ["number", "null"] }, "main_fibre": { "type": ["string", "null"] }, "main_metal": { "type": ["string", "null"] }, "designer": { "type": ["string", "null"] }, "certificate_code": { "type": ["string", "null"] }, "pattern_name": { "type": ["string", "null"] }, "fit_type": { "type": ["string", "null"] }, "trousers_fit": { "type": ["string", "null"], "nullable": true }, "trousers_length": { "type": ["string", "null"] }, "dresses_skirts_length": { "type": ["string", "null"] }, "coats_jackets_type": { "type": ["string", "null"] }, "dresses_skirts_type": { "type": ["string", "null"] }, "bag_type": { "type": ["string", "null"] }, "product_category": { "type": ["string", "null"] }, "product_type": { "type": ["string", "null"] }, "metal": { "type": ["string", "null"] }, "care_instructions": { "type": "array", "items": { "type": "string" } }, "sleeve_length": { "type": ["string", "null"] }, "heel_height": { "type": ["string", "null"] }, "occasion": { "type": ["string", "null"] }, "has_quantity_on_po": { "type": ["boolean", "null"] } }, "required": [] }, "markets": { "type": "array", "items": { "type": "string" } }, "markets_overrides": { "type": "object", "additionalProperties": false, "patternProperties": { ".*": { "type": "object", "additionalProperties": false, "properties": { "locale": { "type": "string", "pattern": "^[a-z]{2}-[A-Z]{2}$" }, "market": { "type": "string" }, "slug": { "$ref": "#/properties/slug" }, "style_name": { "$ref": "#/properties/style_name" }, "display_name": { "$ref": "#/properties/display_name" }, "display_type": { "$ref": "#/properties/display_type" }, "available_to_sell_from": { "$ref": "#/properties/available_to_sell_from" }, "colour_family_name": { "$ref": "#/properties/colour_family_name" }, "colour_name": { "$ref": "#/properties/colour_name" }, "display_tags": { "$ref": "#/properties/display_tags" }, "last_online_at": { "type": ["string", "null"], "format": "date-time" }, "variants": { "type": "array", "items": { "type": "object", "properties": { "code": { "$ref": "#/properties/variants/items/properties/code" }, "name": { "$ref": "#/properties/variants/items/properties/name" } }, "required": ["code", "name"] } }, "attributes": { "$ref": "#/properties/attributes" } }, "required": ["locale", "market"] } } } }, "required": ["product_id", "style_id", "colour_id", "display_name"], "$id": "https://shushed.example.com/product.schema.json" };
|
|
4
4
|
exports.default = schema;
|
|
@@ -938,60 +938,48 @@ function transformMasterOrder(payload) {
|
|
|
938
938
|
const flat = [...cardPays, ...normalPays];
|
|
939
939
|
const groupsMap = new Map();
|
|
940
940
|
flat.forEach((p) => {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
941
|
+
const isRefund = String(p.type || '').toLowerCase() === 'refund';
|
|
942
|
+
const logicalType = isRefund ? 'REFUND' : 'CHARGE';
|
|
943
|
+
let keyBase;
|
|
944
|
+
const unifiedId = p.transaction_id || p.payment_gateway_token;
|
|
945
|
+
if (unifiedId) {
|
|
946
|
+
keyBase = unifiedId;
|
|
947
|
+
}
|
|
948
|
+
else if (p.payment_number) {
|
|
949
|
+
keyBase = `PN:${p.payment_number}`;
|
|
950
|
+
}
|
|
951
|
+
else if (!isRefund) {
|
|
952
|
+
const paymentType = String(p.type || '').toUpperCase();
|
|
953
|
+
const amount = Number(p.amount || 0);
|
|
954
|
+
const paymentMethod = String(p.payment_method_code || '').toUpperCase().trim();
|
|
955
|
+
const orderNo = p.order_no || erp_order_id;
|
|
956
|
+
if (paymentType === 'CAPTURE' || paymentType === 'AUTHORISATION') {
|
|
957
|
+
keyBase = `CHARGE-${orderNo}-${amount}-${paymentMethod}`;
|
|
948
958
|
}
|
|
949
|
-
else if (p.
|
|
950
|
-
keyBase = `
|
|
959
|
+
else if (p.gift_certificate_id) {
|
|
960
|
+
keyBase = `GIFT:${p.gift_certificate_id}`;
|
|
951
961
|
}
|
|
952
|
-
else
|
|
953
|
-
const paymentType = String(p.type || '').toUpperCase();
|
|
954
|
-
const amount = Number(p.amount || 0);
|
|
955
|
-
const paymentMethod = String(p.payment_method_code || '').toUpperCase().trim();
|
|
962
|
+
else {
|
|
956
963
|
const orderNo = p.order_no || erp_order_id;
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
const orderNo = p.order_no || erp_order_id;
|
|
965
|
-
const paymentMethod = String(p.payment_method_code || '').toUpperCase().trim();
|
|
966
|
-
keyBase = `${orderNo}-${amount}-${paymentMethod}`;
|
|
967
|
-
}
|
|
964
|
+
const paymentMethod = String(p.payment_method_code || '').toUpperCase().trim();
|
|
965
|
+
keyBase = `${orderNo}-${amount}-${paymentMethod}`;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
else {
|
|
969
|
+
if (p.payment_refund_number) {
|
|
970
|
+
keyBase = `PRN:${p.payment_refund_number}`;
|
|
968
971
|
}
|
|
969
972
|
else {
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
const orderNo = p.order_no || erp_order_id;
|
|
975
|
-
const amount = Number(p.amount || 0);
|
|
976
|
-
const paymentMethod = String(p.payment_method_code || '').toUpperCase().trim();
|
|
977
|
-
keyBase = `${orderNo}-${amount}-${paymentMethod}`;
|
|
978
|
-
}
|
|
973
|
+
const orderNo = p.order_no || erp_order_id;
|
|
974
|
+
const amount = Number(p.amount || 0);
|
|
975
|
+
const paymentMethod = String(p.payment_method_code || '').toUpperCase().trim();
|
|
976
|
+
keyBase = `${orderNo}-${amount}-${paymentMethod}`;
|
|
979
977
|
}
|
|
980
|
-
const key = `${logicalType}:${keyBase}`;
|
|
981
|
-
const g = groupsMap.get(key) || { entries: [], type: logicalType, key };
|
|
982
|
-
g.entries.push(p);
|
|
983
|
-
groupsMap.set(key, g);
|
|
984
|
-
}
|
|
985
|
-
catch (error) {
|
|
986
|
-
console.error(`Error processing payment entry:`, {
|
|
987
|
-
error: error instanceof Error ? error.message : String(error),
|
|
988
|
-
payment_type: p?.type,
|
|
989
|
-
amount: p?.amount,
|
|
990
|
-
order_no: p?.order_no || erp_order_id,
|
|
991
|
-
transaction_id: p?.transaction_id,
|
|
992
|
-
payment_gateway_token: p?.payment_gateway_token,
|
|
993
|
-
});
|
|
994
978
|
}
|
|
979
|
+
const key = `${logicalType}:${keyBase}`;
|
|
980
|
+
const g = groupsMap.get(key) || { entries: [], type: logicalType, key };
|
|
981
|
+
g.entries.push(p);
|
|
982
|
+
groupsMap.set(key, g);
|
|
995
983
|
});
|
|
996
984
|
const allPaymentEntriesByOrder = new Map();
|
|
997
985
|
flat.forEach(p => {
|