@secondcloset/types 2.8.0-beta.1 → 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 +1 -1
- package/src/_common/facility.ts +7 -1
- package/src/_common/organization.ts +12 -1
- package/src/_common/serviceArea.ts +3 -1
- package/src/fulfillment/appointment/appointment.ts +1 -0
- package/src/fulfillment/order/order.ts +9 -5
- package/src/fulfillment/order/orderItem.ts +3 -1
- package/src/fulfillment/product/product.ts +3 -3
- package/src/fulfillment/product/stock.ts +2 -0
- package/src/fulfillment/shipment/shipment.ts +8 -4
- package/src/fulfillment/shipment/shipmentItem.ts +7 -1
- package/src/fulfillment/shipment/shippingMethod.ts +10 -0
- package/src/warehouse/index.ts +5 -0
- package/src/warehouse/locationItem.ts +6 -2
- package/src/warehouse/lotCode.ts +13 -0
- package/src/warehouse/organization.ts +5 -2
- package/src/warehouse/physicalProperty.ts +9 -0
- package/src/warehouse/pickActivityLog.ts +22 -0
- package/src/warehouse/picksheet.ts +4 -13
- package/src/warehouse/productPhysicalProperty.ts +16 -0
- package/src/warehouse/putawayActivityLog.ts +2 -0
- package/src/warehouse/return.ts +3 -0
- package/src/warehouse/rmaContainer.ts +9 -0
package/package.json
CHANGED
package/src/_common/facility.ts
CHANGED
|
@@ -17,6 +17,9 @@ export type FacilityCode =
|
|
|
17
17
|
| "nyc1"
|
|
18
18
|
| "mia1"
|
|
19
19
|
| "hou1"
|
|
20
|
+
| "yyc1"
|
|
21
|
+
| "atl1"
|
|
22
|
+
| "atl2"
|
|
20
23
|
| "unknown";
|
|
21
24
|
|
|
22
25
|
export type DeprecatedFacilityCode = "yyz1" | "yyz2";
|
|
@@ -32,7 +35,10 @@ export type FacilityCity =
|
|
|
32
35
|
| "Santa Fe Springs"
|
|
33
36
|
| "Carlstadt"
|
|
34
37
|
| "Medley"
|
|
35
|
-
| "Houston"
|
|
38
|
+
| "Houston"
|
|
39
|
+
| "Tucker"
|
|
40
|
+
| "Newnan"
|
|
41
|
+
| "Calgary";
|
|
36
42
|
|
|
37
43
|
export type Facility<V = Version> = V extends "V1"
|
|
38
44
|
? {
|
|
@@ -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[];
|
|
@@ -17,10 +17,14 @@ export type ShipmentTag =
|
|
|
17
17
|
| "items_fulfilled"
|
|
18
18
|
| "processing_return_items"
|
|
19
19
|
| "items_returned"
|
|
20
|
+
| "returned_to_sender"
|
|
21
|
+
| "pending_return_to_sender"
|
|
20
22
|
| "items_removed"
|
|
21
23
|
| "pending_inventory_receiving"
|
|
22
24
|
| "items_partially_fulfilled"
|
|
23
|
-
| "customer_booking"
|
|
25
|
+
| "customer_booking"
|
|
26
|
+
| "pending_customer_pickup"
|
|
27
|
+
| "items_picked_up_by_customer";
|
|
24
28
|
|
|
25
29
|
export type OrderPlatform =
|
|
26
30
|
| "manual"
|
|
@@ -41,7 +45,7 @@ export interface FulfillmentOrderAddress extends BaseAddress {
|
|
|
41
45
|
updated_at: string;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
export type Order<V =
|
|
48
|
+
export type Order<V extends Version = "V1"> = V extends "V1"
|
|
45
49
|
? {
|
|
46
50
|
id: string;
|
|
47
51
|
order_id: string;
|
|
@@ -67,8 +71,8 @@ export type Order<V = Version> = V extends "V1"
|
|
|
67
71
|
user: BaseUser;
|
|
68
72
|
status?: string;
|
|
69
73
|
shipment_tags: ShipmentTag[];
|
|
70
|
-
shipments: Shipment<
|
|
71
|
-
items: OrderItem<
|
|
74
|
+
shipments: Shipment<V>[];
|
|
75
|
+
items: OrderItem<V>[];
|
|
72
76
|
files: File[];
|
|
73
77
|
stock_status:
|
|
74
78
|
| "in_stock"
|
|
@@ -77,7 +81,7 @@ export type Order<V = Version> = V extends "V1"
|
|
|
77
81
|
| "unknown_stock";
|
|
78
82
|
on_hold: boolean;
|
|
79
83
|
on_hold_at: string;
|
|
80
|
-
|
|
84
|
+
requested_service_code?: ScServiceCode;
|
|
81
85
|
has_errors: boolean;
|
|
82
86
|
}
|
|
83
87
|
: Omit<Order<"V1">, "items" | "shipments">;
|
|
@@ -2,7 +2,7 @@ import { Version } from "../../_common";
|
|
|
2
2
|
import { BaseProduct, Product } from "../product";
|
|
3
3
|
import { ShipmentActionType } from "../shipment";
|
|
4
4
|
|
|
5
|
-
export type OrderItem<V =
|
|
5
|
+
export type OrderItem<V extends Version = "V1"> = V extends "V1"
|
|
6
6
|
? {
|
|
7
7
|
id: string;
|
|
8
8
|
product: Product;
|
|
@@ -19,6 +19,8 @@ export type OrderItem<V = Version> = V extends "V1"
|
|
|
19
19
|
: {
|
|
20
20
|
product: BaseProduct & {
|
|
21
21
|
available_quantity: OrderItem<"V1">["available_quantity"];
|
|
22
|
+
base_products?: OrderItem<"V2">["product"][];
|
|
23
|
+
required_parts?: Record<string, number>;
|
|
22
24
|
};
|
|
23
25
|
available_actions: {
|
|
24
26
|
inventory_pick_up_item_ids: OrderItem<"V1">["id"][];
|
|
@@ -3,18 +3,18 @@ import { BaseImage } from "../../_common";
|
|
|
3
3
|
|
|
4
4
|
export interface BaseProduct {
|
|
5
5
|
id: string;
|
|
6
|
+
scid: string;
|
|
6
7
|
name: string;
|
|
7
8
|
sku: string;
|
|
8
|
-
|
|
9
|
+
upc: string;
|
|
9
10
|
type: "base" | "kit";
|
|
11
|
+
active: boolean;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export interface Product extends Omit<BaseProduct, "type"> {
|
|
13
15
|
organization_id: string;
|
|
14
|
-
upc: string;
|
|
15
16
|
description: string;
|
|
16
17
|
platform: string;
|
|
17
|
-
active: boolean;
|
|
18
18
|
fragile: boolean;
|
|
19
19
|
dangerous: boolean;
|
|
20
20
|
liquid: boolean;
|
|
@@ -10,6 +10,7 @@ import { Package } from "./package";
|
|
|
10
10
|
import {
|
|
11
11
|
SecondClosetShippingMethod,
|
|
12
12
|
ExternalCarrierShippingMethod,
|
|
13
|
+
CustomerPickupShippingMethod,
|
|
13
14
|
} from "./shippingMethod";
|
|
14
15
|
import { Carrier } from "./carrier";
|
|
15
16
|
import { AppointmentType as FulfillmentAppointmentType } from "../appointment/appointmentType";
|
|
@@ -17,6 +18,7 @@ import { AppointmentType as StorageAppointmentType } from "../../storage/appoint
|
|
|
17
18
|
|
|
18
19
|
export type ShipmentActionType =
|
|
19
20
|
| "setup"
|
|
21
|
+
| "customer_pickup"
|
|
20
22
|
| StorageAppointmentType
|
|
21
23
|
| FulfillmentAppointmentType;
|
|
22
24
|
|
|
@@ -39,7 +41,7 @@ export type ScServiceCode =
|
|
|
39
41
|
| "second_closet_to_the_door_1_person"
|
|
40
42
|
| ServiceCode;
|
|
41
43
|
|
|
42
|
-
export type Shipment<V =
|
|
44
|
+
export type Shipment<V extends Version = "V1"> = V extends "V1"
|
|
43
45
|
? {
|
|
44
46
|
id: string;
|
|
45
47
|
organization_id: string;
|
|
@@ -47,7 +49,7 @@ export type Shipment<V = Version> = V extends "V1"
|
|
|
47
49
|
billed: boolean;
|
|
48
50
|
user: BaseUser;
|
|
49
51
|
notes: BaseNote[] | string;
|
|
50
|
-
shipment_items: ShipmentItem<
|
|
52
|
+
shipment_items: ShipmentItem<V>[];
|
|
51
53
|
shipment_number: string;
|
|
52
54
|
packages: Package[];
|
|
53
55
|
external_order_id: string | null;
|
|
@@ -60,11 +62,13 @@ export type Shipment<V = Version> = V extends "V1"
|
|
|
60
62
|
freight: boolean;
|
|
61
63
|
shipping_method:
|
|
62
64
|
| SecondClosetShippingMethod
|
|
63
|
-
| ExternalCarrierShippingMethod
|
|
65
|
+
| ExternalCarrierShippingMethod
|
|
66
|
+
| CustomerPickupShippingMethod;
|
|
64
67
|
shipping_method_type:
|
|
65
68
|
| "external_carrier_shipment"
|
|
66
69
|
| "appointment"
|
|
67
|
-
| "untracked_shipment"
|
|
70
|
+
| "untracked_shipment"
|
|
71
|
+
| "customer_pickup_shipment";
|
|
68
72
|
external_order?: {
|
|
69
73
|
id: string;
|
|
70
74
|
external_order_number: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Version } from "../../_common";
|
|
2
2
|
import { BaseProduct } from "../product";
|
|
3
3
|
import { ShipmentActionType } from "./shipment";
|
|
4
|
-
export type ShipmentItem<V =
|
|
4
|
+
export type ShipmentItem<V extends Version = "V1"> = V extends "V1"
|
|
5
5
|
? {
|
|
6
6
|
id: string;
|
|
7
7
|
order_item_id: string;
|
|
@@ -46,4 +46,10 @@ export type ShipmentItem<V = Version> = V extends "V1"
|
|
|
46
46
|
: {
|
|
47
47
|
product: BaseProduct;
|
|
48
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
|
+
};
|
|
49
55
|
};
|
|
@@ -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
|
+
}
|
package/src/warehouse/index.ts
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
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 {
|
|
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 {
|
|
@@ -21,6 +23,7 @@ export enum OrganizationConfigKey {
|
|
|
21
23
|
RTS_INSTRUCTION = "RTS_INSTRUCTION",
|
|
22
24
|
ENABLE_SEND_EMAIL_TO_CUSTOMERS = "ENABLE_SEND_EMAIL_TO_CUSTOMERS",
|
|
23
25
|
DEFAULT_RATE_FETCHING_V1 = "DEFAULT_RATE_FETCHING_V1",
|
|
26
|
+
DEFAULT_REQUIRE_SIGNATURE = "DEFAULT_REQUIRE_SIGNATURE",
|
|
24
27
|
}
|
|
25
28
|
export interface OrganizationConfig {
|
|
26
29
|
id: string;
|
|
@@ -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;
|
package/src/warehouse/return.ts
CHANGED
|
@@ -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 {
|