@shushed/helpers 0.0.292 → 0.0.294
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 +14 -2
- 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;
|
|
@@ -273,7 +273,16 @@ function transformMasterOrder(payload) {
|
|
|
273
273
|
const returnedRemainingBySku = { ...returnedTotalBySkuCapped };
|
|
274
274
|
const itemsList = [];
|
|
275
275
|
sourceLines
|
|
276
|
-
.filter((line) =>
|
|
276
|
+
.filter((line) => {
|
|
277
|
+
if (line.type !== "Item")
|
|
278
|
+
return false;
|
|
279
|
+
const itemNo = String(line?.item_no || line?.no || '');
|
|
280
|
+
const variantCode = String(line?.variant_code || '');
|
|
281
|
+
const upper = itemNo.toUpperCase().replace(/\s+/g, '');
|
|
282
|
+
if (upper.includes('DELCHR') || upper.startsWith('GFT') || upper.startsWith('VCH'))
|
|
283
|
+
return false;
|
|
284
|
+
return itemNo.includes('-') && variantCode.trim().length > 0;
|
|
285
|
+
})
|
|
277
286
|
.forEach((line) => {
|
|
278
287
|
const itemNo = line.no || "";
|
|
279
288
|
const variant = line.variant_code || "";
|
|
@@ -409,7 +418,10 @@ function transformMasterOrder(payload) {
|
|
|
409
418
|
const invoicedLineNos = new Set((payload.invoices || []).flatMap((inv) => (inv?.invoice_lines || []).map((l) => Number(l?.order_line_no || -1))));
|
|
410
419
|
const isDeliveryItem = (line) => {
|
|
411
420
|
const desc = String(line?.description || '').trim().toLowerCase();
|
|
412
|
-
|
|
421
|
+
if (desc === 'delivery')
|
|
422
|
+
return true;
|
|
423
|
+
const itemNo = String(line?.item_no || line?.no || '').toUpperCase().replace(/\s+/g, '');
|
|
424
|
+
return itemNo.includes('DELCHR');
|
|
413
425
|
};
|
|
414
426
|
let invoicesGrossMinor = 0;
|
|
415
427
|
(payload.invoices || []).forEach((inv) => {
|