@secondcloset/types 2.8.0-beta.1-yyc-atl → 2.8.0-beta.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondcloset/types",
3
- "version": "2.8.0-beta.1-yyc-atl",
3
+ "version": "2.8.0-beta.10",
4
4
  "description": "secondcloset type declaration and definitions",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -9,13 +9,23 @@ export type OrganizationConfigKey =
9
9
  | "auto_fulfill_orders"
10
10
  | "freightcom_api_username"
11
11
  | "freightcom_api_password"
12
- | "preferred_return_facility";
12
+ | "preferred_return_facility"
13
+ | "disable_partial_fulfillment";
13
14
 
14
15
  export interface OrganizationConfig {
15
16
  key: OrganizationConfigKey;
16
17
  value: string;
17
18
  }
18
19
 
20
+ export type OrganizationShippingConfigKey =
21
+ | "whitelist_carrier"
22
+ | "blacklist_carrier";
23
+
24
+ export interface OrganizationShippingConfig {
25
+ key: OrganizationShippingConfigKey;
26
+ value: string[];
27
+ }
28
+
19
29
  export interface Permission {
20
30
  id: string;
21
31
  name: string;
@@ -69,6 +79,7 @@ export interface Organization extends BaseOrganization {
69
79
  sc_service_tier?: SCServiceTier;
70
80
  };
71
81
  configurations_attributes: OrganizationConfig[];
82
+ shipping_configurations_attributes?: OrganizationShippingConfig[];
72
83
  permissions: Permission[];
73
84
  geofilter_constraints?: GeofilterConstraint[];
74
85
  facility_service_areas?: FacilityServiceArea[];
@@ -26,6 +26,7 @@ export interface Appointment {
26
26
  estimated_time: number;
27
27
  facility?: {
28
28
  name: string;
29
+ street: string;
29
30
  };
30
31
  failed_notes: string | null;
31
32
  failed_reason: string | null;
@@ -6,6 +6,7 @@ import {
6
6
  BaseUser,
7
7
  Organization,
8
8
  File,
9
+ Version,
9
10
  } from "../../_common";
10
11
  import { OrderItem } from "./orderItem";
11
12
 
@@ -16,10 +17,14 @@ export type ShipmentTag =
16
17
  | "items_fulfilled"
17
18
  | "processing_return_items"
18
19
  | "items_returned"
20
+ | "returned_to_sender"
21
+ | "pending_return_to_sender"
19
22
  | "items_removed"
20
23
  | "pending_inventory_receiving"
21
24
  | "items_partially_fulfilled"
22
- | "customer_booking";
25
+ | "customer_booking"
26
+ | "pending_customer_pickup"
27
+ | "items_picked_up_by_customer";
23
28
 
24
29
  export type OrderPlatform =
25
30
  | "manual"
@@ -40,41 +45,43 @@ export interface FulfillmentOrderAddress extends BaseAddress {
40
45
  updated_at: string;
41
46
  }
42
47
 
43
- export interface Order {
44
- id: string;
45
- order_id: string;
46
- external_order_number: string;
47
- external_order_id: string | null;
48
- notes: string;
49
- internal_notes?: string;
50
- platform: OrderPlatform;
51
- external_platform_version: number | null;
52
- parcel_type: string;
53
- cancelled: boolean;
54
- fulfilled_from: FacilityCode;
55
- client_type: string | null;
56
- insurance_value: number;
57
- shipping_service: string | null;
58
- signature_required?: boolean;
59
- customer: Customer;
60
- address: FulfillmentOrderAddress;
61
- created_at: string;
62
- updated_at: string;
63
- organization: Organization;
64
- overdue: boolean;
65
- user: BaseUser;
66
- status?: string;
67
- shipment_tags: ShipmentTag[];
68
- shipments: Shipment[];
69
- items: OrderItem[];
70
- files: File[];
71
- stock_status:
72
- | "in_stock"
73
- | "partially_in_stock"
74
- | "out_of_stock"
75
- | "unknown_stock";
76
- on_hold: boolean;
77
- on_hold_at: string;
78
- selected_service_code?: ScServiceCode;
79
- has_errors: boolean;
80
- }
48
+ export type Order<V extends Version = "V1"> = V extends "V1"
49
+ ? {
50
+ id: string;
51
+ order_id: string;
52
+ external_order_number: string;
53
+ external_order_id: string | null;
54
+ notes: string;
55
+ internal_notes?: string;
56
+ platform: OrderPlatform;
57
+ external_platform_version: number | null;
58
+ parcel_type: string;
59
+ cancelled: boolean;
60
+ fulfilled_from: FacilityCode;
61
+ client_type: string | null;
62
+ insurance_value: number;
63
+ shipping_service: string | null;
64
+ signature_required?: boolean;
65
+ customer: Customer;
66
+ address: FulfillmentOrderAddress;
67
+ created_at: string;
68
+ updated_at: string;
69
+ organization: Organization;
70
+ overdue: boolean;
71
+ user: BaseUser;
72
+ status?: string;
73
+ shipment_tags: ShipmentTag[];
74
+ shipments: Shipment<V>[];
75
+ items: OrderItem<V>[];
76
+ files: File[];
77
+ stock_status:
78
+ | "in_stock"
79
+ | "partially_in_stock"
80
+ | "out_of_stock"
81
+ | "unknown_stock";
82
+ on_hold: boolean;
83
+ on_hold_at: string;
84
+ requested_service_code?: ScServiceCode;
85
+ has_errors: boolean;
86
+ }
87
+ : Omit<Order<"V1">, "items" | "shipments">;
@@ -1,16 +1,34 @@
1
- import { Product } from "../product";
1
+ import { Version } from "../../_common";
2
+ import { BaseProduct, Product } from "../product";
2
3
  import { ShipmentActionType } from "../shipment";
3
4
 
4
- export interface OrderItem {
5
- id: string;
6
- product: Product;
7
- quantity: number;
8
- attributes: string[];
9
- return_reasons: string[];
10
- available_actions: ShipmentActionType[];
11
- actions_history: ShipmentActionType[];
12
- virtual_kit_id: null | string;
13
- available_quantity: number;
14
- removed: boolean;
15
- removed_reason: string;
16
- }
5
+ export type OrderItem<V extends Version = "V1"> = V extends "V1"
6
+ ? {
7
+ id: string;
8
+ product: Product;
9
+ quantity: number;
10
+ attributes: string[];
11
+ return_reasons: string[];
12
+ available_actions: ShipmentActionType[];
13
+ actions_history: ShipmentActionType[];
14
+ virtual_kit_id: null | string;
15
+ available_quantity: number;
16
+ removed: boolean;
17
+ removed_reason: string;
18
+ }
19
+ : {
20
+ product: BaseProduct & {
21
+ available_quantity: OrderItem<"V1">["available_quantity"];
22
+ base_products?: OrderItem<"V2">["product"][];
23
+ required_parts?: Record<string, number>;
24
+ };
25
+ available_actions: {
26
+ inventory_pick_up_item_ids: OrderItem<"V1">["id"][];
27
+ inventory_warehouse_receiving_item_ids: OrderItem<"V1">["id"][];
28
+ delivery_item_ids: OrderItem<"V1">["id"][];
29
+ };
30
+ removed_items: {
31
+ removed_reason: string;
32
+ quantity: number;
33
+ }[];
34
+ };
@@ -3,14 +3,18 @@ import { BaseImage } from "../../_common";
3
3
 
4
4
  export interface BaseProduct {
5
5
  id: string;
6
- organization_id: string;
7
6
  scid: string;
7
+ name: string;
8
8
  sku: string;
9
9
  upc: string;
10
- name: string;
10
+ type: "base" | "kit";
11
+ active: boolean;
12
+ }
13
+
14
+ export interface Product extends Omit<BaseProduct, "type"> {
15
+ organization_id: string;
11
16
  description: string;
12
17
  platform: string;
13
- active: boolean;
14
18
  fragile: boolean;
15
19
  dangerous: boolean;
16
20
  liquid: boolean;
@@ -32,7 +36,7 @@ export interface BaseProduct {
32
36
  customs_description: string | null;
33
37
  images: BaseImage[];
34
38
  packaging_criteria: string;
35
- product_type: "base" | "kit";
39
+ product_type: BaseProduct["type"];
36
40
  stocks?: Stock[];
37
41
  deleted_at: string;
38
42
  created_at: string;
@@ -56,21 +60,14 @@ export interface BaseProduct {
56
60
  insurance_value: number | null;
57
61
  has_errors: boolean;
58
62
  under_conversion: boolean;
59
- }
60
-
61
- export interface Product extends BaseProduct {
62
- base_products?: BaseProduct[];
63
+ base_products?: Product[];
63
64
  }
64
65
 
65
66
  export interface PackagingLevel {
66
67
  id?: string;
67
68
  product_id?: string;
68
- product: {
69
- id: string;
70
- sku: string;
69
+ product: BaseProduct & {
71
70
  upc: string;
72
- scid: string;
73
- name: string;
74
71
  tracks_lot_numbers: boolean;
75
72
  };
76
73
  level: "single_item" | "inner_pack" | "master_pack" | "pallet";
@@ -18,4 +18,6 @@ export interface Stock {
18
18
  orders_to_be_reserved: StockOrder[];
19
19
  reserved_quantity: number;
20
20
  reserved_orders: StockOrder[];
21
+ on_hold_inventory?: number;
22
+ damaged_inventory?: number;
21
23
  }
@@ -1,9 +1,16 @@
1
1
  import { ShipmentItem } from "./shipmentItem";
2
- import { BaseUser, BaseNote, BaseOrganization, Facility } from "../../_common";
2
+ import {
3
+ BaseUser,
4
+ BaseNote,
5
+ BaseOrganization,
6
+ Facility,
7
+ Version,
8
+ } from "../../_common";
3
9
  import { Package } from "./package";
4
10
  import {
5
11
  SecondClosetShippingMethod,
6
12
  ExternalCarrierShippingMethod,
13
+ CustomerPickupShippingMethod,
7
14
  } from "./shippingMethod";
8
15
  import { Carrier } from "./carrier";
9
16
  import { AppointmentType as FulfillmentAppointmentType } from "../appointment/appointmentType";
@@ -11,6 +18,7 @@ import { AppointmentType as StorageAppointmentType } from "../../storage/appoint
11
18
 
12
19
  export type ShipmentActionType =
13
20
  | "setup"
21
+ | "customer_pickup"
14
22
  | StorageAppointmentType
15
23
  | FulfillmentAppointmentType;
16
24
 
@@ -33,35 +41,41 @@ export type ScServiceCode =
33
41
  | "second_closet_to_the_door_1_person"
34
42
  | ServiceCode;
35
43
 
36
- export interface Shipment {
37
- id: string;
38
- organization_id: string;
39
- organization?: BaseOrganization;
40
- billed: boolean;
41
- user: BaseUser;
42
- notes: BaseNote[] | string;
43
- shipment_items: ShipmentItem[];
44
- shipment_number: string;
45
- packages: Package[];
46
- external_order_id: string | null;
47
- external_order_type: string;
48
- external_shipment_id: string | null;
49
- carrier: Carrier | null;
50
- created_at: string;
51
- updated_at: string;
52
- action_summary: ShipmentActionType[];
53
- freight: boolean;
54
- shipping_method: SecondClosetShippingMethod | ExternalCarrierShippingMethod;
55
- shipping_method_type:
56
- | "external_carrier_shipment"
57
- | "appointment"
58
- | "untracked_shipment";
59
- external_order?: {
60
- id: string;
61
- external_order_number: string;
62
- external_order_id: string | null;
63
- created_at: string;
64
- updated_at: string;
65
- };
66
- facility?: Partial<Facility>;
67
- }
44
+ export type Shipment<V extends Version = "V1"> = V extends "V1"
45
+ ? {
46
+ id: string;
47
+ organization_id: string;
48
+ organization?: BaseOrganization;
49
+ billed: boolean;
50
+ user: BaseUser;
51
+ notes: BaseNote[] | string;
52
+ shipment_items: ShipmentItem<V>[];
53
+ shipment_number: string;
54
+ packages: Package[];
55
+ external_order_id: string | null;
56
+ external_order_type: string;
57
+ external_shipment_id: string | null;
58
+ carrier: Carrier | null;
59
+ created_at: string;
60
+ updated_at: string;
61
+ action_summary: ShipmentActionType[];
62
+ freight: boolean;
63
+ shipping_method:
64
+ | SecondClosetShippingMethod
65
+ | ExternalCarrierShippingMethod
66
+ | CustomerPickupShippingMethod;
67
+ shipping_method_type:
68
+ | "external_carrier_shipment"
69
+ | "appointment"
70
+ | "untracked_shipment"
71
+ | "customer_pickup_shipment";
72
+ external_order?: {
73
+ id: string;
74
+ external_order_number: string;
75
+ external_order_id: string | null;
76
+ created_at: string;
77
+ updated_at: string;
78
+ };
79
+ facility?: Partial<Facility>;
80
+ }
81
+ : Omit<Shipment<"V1">, "shipment_items">;
@@ -1,42 +1,55 @@
1
+ import { Version } from "../../_common";
2
+ import { BaseProduct } from "../product";
1
3
  import { ShipmentActionType } from "./shipment";
2
- export interface ShipmentItem {
3
- id: string;
4
- order_item_id: string;
5
- description: string;
6
- item_identifier: string;
7
- item_identifier_type: string;
8
- item_identifier_value: string;
9
- product_id?: string;
10
- weight_value: string;
11
- weight_unit: string;
12
- length_value: string;
13
- length_unit: string;
14
- height_value: string;
15
- height_unit: string;
16
- width_value: string;
17
- width_unit: string;
18
- shipment_actions: ShipmentActionType[];
19
- shipment_actions_completion: Partial<
20
- {
21
- [key in ShipmentActionType]: boolean;
4
+ export type ShipmentItem<V extends Version = "V1"> = V extends "V1"
5
+ ? {
6
+ id: string;
7
+ order_item_id: string;
8
+ description: string;
9
+ item_identifier: string;
10
+ item_identifier_type: string;
11
+ item_identifier_value: string;
12
+ product_id?: string;
13
+ weight_value: string;
14
+ weight_unit: string;
15
+ length_value: string;
16
+ length_unit: string;
17
+ height_value: string;
18
+ height_unit: string;
19
+ width_value: string;
20
+ width_unit: string;
21
+ shipment_actions: ShipmentActionType[];
22
+ shipment_actions_completion: Partial<
23
+ {
24
+ [key in ShipmentActionType]: boolean;
25
+ }
26
+ >;
27
+ shipment_actions_status?: {
28
+ [key in ShipmentActionType]: {
29
+ completed: boolean;
30
+ failed: boolean;
31
+ failed_reason: string | null;
32
+ };
33
+ };
34
+ shipment_item_group: {
35
+ id: string;
36
+ name: string;
37
+ description: string;
38
+ external_group_id: string;
39
+ group_identifier_type: string;
40
+ group_identifier_value: string;
41
+ created_at: string;
42
+ updated_at: string;
43
+ group_identifier: string;
44
+ } | null;
22
45
  }
23
- >;
24
- shipment_actions_status?: {
25
- [key in ShipmentActionType]: {
26
- completed: boolean;
27
- failed: boolean;
28
- failed_reason: string | null;
46
+ : {
47
+ product: BaseProduct;
48
+ shipment_item_ids: ShipmentItem<"V1">["id"][];
49
+ shipment_actions_status: {
50
+ [key in ShipmentActionType]: {
51
+ completed_shipment_item_ids: string[];
52
+ failed_shipment_items: string[];
53
+ };
54
+ };
29
55
  };
30
- };
31
- shipment_item_group: {
32
- id: string;
33
- name: string;
34
- description: string;
35
- external_group_id: string;
36
- group_identifier_type: string;
37
- group_identifier_value: string;
38
- created_at: string;
39
- updated_at: string;
40
- group_identifier: string;
41
- } | null;
42
- }
@@ -153,3 +153,13 @@ export interface ExternalCarrierShippingMethod {
153
153
  ship_to_address: CarrierShippingAddress;
154
154
  shipping_labels: ExternalCarrierShippingLabel[];
155
155
  }
156
+
157
+ export interface CustomerPickupShippingMethod {
158
+ id: string;
159
+ status: "awaiting" | "failed" | "cancelled" | "completed";
160
+ created_at: string;
161
+ completed_at?: string;
162
+ failed_at?: string;
163
+ failed_reason?: string;
164
+ estimated_pickup_date?: string;
165
+ }
@@ -43,7 +43,7 @@ interface ShippingLabel extends Partial<ExternalCarrierShippingLabel> {
43
43
  created_at: string;
44
44
  updated_at: string;
45
45
  }
46
- interface PackageShipment extends Partial<Shipment> {
46
+ interface PackageShipment extends Partial<Shipment<"V1">> {
47
47
  user_id: string;
48
48
  shipping_method_id?: string;
49
49
  customer_scheduling_token?: string;
@@ -62,4 +62,4 @@ export interface PackageDetailsInfo extends PackageInfo {
62
62
  organization: Organization;
63
63
  carrier?: PackageCarrier;
64
64
  shipping_label?: ShippingLabel;
65
- }
65
+ }
@@ -24,3 +24,8 @@ export * from "./stock";
24
24
  export * from "./supply";
25
25
  export * from "./supplyStock";
26
26
  export * from "./supplyTransaction";
27
+ export * from "./rmaContainer";
28
+ export * from "./productPhysicalProperty";
29
+ export * from "./physicalProperty";
30
+ export * from "./pickActivityLog";
31
+ export * from "./lotCode";
@@ -3,10 +3,12 @@ import { Location } from "./location";
3
3
  import { Pallet } from "./pallet";
4
4
  import { Bin } from "./bin";
5
5
  import { ManualItem } from "./manualItem";
6
+ import { LotCode } from "./lotCode";
6
7
 
7
8
  export enum LocationItemStatus {
8
- DAMAGED = "DAMAGED",
9
- NORMAL = "NORMAL",
9
+ AVAILABLE = "available",
10
+ DAMAGED = "damaged",
11
+ HOLD = "hold",
10
12
  }
11
13
 
12
14
  export interface LocationItem {
@@ -26,6 +28,8 @@ export interface LocationItem {
26
28
  created_at: string;
27
29
  updated_at: string;
28
30
  status: LocationItemStatus;
31
+ lot_code?: LotCode;
32
+ lot_code_id?: string;
29
33
  }
30
34
 
31
35
  export interface ItemMoveLocationValidation {
@@ -0,0 +1,13 @@
1
+ import { LocationItem } from "./locationItem";
2
+ import { Organization } from "./organization";
3
+
4
+ export interface LotCode {
5
+ id: string;
6
+ code?: string;
7
+ expiry_date?: string;
8
+ organization_id: string;
9
+ organization: Organization;
10
+ location_items?: LocationItem[];
11
+ created_at: string;
12
+ updated_at: string;
13
+ }
@@ -1,7 +1,8 @@
1
+ import { FacilityCode } from "../_common";
2
+ import { LotCode } from "./lotCode";
1
3
  import { Product } from "./product";
2
- import { Supply } from "./supply";
3
4
  import { ShipmentProductsTracking } from "./shipmentProductsTracking";
4
- import { FacilityCode } from "../_common";
5
+ import { Supply } from "./supply";
5
6
 
6
7
  export interface Organization {
7
8
  id: string;
@@ -9,6 +10,7 @@ export interface Organization {
9
10
  products?: Product[];
10
11
  supplies?: Supply[];
11
12
  shipment_products_trackings?: ShipmentProductsTracking[];
13
+ lot_codes?: LotCode[];
12
14
  }
13
15
 
14
16
  export enum OrganizationConfigKey {
@@ -0,0 +1,9 @@
1
+ export interface PhysicalProperty {
2
+ id: string;
3
+ name: string;
4
+ default_value: string;
5
+ type: "STRING" | "BOOLEAN" | "NUMBER";
6
+ created_at: Date;
7
+ updated_at: Date;
8
+ deleted_at: Date;
9
+ }
@@ -0,0 +1,22 @@
1
+ import { Picksheet } from "./picksheet";
2
+
3
+ enum PickActivityActionType {
4
+ START = "START",
5
+ PICK = "PICK",
6
+ ERROR = "ERROR",
7
+ }
8
+
9
+ export interface PickActivityLog {
10
+ id: string;
11
+ picksheet_id: string;
12
+ picksheet: Picksheet;
13
+ wavesheet_id: string;
14
+ picksheet_item_id: string;
15
+ picked_by: string;
16
+ created_at: Date;
17
+ action: PickActivityActionType;
18
+ quantity: number;
19
+ picked_location_code: string;
20
+ recommended_location_code: string;
21
+ error_message: string;
22
+ }
@@ -16,6 +16,7 @@ export type PicksheetStats = {
16
16
  organization?: PicksheetOrganization;
17
17
  ready_to_fulfill_count: number;
18
18
  processing_items_count: number;
19
+ is_pushed_shipments_enabled: boolean;
19
20
  };
20
21
 
21
22
  export enum PicksheetStatus {
@@ -55,6 +56,9 @@ export type Picksheet = {
55
56
  request?: PicksheetRequest;
56
57
  picksheet_items?: PicksheetItem[];
57
58
  type: PicksheetType;
59
+ organization?: Organization;
60
+ organization_id: string;
61
+ facility?: FacilityCode;
58
62
  };
59
63
 
60
64
  export type PicksheetItem = {
@@ -83,16 +87,3 @@ export type PicksheetRequest = {
83
87
  type: PicksheetRequestType;
84
88
  picksheets?: Picksheet[];
85
89
  };
86
-
87
- export type PicksheetLookupData = {
88
- facility?: string;
89
- picksheet_id?: string;
90
- shipment_number?: string;
91
- number_of_items?: number;
92
- order_id?: string;
93
- organization?: string;
94
- created_at?: string;
95
- shipment_id?: string;
96
- external_order_number?: string;
97
- external_order_id?: string;
98
- };
@@ -0,0 +1,16 @@
1
+ import { PhysicalProperty } from "./physicalProperty";
2
+
3
+ export interface ProductPhysicalPropertyView {
4
+ type: string;
5
+ value: string;
6
+ name: string;
7
+ product_physical_property_id: string;
8
+ }
9
+
10
+ export interface ProductPhysicalProperty {
11
+ id: string;
12
+ value: string;
13
+ product_id: string;
14
+ physical_property_id: string;
15
+ physical_property: PhysicalProperty;
16
+ }
@@ -1,3 +1,4 @@
1
+ import { LocationItemStatus } from "./locationItem";
1
2
  import { Product } from "./product";
2
3
 
3
4
  export enum PutawayActivityLogType {
@@ -8,6 +9,7 @@ export enum PutawayActivityLogType {
8
9
  export interface PutawayActivityLog {
9
10
  id: string;
10
11
  action: PutawayActivityLogType;
12
+ status?: LocationItemStatus;
11
13
  from_container_id?: string;
12
14
  to_container_id?: string;
13
15
  user_email: string;
@@ -1,4 +1,5 @@
1
1
  import { Organization } from "./organization";
2
+ import { RmaContainer } from "./rmaContainer";
2
3
 
3
4
  export enum ReturnItemCondition {
4
5
  RESELLABLE = "resellable",
@@ -39,6 +40,8 @@ export interface ReturnItem {
39
40
  condition_notes?: string;
40
41
  reason?: string;
41
42
  reason_notes?: string;
43
+ rma_container_id?: string;
44
+ rma_container?: RmaContainer;
42
45
  }
43
46
 
44
47
  export interface ReturnAddress {
@@ -0,0 +1,9 @@
1
+ import { ReturnItem } from "./return";
2
+
3
+ export type RmaContainer = {
4
+ id: string;
5
+ rma_number: string;
6
+ container_id: string;
7
+ quantity: number;
8
+ return_items: ReturnItem[];
9
+ };