@shushed/helpers 0.0.226 → 0.0.227-main-20260107085003

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/cjs/contracts/index.js +1 -5
  2. package/dist/cjs/contracts/product-draft.schema.json +5 -159
  3. package/dist/cjs/dist-dereferenced/index.js +1 -5
  4. package/dist/cjs/dist-dereferenced/messages/product-draft.js +1 -1
  5. package/dist/cjs/dist-dereferenced/product-draft.js +1 -1
  6. package/dist/cjs/src-public/airtable.js +59 -96
  7. package/dist/cjs/src-public/bcOrder.js +77 -60
  8. package/dist/cjs/src-public/centra.js +5 -56
  9. package/dist/cjs/src-public/env.js +1 -1
  10. package/dist/cjs/src-public/index.js +1 -3
  11. package/dist/cjs/src-public/pubsub.js +10 -35
  12. package/dist/cjs/src-public/runtime.js +9 -48
  13. package/dist/cjs/src-public/utils.js +0 -3
  14. package/dist/package.json +2 -3
  15. package/dist/types/contracts/index.d.ts +0 -2
  16. package/dist/types/dist-dereferenced/index.d.ts +0 -2
  17. package/dist/types/dist-dereferenced/messages/product-draft.d.ts +1 -148
  18. package/dist/types/dist-dereferenced/product-draft.d.ts +1 -148
  19. package/dist/types/dist-types/index.d.ts +0 -2
  20. package/dist/types/dist-types/messages/product-draft.d.ts +4 -23
  21. package/dist/types/dist-types/product-draft.d.ts +4 -23
  22. package/dist/types/src-public/airtable.d.ts +9 -0
  23. package/dist/types/src-public/centra.d.ts +0 -3
  24. package/dist/types/src-public/env.d.ts +1 -1
  25. package/dist/types/src-public/index.d.ts +0 -1
  26. package/dist/types/src-public/pubsub.d.ts +1 -4
  27. package/dist/types/src-public/runtime.d.ts +4 -17
  28. package/dist/types/src-public/types.d.ts +0 -6
  29. package/dist/types/src-public/utils.d.ts +1 -1
  30. package/package.json +3 -4
  31. package/dist/cjs/contracts/purchase-orderline.schema.json +0 -135
  32. package/dist/cjs/contracts/stock-movement.schema.json +0 -144
  33. package/dist/cjs/dist-dereferenced/purchase-orderline.js +0 -4
  34. package/dist/cjs/dist-dereferenced/stock-movement.js +0 -4
  35. package/dist/cjs/dist-types/purchase-orderline.js +0 -2
  36. package/dist/cjs/dist-types/stock-movement.js +0 -2
  37. package/dist/cjs/src-public/sitoo.js +0 -349
  38. package/dist/types/dist-dereferenced/purchase-orderline.d.ts +0 -114
  39. package/dist/types/dist-dereferenced/stock-movement.d.ts +0 -110
  40. package/dist/types/dist-types/purchase-orderline.d.ts +0 -31
  41. package/dist/types/dist-types/stock-movement.d.ts +0 -30
  42. package/dist/types/src-public/sitoo.d.ts +0 -254
@@ -2,39 +2,26 @@ export type Currency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" |
2
2
  export type LCYCurrency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
3
3
  export type Country = ("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");
4
4
  export interface __MainSchema {
5
- development_colourway_id?: string;
6
- development_style_id?: string;
7
- centric_id?: string;
8
- style_centric_id?: string;
5
+ development_colourway_id: string;
6
+ development_style_id: string;
9
7
  product_id: string;
10
- created_at?: string;
11
- erp_settings?: (string | null);
12
- erp_created_at?: (string | null);
13
- erp_export_settings?: ("Exportable to Website" | "Exportable to Next" | "Available to sell")[];
8
+ created_at: string;
14
9
  is_colourway_approved?: boolean;
15
10
  product_name?: (string | null);
16
- erp_name?: (string | null);
17
11
  colour_id: string;
18
12
  colour_label?: (string | null);
19
13
  style_id: string;
20
- season_id?: string;
14
+ season_id: string;
21
15
  size_curves?: {
22
16
  channel?: string;
23
17
  name?: string;
24
18
  [k: string]: unknown;
25
19
  }[];
26
20
  plm_buying_quantities?: BuyingQuantitiesChannel[];
27
- store_grade?: (string | null);
28
21
  drops?: DropChannel[];
29
- direct_stock_buffer?: (number | null);
30
- qa_completed?: (boolean | null);
31
- warehouse_instructions?: (string | null);
32
- available_to_sell_from?: (string | null);
33
- processing_time_warehouse?: (number | null);
34
22
  stock_type?: (string | null);
35
23
  block?: (string | null);
36
24
  packing_method?: (string | null);
37
- packaging_code?: (string | null);
38
25
  is_bought_in_product?: (boolean | null);
39
26
  reprocess_method?: (string | null);
40
27
  is_carry_over?: (boolean | null);
@@ -102,9 +89,6 @@ export interface __MainSchema {
102
89
  length_measurement?: (string | null);
103
90
  fabric_composition?: (string | null);
104
91
  };
105
- preorder_options?: ("Never" | "Default" | "Weeks" | null);
106
- preorder_num_period?: (string | null);
107
- vat_posting_group_code?: (string | null);
108
92
  retail_price?: (Money | null);
109
93
  cost?: {
110
94
  current_cost?: (Money | null);
@@ -113,8 +97,6 @@ export interface __MainSchema {
113
97
  commission_rate?: (number | null);
114
98
  freight_rate?: (number | null);
115
99
  duty_rate?: (number | null);
116
- unit_cost?: (Money | null);
117
- last_direct_cost?: (Money | null);
118
100
  };
119
101
  duty?: {
120
102
  [k: string]: unknown;
@@ -128,7 +110,6 @@ export interface __MainSchema {
128
110
  port_of_origin?: (string | null);
129
111
  moq?: (number | null);
130
112
  supplier_id?: (string | null);
131
- erp_supplier_id?: (string | null);
132
113
  supplier_name?: (string | null);
133
114
  factory_id?: (string | null);
134
115
  };
@@ -45,6 +45,15 @@ declare class AirtableHelper<T extends Record<string, string>, K extends keyof T
45
45
  fieldsToMergeOn?: Array<keyof T>;
46
46
  primaryKeyWritable?: boolean;
47
47
  typecast?: boolean;
48
+ }, callIdx?: number, collectedResult?: {
49
+ updatedRecords: Array<string>;
50
+ createdRecords: Array<string>;
51
+ records: Array<{
52
+ id: string;
53
+ fields: {
54
+ [key in T[keyof T]]: any;
55
+ };
56
+ } | Error>;
48
57
  }): Promise<{
49
58
  updatedRecords: Array<string>;
50
59
  createdRecords: Array<string>;
@@ -140,8 +140,6 @@ export default class CentraHelper extends EnvEngine {
140
140
  getCacheKeyForCountryCode(countryCode: string): string;
141
141
  getCacheKeyForMarkets(): string;
142
142
  getCacheKeyForMarket(marketExternalId: string): string;
143
- getCacheKeyForCampaigns(): string;
144
- getCacheKeyForCampaign(campaignName: string): string;
145
143
  getCacheKeyForSizeCharts(): string;
146
144
  getCacheKeyForCountries(): string;
147
145
  getCacheKeyForCountry(countryIso2Code: string): string;
@@ -165,7 +163,6 @@ export default class CentraHelper extends EnvEngine {
165
163
  private fetchCentraVariants;
166
164
  getCentraWarehouses(externalIds?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraWarehouse>>;
167
165
  getCentraPricelists(names?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicPricelist>>;
168
- getCentraCampaigns(alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraMarket>>;
169
166
  getCentraMarkets(alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraMarket>>;
170
167
  getCentraCountries(iso2Codes?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraCountry>>;
171
168
  getCentraSizeCharts(externalIds?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraSizeChart>>;
@@ -1,5 +1,5 @@
1
1
  import { IncomingMessage } from "http";
2
- import type { PubSub } from "@google-cloud/pubsub";
2
+ import { type PubSub } from "@google-cloud/pubsub";
3
3
  import { RateLimiterRedis } from "rate-limiter-flexible";
4
4
  import PubSubHelper from "./pubsub";
5
5
  import Runtime, { Opts as RuntimeOpts } from './runtime';
@@ -17,4 +17,3 @@ export { default as setHeaders } from './setHeaders';
17
17
  export { type CentraError, type CentraErrors, type BasicCentraCountry, type BasicCentraMarket, type BasicCentraSizeChart, type BasicPricelist, type BasicCentraWarehouse, type BasicCentraCampaign, type BasicCentraProduct, type BasicCentraVariant, type BasicCentraDisplay } from './centra';
18
18
  export { default as RateLimit, RedisConnectionError } from './rateLimit';
19
19
  export { type TriggerOnCreateOptions, type TriggerOnExecuteOptions, type NodeOptions, type RNConfiguration, type TriggerExtraOptions } from './types';
20
- export { default as SitooHelper, type UnitCost, type StockMovementInput, type BasicSitooWarehouse, type BasicSitooStore, type BasicWarehouseTransaction, type WarehouseTransactionEnvelope, type WarehouseTransactionSyncOptions } from './sitoo';
@@ -5,8 +5,6 @@ declare global {
5
5
  var HUSH_PUBSUB_PUBLISH_TOPICS: Record<string, Topic>;
6
6
  }
7
7
  export declare function isSubscriptionBigQuery(opts: SubscriptionOptionsBigQuery | SubscriptionOptionsPull): opts is SubscriptionOptionsBigQuery;
8
- type PublishAttributesGenerator<T> = (payload: any) => T;
9
- type PublishAttributes = PublishAttributesGenerator<Record<string, string>> | Record<string, string> | Record<string, PublishAttributesGenerator<string | boolean | number> | boolean | number>;
10
8
  export type Message = {
11
9
  buildshipId: string;
12
10
  subscriptionName?: string;
@@ -59,8 +57,7 @@ declare class PubSubHelper extends Runtime {
59
57
  publish(options: Partial<Message> & {
60
58
  topicName: string;
61
59
  sourceSystem: string;
62
- extraAttributes?: PublishAttributes;
63
- attributesGenerator?: PublishAttributesGenerator<Record<string, string>>;
60
+ attributesGenerator?: (payload: any) => Record<string, string>;
64
61
  }, payloads: Array<MessageBody>): Promise<Array<string | Error>>;
65
62
  createOrUpdate(opts: {
66
63
  topicName: string;
@@ -6,9 +6,11 @@ export type Opts = {
6
6
  workflowId?: string;
7
7
  workflow?: {
8
8
  id: string;
9
- nodeValues?: Record<string, any>;
10
9
  };
11
10
  triggerId?: string;
11
+ trigger?: {
12
+ id: string;
13
+ };
12
14
  url?: string;
13
15
  runtimeUrl?: string;
14
16
  request?: {
@@ -19,12 +21,6 @@ export type Opts = {
19
21
  triggerEnv?: any;
20
22
  runtimeEnv?: string;
21
23
  };
22
- trigger?: {
23
- id?: string;
24
- meta?: {
25
- name?: string;
26
- };
27
- };
28
24
  session?: {
29
25
  executedNodes: {
30
26
  [key: string]: {
@@ -49,22 +45,13 @@ export declare class Logging implements ILogging {
49
45
  export default class Runtime {
50
46
  readonly workflowId: string;
51
47
  readonly triggerId: string;
52
- readonly triggerName: string;
53
- readonly triggerVersion: string;
54
48
  readonly envName: string;
55
49
  readonly pubSubPrefix: string;
56
50
  readonly systemEnvName: string;
57
51
  readonly runtimeUrl: string;
58
52
  readonly logging: ILogging;
59
- readonly triggerDataProperties: Record<string, any> | undefined;
60
- readonly triggerConfigProperties: Record<string, any> | undefined;
61
- readonly triggerConfig: Record<string, any> | undefined;
62
- readonly workflowRoot: {
63
- state?: Record<string, any>;
64
- [key: string]: any;
65
- };
53
+ readonly workflowRoot: any | null;
66
54
  constructor(opts: Opts | Runtime);
67
- enhanceWorkflowReturn(triggerReturn: any, triggerConfig: any): any;
68
55
  private getRuntimeUrl;
69
56
  private getSystemEnvName;
70
57
  private get isDeployment();
@@ -53,12 +53,6 @@ export type TriggerOnExecuteOptions = {
53
53
  };
54
54
  getBuildShipFile: (x: any) => any;
55
55
  trigger: {
56
- config: {
57
- properties: Record<string, any>;
58
- };
59
- data: {
60
- properties: Record<string, any>;
61
- };
62
56
  meta: {
63
57
  fileUploadLimit: boolean;
64
58
  name: string;
@@ -34,7 +34,7 @@ declare global {
34
34
  var functionsCache: Record<string, (symbol: symbol, payload: any) => any>;
35
35
  }
36
36
  export declare const FUNCTION_EXPR_ERROR: unique symbol;
37
- export declare function createFunction(expression: string | ((payload: any) => any)): (payload: any) => any;
37
+ export declare function createFunction(expression: string): (payload: any) => any;
38
38
  export declare function createOnResponse(opts: {
39
39
  requiredFlag: string;
40
40
  }): (config: any & {
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@shushed/helpers",
3
- "version": "0.0.226",
3
+ "version": "0.0.227-main-20260107085003",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",
7
7
  "dependencies": {
8
- "@google-cloud/firestore": "^7.11.1",
9
8
  "@hackylabs/deep-redact": "^2.2.1",
10
9
  "ajv": "^8.17.1",
11
10
  "ajv-formats": "^3.0.1",
@@ -13,15 +12,15 @@
13
12
  "jose": "^6.0.11",
14
13
  "lodash.chunk": "^4.2.0",
15
14
  "lodash.clonedeep": "^4.5.0",
16
- "lodash.groupby": "^4.6.0",
17
15
  "lodash.isequal": "^4.5.0",
18
16
  "lodash.omit": "^4.5.0",
19
17
  "lodash.pick": "^4.4.0",
20
18
  "mime-types": "^3.0.1",
21
19
  "p-limit": "^7.1.1",
22
20
  "rate-limiter-flexible": "^7.2.0",
21
+ "uuid": "^11.1.0",
23
22
  "redis": "^5.6.0",
24
- "uuid": "^11.1.0"
23
+ "@google-cloud/firestore": "^7.11.1"
25
24
  },
26
25
  "files": [
27
26
  "dist"
@@ -1,135 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://shushed.example.com/stock-move.schema.json",
4
- "title": "Stock Movement Schema",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "properties": {
8
- "style_id": {
9
- "type": "string",
10
- "minLength": 1,
11
- "faker": {
12
- "custom.style": []
13
- },
14
- "description": "Style Code - Example: 000697"
15
- },
16
- "colour_id": {
17
- "type": "string",
18
- "minLength": 1,
19
- "faker": {
20
- "custom.color": []
21
- },
22
- "description": "Colour Code - Example: 3203"
23
- },
24
- "product_id": {
25
- "type": "string",
26
- "minLength": 1,
27
- "description": "Combination of style_id and colour_id"
28
- },
29
- "size_code": {
30
- "type": "string",
31
- "minLength": 1,
32
- "description": "Variant code, e.g., XS, M, XL, ONE, or numeric like 10, 37, 40"
33
- },
34
- "sku": {
35
- "type": "string",
36
- "minLength": 1,
37
- "description": "Full sku of the product_id + size_code"
38
- },
39
- "season_id": {
40
- "type": "string",
41
- "description": "Code must match format like 'AW20'"
42
- },
43
- "drop": {
44
- "type": "string",
45
- "description": "Code for the drop i.e. AUGUST"
46
- },
47
- "document_line_no": {
48
- "type": "string",
49
- "description": "Line number for the document of the Purchase Line"
50
- },
51
- "document_no": {
52
- "type": "string",
53
- "description": "Document No for this purchase line"
54
- },
55
- "created_at": {
56
- "type": "string",
57
- "format": "date-time",
58
- "description": "Date time of the creation of the record. Preferably creation time of the item ledger entry",
59
- "faker": {
60
- "date.between": [
61
- "2024-01-01T00:00:00.000Z",
62
- "2025-04-30T00:00:00.000Z"
63
- ]
64
- }
65
- },
66
- "location_code": {
67
- "type": "string",
68
- "description": "Valid location code like 001-DR, JL200, HEADOFFICE"
69
- },
70
- "quantity": {
71
- "type": "number"
72
- },
73
- "quantity_received": {
74
- "type": "number"
75
- },
76
- "quantity_to_receive": {
77
- "type": "number"
78
- },
79
- "last_modified_at": {
80
- "type": "string",
81
- "format": "date-time",
82
- "description": "Datetime of the last created_at in the history",
83
- "faker": {
84
- "date.between": [
85
- "2024-01-01T00:00:00.000Z",
86
- "2025-04-30T00:00:00.000Z"
87
- ]
88
- }
89
- },
90
- "expected_date": {
91
- "type": "string",
92
- "format": "date-time",
93
- "description": "Datetime of item expected date in the inventory. Since the day is expected always keep to the ISO 00:00 of any day",
94
- "faker": {
95
- "date.between": [
96
- "2024-01-01T00:00:00.000Z",
97
- "2025-04-30T00:00:00.000Z"
98
- ]
99
- }
100
- },
101
- "qa_completed_date": {
102
- "type": "string",
103
- "format": "date-time",
104
- "description": "Date of completing QA. Useful to calculate the available to sell date: Available to Sell Date = QA Completed Date + Processing Days. The system looks up the Item and its Style Colour nH settings: Check Reprocess Method: If Style Colour nH.\"Reprocess Method HU\" is 'Standard': If Use Default Processing Time HU is True, it adds Inventory Setup.\"Default Processing (Days)\". If Use Default Processing Time HU is False, it adds Style Colour nH.\"Torque Processing (Days)\". If Reprocess Method HU is not 'Standard' (or if no Style/Item record is found), it adds 0 days (so Available Date = QA Date).",
105
- "faker": {
106
- "date.between": [
107
- "2024-01-01T00:00:00.000Z",
108
- "2025-04-30T00:00:00.000Z"
109
- ]
110
- }
111
- },
112
- "unit_price": {
113
- "oneOf": [
114
- {
115
- "$ref": "https://shushed.example.com/money.schema.json"
116
- },
117
- {
118
- "type": "null"
119
- }
120
- ],
121
- "description": "Cost/Price of unit, can be null"
122
- }
123
- },
124
- "required": [
125
- "document_no",
126
- "document_line_no",
127
- "style_id",
128
- "colour_id",
129
- "size_code",
130
- "sku",
131
- "product_id",
132
- "season_id",
133
- "drop"
134
- ]
135
- }
@@ -1,144 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://shushed.example.com/stock-move.schema.json",
4
- "title": "Stock Movement Schema",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "properties": {
8
- "style_id": {
9
- "type": "string",
10
- "minLength": 1,
11
- "faker": {
12
- "custom.style": []
13
- },
14
- "description": "Style Code - Example: 000697"
15
- },
16
- "colour_id": {
17
- "type": "string",
18
- "minLength": 1,
19
- "faker": {
20
- "custom.color": []
21
- },
22
- "description": "Colour Code - Example: 3203"
23
- },
24
- "size_code": {
25
- "type": "string",
26
- "minLength": 1,
27
- "description": "Variant code, e.g., XS, M, XL, ONE, or numeric like 10, 37, 40"
28
- },
29
- "location_code": {
30
- "type": "string",
31
- "pattern": "^\\d{3}-[A-Z]+$|^[A-Z]{2,}-?[A-Z]*$|^[A-Z]{2,}\\d{3}$",
32
- "description": "Valid location code like 001-DR, JL200, HEADOFFICE"
33
- },
34
- "source_system": {
35
- "type": "string",
36
- "enum": [
37
- "bc",
38
- "centra",
39
- "sitoo"
40
- ]
41
- },
42
- "quantity": {
43
- "type": "integer",
44
- "minimum": 0,
45
- "description": "Quantity of stock available on hand"
46
- },
47
- "description": {
48
- "type": "string"
49
- },
50
- "entry_no": {
51
- "type": "string",
52
- "description": "BC Entry no. Should be empty for other systems"
53
- },
54
- "external_entry_no": {
55
- "type": "string",
56
- "description": "External Entry no. Might be empty for other systems"
57
- },
58
- "document_no": {
59
- "type": "string",
60
- "description": "BC Document no. Should be empty for other systems"
61
- },
62
- "external_document_no": {
63
- "type": "string",
64
- "description": "Original document i.e. Sitoo ID that caused the change"
65
- },
66
- "type": {
67
- "type": "string",
68
- "enum": [
69
- "transfer",
70
- "negative adjustment",
71
- "positive adjustment",
72
- "purchase",
73
- "sale"
74
- ]
75
- },
76
- "unit_cost": {
77
- "oneOf": [
78
- {
79
- "$ref": "https://shushed.example.com/money.schema.json"
80
- },
81
- {
82
- "type": "null"
83
- }
84
- ],
85
- "description": "Cost per unit, can be null"
86
- },
87
- "document_date": {
88
- "type": "string",
89
- "format": "date",
90
- "description": "Date of the creation of the document. Preferably creation time of the item ledger entry",
91
- "faker": {
92
- "date.between": [
93
- "2024-01-01",
94
- "2025-04-30"
95
- ]
96
- }
97
- },
98
- "posting_date": {
99
- "type": "string",
100
- "format": "date",
101
- "description": "Date of posting the record in BC. This should be empty for non-BC systems. Preferably creation time of the item ledger entry",
102
- "faker": {
103
- "date.between": [
104
- "2024-01-01",
105
- "2025-04-30"
106
- ]
107
- }
108
- },
109
- "created_at": {
110
- "type": "string",
111
- "format": "date-time",
112
- "description": "Date time of the creation of the record. Preferably creation time of the item ledger entry",
113
- "faker": {
114
- "date.between": [
115
- "2024-01-01T00:00:00.000Z",
116
- "2025-04-30T00:00:00.000Z"
117
- ]
118
- }
119
- },
120
- "last_modified_at": {
121
- "type": "string",
122
- "format": "date-time",
123
- "description": "Datetime of the last created_at in the history",
124
- "faker": {
125
- "date.between": [
126
- "2024-01-01T00:00:00.000Z",
127
- "2025-04-30T00:00:00.000Z"
128
- ]
129
- }
130
- }
131
- },
132
- "required": [
133
- "style_id",
134
- "source_system",
135
- "location_code",
136
- "colour_id",
137
- "size_code",
138
- "last_modified_at",
139
- "quantity",
140
- "created_at",
141
- "document_date",
142
- "type"
143
- ]
144
- }
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Stock Movement Schema", "type": "object", "additionalProperties": false, "properties": { "style_id": { "type": "string", "minLength": 1 }, "colour_id": { "type": "string", "minLength": 1 }, "product_id": { "type": "string", "minLength": 1 }, "size_code": { "type": "string", "minLength": 1 }, "sku": { "type": "string", "minLength": 1 }, "season_id": { "type": "string" }, "drop": { "type": "string" }, "document_line_no": { "type": "string" }, "document_no": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "location_code": { "type": "string" }, "quantity": { "type": "number" }, "quantity_received": { "type": "number" }, "quantity_to_receive": { "type": "number" }, "last_modified_at": { "type": "string", "format": "date-time" }, "expected_date": { "type": "string", "format": "date-time" }, "qa_completed_date": { "type": "string", "format": "date-time" }, "unit_price": { "oneOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Money", "type": "object", "additionalProperties": false, "properties": { "value": { "type": "integer", "minimum": 0 }, "decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 }, "currency": { "title": "Currency", "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"] }, "lcy_value": { "type": "integer", "minimum": 0 }, "lcy_currency": { "title": "LCY Currency", "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"] }, "lcy_decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 } }, "required": ["value", "currency", "lcy_value", "lcy_currency", "decimal_places", "lcy_decimal_places"] }, { "type": "null" }] } }, "required": ["document_no", "document_line_no", "style_id", "colour_id", "size_code", "sku", "product_id", "season_id", "drop"], "$id": "https://shushed.example.com/stock-move.schema.json" };
4
- exports.default = schema;
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Stock Movement Schema", "type": "object", "additionalProperties": false, "properties": { "style_id": { "type": "string", "minLength": 1 }, "colour_id": { "type": "string", "minLength": 1 }, "size_code": { "type": "string", "minLength": 1 }, "location_code": { "type": "string", "pattern": "^\\d{3}-[A-Z]+$|^[A-Z]{2,}-?[A-Z]*$|^[A-Z]{2,}\\d{3}$" }, "source_system": { "type": "string", "enum": ["bc", "centra", "sitoo"] }, "quantity": { "type": "integer", "minimum": 0 }, "entry_no": { "type": "string" }, "external_entry_no": { "type": "string" }, "document_no": { "type": "string" }, "external_document_no": { "type": "string" }, "type": { "type": "string", "enum": ["transfer", "negative adjustment", "positive adjustment", "purchase", "sale"] }, "unit_cost": { "oneOf": [{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Money", "type": "object", "additionalProperties": false, "properties": { "value": { "type": "integer", "minimum": 0 }, "decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 }, "currency": { "title": "Currency", "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"] }, "lcy_value": { "type": "integer", "minimum": 0 }, "lcy_currency": { "title": "LCY Currency", "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"] }, "lcy_decimal_places": { "type": "integer", "minimum": 0, "maximum": 4 } }, "required": ["value", "currency", "lcy_value", "lcy_currency", "decimal_places", "lcy_decimal_places"] }, { "type": "null" }] }, "document_date": { "type": "string", "format": "date" }, "posting_date": { "type": "string", "format": "date" }, "created_at": { "type": "string", "format": "date-time" }, "last_modified_at": { "type": "string", "format": "date-time" } }, "required": ["style_id", "source_system", "location_code", "colour_id", "size_code", "last_modified_at", "quantity", "created_at", "document_date", "type"], "$id": "https://shushed.example.com/stock-move.schema.json" };
4
- exports.default = schema;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });