@secondcloset/types 2.17.17-beta-containerTypes-5 → 3.0.0
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 +2 -2
- package/src/_common/activityHistory.ts +9 -1
- package/src/_common/facility.ts +49 -18
- package/src/_common/index.ts +2 -1
- package/src/_common/organization.ts +21 -18
- package/src/_common/serviceArea.ts +11 -1
- package/src/_common/user.ts +1 -0
- package/src/fulfillment/appointment/appointment.ts +40 -1
- package/src/fulfillment/appointment/appointmentType.ts +4 -0
- package/src/fulfillment/asn/asn.ts +3 -0
- package/src/fulfillment/asn/asnItem.ts +3 -0
- package/src/fulfillment/index.ts +3 -0
- package/src/fulfillment/inventory/channel.ts +9 -0
- package/src/fulfillment/inventory/index.ts +2 -0
- package/src/fulfillment/inventory/inventory.ts +16 -0
- package/src/fulfillment/order/order.ts +49 -39
- package/src/fulfillment/order/orderItem.ts +34 -14
- package/src/fulfillment/product/product.ts +16 -17
- package/src/fulfillment/product/stock.ts +2 -0
- package/src/fulfillment/resourceError/index.ts +2 -0
- package/src/fulfillment/resourceError/resourceError.ts +20 -0
- package/src/fulfillment/resourceError/resourceErrorAssignee.ts +9 -0
- package/src/fulfillment/returns/configs.ts +32 -0
- package/src/fulfillment/returns/index.ts +1 -0
- package/src/fulfillment/shipment/package.ts +1 -0
- package/src/fulfillment/shipment/shipment.ts +58 -34
- package/src/fulfillment/shipment/shipmentItem.ts +56 -39
- package/src/fulfillment/shipment/shippingMethod.ts +25 -0
- package/src/logistics/availability.ts +5 -1
- package/src/logistics/index.ts +2 -1
- package/src/logistics/serviceArea.ts +14 -0
- package/src/storage/appointment/appointment.ts +10 -1
- package/src/storage/appointment/appointmentType.ts +4 -0
- package/src/warehouse/asnContainer.ts +8 -0
- package/src/warehouse/carrierTransferPackage.ts +3 -2
- package/src/warehouse/containerRequestLog.ts +7 -2
- package/src/warehouse/index.ts +19 -12
- package/src/warehouse/location.ts +11 -0
- package/src/warehouse/locationActivityLog.ts +1 -0
- package/src/warehouse/locationItem.ts +14 -0
- package/src/warehouse/lotCode.ts +13 -0
- package/src/warehouse/occupiedLocation.ts +5 -0
- package/src/warehouse/organization.ts +7 -2
- package/src/warehouse/packerActivityLog.ts +7 -4
- package/src/warehouse/physicalProperty.ts +9 -0
- package/src/warehouse/pickActivityLog.ts +22 -0
- package/src/warehouse/picksheet.ts +35 -1
- package/src/warehouse/product.ts +3 -0
- package/src/warehouse/productPhysicalProperty.ts +16 -0
- package/src/warehouse/productQuantum.ts +74 -0
- package/src/warehouse/putawayActivityLog.ts +20 -0
- package/src/warehouse/return.ts +5 -0
- package/src/warehouse/rmaContainer.ts +9 -0
- package/src/warehouse/container.ts +0 -16
- package/src/warehouse/palletRequestLog.ts +0 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@secondcloset/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "secondcloset type declaration and definitions",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/SecondCloset/types#readme",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"typescript": "^
|
|
22
|
+
"typescript": "^4.6.3"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
export type ActivityEvent =
|
|
1
|
+
export type ActivityEvent =
|
|
2
|
+
| "all"
|
|
3
|
+
| "asn"
|
|
4
|
+
| "inventory_channel_transfer"
|
|
5
|
+
| "order"
|
|
6
|
+
| "manual"
|
|
7
|
+
| "rma"
|
|
8
|
+
| "system";
|
|
2
9
|
export interface ActivityHistory {
|
|
3
10
|
id: string;
|
|
4
11
|
user?: {
|
|
5
12
|
id: string;
|
|
6
13
|
name?: string;
|
|
7
14
|
is_admin: boolean;
|
|
15
|
+
is_customer: boolean;
|
|
8
16
|
};
|
|
9
17
|
description: string[];
|
|
10
18
|
organization_name?: string;
|
package/src/_common/facility.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Version } from ".";
|
|
2
|
+
import { Common } from "..";
|
|
1
3
|
import { ServiceArea } from "./serviceArea";
|
|
2
4
|
|
|
3
5
|
export type FacilityCode =
|
|
@@ -5,13 +7,19 @@ export type FacilityCode =
|
|
|
5
7
|
| "yyz2"
|
|
6
8
|
| "yyz3"
|
|
7
9
|
| "yyz4"
|
|
10
|
+
| "yyz5"
|
|
8
11
|
| "yvr1"
|
|
9
12
|
| "yvr2"
|
|
10
13
|
| "yow1"
|
|
11
14
|
| "yul1"
|
|
12
15
|
| "lax1"
|
|
13
16
|
| "lax2"
|
|
14
|
-
| "
|
|
17
|
+
| "nyc1"
|
|
18
|
+
| "mia1"
|
|
19
|
+
| "hou1"
|
|
20
|
+
| "yyc1"
|
|
21
|
+
| "atl1"
|
|
22
|
+
| "atl2"
|
|
15
23
|
| "unknown";
|
|
16
24
|
|
|
17
25
|
export type DeprecatedFacilityCode = "yyz1" | "yyz2";
|
|
@@ -19,25 +27,48 @@ export type DeprecatedFacilityCode = "yyz1" | "yyz2";
|
|
|
19
27
|
export type FacilityCity =
|
|
20
28
|
| "Toronto"
|
|
21
29
|
| "Mississauga"
|
|
30
|
+
| "Markham"
|
|
22
31
|
| "Vancouver"
|
|
23
32
|
| "Ottawa"
|
|
24
33
|
| "Montreal"
|
|
25
|
-
| "
|
|
26
|
-
| "
|
|
34
|
+
| "Buena Park"
|
|
35
|
+
| "Santa Fe Springs"
|
|
36
|
+
| "Carlstadt"
|
|
37
|
+
| "Medley"
|
|
38
|
+
| "Houston"
|
|
39
|
+
| "Tucker"
|
|
40
|
+
| "Newnan"
|
|
41
|
+
| "Calgary";
|
|
27
42
|
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
export type Facility<V = Version> = V extends "V1"
|
|
44
|
+
? {
|
|
45
|
+
id: number;
|
|
46
|
+
name: FacilityCode;
|
|
47
|
+
phone: string;
|
|
48
|
+
email: string;
|
|
49
|
+
address: {
|
|
50
|
+
table: {
|
|
51
|
+
street: string;
|
|
52
|
+
city: FacilityCity;
|
|
53
|
+
province: string;
|
|
54
|
+
country: string;
|
|
55
|
+
postal_code: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
service_area: ServiceArea;
|
|
59
|
+
}
|
|
60
|
+
: {
|
|
61
|
+
id: string;
|
|
62
|
+
name: FacilityCode;
|
|
63
|
+
enabled: boolean;
|
|
64
|
+
service_area: ServiceArea;
|
|
65
|
+
address: {
|
|
66
|
+
street: string;
|
|
67
|
+
city: string;
|
|
68
|
+
province: string;
|
|
69
|
+
country: string;
|
|
70
|
+
postal_code: string;
|
|
71
|
+
};
|
|
72
|
+
created_at: string;
|
|
73
|
+
updated_at: string;
|
|
40
74
|
};
|
|
41
|
-
};
|
|
42
|
-
service_area: ServiceArea;
|
|
43
|
-
}
|
package/src/_common/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type Version = "V1" | "V2";
|
|
1
2
|
export * from "./facility";
|
|
2
3
|
export * from "./serviceArea";
|
|
3
4
|
export * from "./user";
|
|
@@ -7,4 +8,4 @@ export * from "./organization";
|
|
|
7
8
|
export * from "./credential";
|
|
8
9
|
export * from "./file";
|
|
9
10
|
export * from "./note";
|
|
10
|
-
export * from "./activityHistory";
|
|
11
|
+
export * from "./activityHistory";
|
|
@@ -2,19 +2,31 @@ import { BaseImage } from "./image";
|
|
|
2
2
|
import { BaseAddress } from "./address";
|
|
3
3
|
import { BaseUser } from "./user";
|
|
4
4
|
import { Carrier } from "../fulfillment";
|
|
5
|
-
import {
|
|
5
|
+
import { Facility } from "./facility";
|
|
6
6
|
|
|
7
7
|
export type OrganizationConfigKey =
|
|
8
8
|
| "default_fulfilled_from"
|
|
9
9
|
| "auto_fulfill_orders"
|
|
10
10
|
| "freightcom_api_username"
|
|
11
|
-
| "freightcom_api_password"
|
|
11
|
+
| "freightcom_api_password"
|
|
12
|
+
| "preferred_return_facility"
|
|
13
|
+
| "disable_partial_fulfillment"
|
|
14
|
+
| "use_default_facility_for_partial_fallback";
|
|
12
15
|
|
|
13
16
|
export interface OrganizationConfig {
|
|
14
17
|
key: OrganizationConfigKey;
|
|
15
18
|
value: string;
|
|
16
19
|
}
|
|
17
20
|
|
|
21
|
+
export type OrganizationShippingConfigKey =
|
|
22
|
+
| "whitelist_carrier"
|
|
23
|
+
| "blacklist_carrier";
|
|
24
|
+
|
|
25
|
+
export interface OrganizationShippingConfig {
|
|
26
|
+
key: OrganizationShippingConfigKey;
|
|
27
|
+
value: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
export interface Permission {
|
|
19
31
|
id: string;
|
|
20
32
|
name: string;
|
|
@@ -68,26 +80,17 @@ export interface Organization extends BaseOrganization {
|
|
|
68
80
|
sc_service_tier?: SCServiceTier;
|
|
69
81
|
};
|
|
70
82
|
configurations_attributes: OrganizationConfig[];
|
|
83
|
+
shipping_configurations_attributes?: OrganizationShippingConfig[];
|
|
71
84
|
permissions: Permission[];
|
|
72
85
|
geofilter_constraints?: GeofilterConstraint[];
|
|
73
86
|
facility_service_areas?: FacilityServiceArea[];
|
|
87
|
+
default_fulfilled_from?: {
|
|
88
|
+
facility: Facility<"V2">;
|
|
89
|
+
organization_regions: Region;
|
|
90
|
+
}[];
|
|
91
|
+
employer_identification_number?: string;
|
|
74
92
|
}
|
|
75
93
|
|
|
76
|
-
interface Facility {
|
|
77
|
-
id: string;
|
|
78
|
-
name: string;
|
|
79
|
-
enabled: boolean;
|
|
80
|
-
service_area: ServiceArea;
|
|
81
|
-
address: {
|
|
82
|
-
street: string;
|
|
83
|
-
city: string;
|
|
84
|
-
province: string;
|
|
85
|
-
country: string;
|
|
86
|
-
postal_code: string;
|
|
87
|
-
};
|
|
88
|
-
created_at: string;
|
|
89
|
-
updated_at: string;
|
|
90
|
-
}
|
|
91
94
|
export interface Region {
|
|
92
95
|
id?: string;
|
|
93
96
|
region_code: string;
|
|
@@ -96,7 +99,7 @@ export interface Region {
|
|
|
96
99
|
country_name: string;
|
|
97
100
|
}
|
|
98
101
|
export interface FacilityServiceArea {
|
|
99
|
-
facility: Facility
|
|
102
|
+
facility: Facility<"V2">;
|
|
100
103
|
default_regions: Region[];
|
|
101
104
|
organization_regions: Region[];
|
|
102
105
|
}
|
package/src/_common/user.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AppointmentType,
|
|
3
|
+
AppointmentSubtype,
|
|
4
|
+
DeliveryType,
|
|
5
|
+
ParcelServiceLevel,
|
|
6
|
+
} from "./appointmentType";
|
|
2
7
|
import { AppointmentStatus } from "./appointmentStatus";
|
|
3
8
|
import { Shipment, ScServiceCode } from "../shipment";
|
|
4
9
|
import { Order } from "../order";
|
|
@@ -6,6 +11,7 @@ import { AppointmentSlot } from "../../storage";
|
|
|
6
11
|
import { BaseImage, BaseNote, ServiceArea } from "../../_common";
|
|
7
12
|
|
|
8
13
|
export interface Appointment {
|
|
14
|
+
air_skip?: boolean;
|
|
9
15
|
appointment_actions: string[];
|
|
10
16
|
arrived_time: string | null;
|
|
11
17
|
cancelled_at: string | null;
|
|
@@ -18,6 +24,10 @@ export interface Appointment {
|
|
|
18
24
|
driver_id: string | null;
|
|
19
25
|
end_time: string | null;
|
|
20
26
|
estimated_time: number;
|
|
27
|
+
facility?: {
|
|
28
|
+
name: string;
|
|
29
|
+
street: string;
|
|
30
|
+
};
|
|
21
31
|
failed_notes: string | null;
|
|
22
32
|
failed_reason: string | null;
|
|
23
33
|
field_ops_notes?: BaseNote[];
|
|
@@ -31,6 +41,7 @@ export interface Appointment {
|
|
|
31
41
|
movers: null;
|
|
32
42
|
num_movers: null;
|
|
33
43
|
number: string;
|
|
44
|
+
parcel_service_level?: ParcelServiceLevel;
|
|
34
45
|
range_of_days_assigned_dates?: {
|
|
35
46
|
assigned_start_datetime: string;
|
|
36
47
|
assigned_end_datetime: string;
|
|
@@ -56,6 +67,26 @@ export interface Appointment {
|
|
|
56
67
|
user_id: string;
|
|
57
68
|
user_lastname: string;
|
|
58
69
|
verification_images?: BaseImage[];
|
|
70
|
+
delivery_type?: DeliveryType;
|
|
71
|
+
shipping_labels?: LastMileShippingLabel[];
|
|
72
|
+
signature_required?: boolean;
|
|
73
|
+
estimated_arrival_time_window_start: string;
|
|
74
|
+
estimated_arrival_time_window_end: string;
|
|
75
|
+
package_weights: {
|
|
76
|
+
weight_unit: "lb" | "kg";
|
|
77
|
+
weight_value: number;
|
|
78
|
+
}[] | null;
|
|
79
|
+
delivery_notes: DeliveryNote[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface DeliveryNote {
|
|
83
|
+
id: string;
|
|
84
|
+
appointment_id: string;
|
|
85
|
+
details: string | null;
|
|
86
|
+
access: string | null;
|
|
87
|
+
created_at: string;
|
|
88
|
+
updated_at: string;
|
|
89
|
+
deleted_at: string | null;
|
|
59
90
|
}
|
|
60
91
|
|
|
61
92
|
export interface Location {
|
|
@@ -76,3 +107,11 @@ export interface Location {
|
|
|
76
107
|
service_area: ServiceArea | null;
|
|
77
108
|
updated_at: string;
|
|
78
109
|
}
|
|
110
|
+
|
|
111
|
+
interface LastMileShippingLabel {
|
|
112
|
+
id: string;
|
|
113
|
+
label_id?: string;
|
|
114
|
+
tracking_number?: string;
|
|
115
|
+
tracking_url?: string;
|
|
116
|
+
label_download?: string;
|
|
117
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FacilityCode } from "../../_common/facility";
|
|
2
|
+
import { Channel } from "../inventory";
|
|
2
3
|
import { ASNItem } from "./asnItem";
|
|
3
4
|
|
|
4
5
|
export type ASNStatus =
|
|
@@ -65,4 +66,6 @@ export interface ASN {
|
|
|
65
66
|
deleted_at?: string;
|
|
66
67
|
items_attributes: ASNItem[];
|
|
67
68
|
timeline?: TimelineEvent[];
|
|
69
|
+
organization_id?: string;
|
|
70
|
+
inventory_channel?: Channel["name"];
|
|
68
71
|
}
|
|
@@ -5,10 +5,13 @@ export interface ASNItem {
|
|
|
5
5
|
product_sku: string;
|
|
6
6
|
product_upc?: string;
|
|
7
7
|
product_scid: string;
|
|
8
|
+
product_tracks_lot_numbers?: boolean;
|
|
9
|
+
product_tracks_expiry_date?: boolean;
|
|
8
10
|
expected_quantity: number;
|
|
9
11
|
received_quantity?: number;
|
|
10
12
|
damaged_quantity?: number;
|
|
11
13
|
lot_number?: string;
|
|
14
|
+
expiry_date?: string;
|
|
12
15
|
created_at: string;
|
|
13
16
|
updated_at: string;
|
|
14
17
|
deleted_at: string;
|
package/src/fulfillment/index.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Product } from "../product";
|
|
2
|
+
|
|
3
|
+
type InventoryOrder = { id: string; order_id: string; quantity: number };
|
|
4
|
+
export interface Inventory {
|
|
5
|
+
product_id: Product["id"];
|
|
6
|
+
available_for_sale: number;
|
|
7
|
+
on_hand: number;
|
|
8
|
+
reserved: number;
|
|
9
|
+
to_be_reserved: number;
|
|
10
|
+
on_hold: number;
|
|
11
|
+
damaged: number;
|
|
12
|
+
backorder: number;
|
|
13
|
+
incoming: number;
|
|
14
|
+
reserved_orders: InventoryOrder[];
|
|
15
|
+
orders_to_be_reserved: InventoryOrder[];
|
|
16
|
+
}
|
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
BaseUser,
|
|
7
7
|
Organization,
|
|
8
8
|
File,
|
|
9
|
+
Version,
|
|
9
10
|
} from "../../_common";
|
|
10
11
|
import { OrderItem } from "./orderItem";
|
|
12
|
+
import { Channel } from "../inventory";
|
|
11
13
|
|
|
12
14
|
export type ShipmentTag =
|
|
13
15
|
| "ready_to_fulfill"
|
|
@@ -16,10 +18,14 @@ export type ShipmentTag =
|
|
|
16
18
|
| "items_fulfilled"
|
|
17
19
|
| "processing_return_items"
|
|
18
20
|
| "items_returned"
|
|
21
|
+
| "returned_to_sender"
|
|
22
|
+
| "pending_return_to_sender"
|
|
19
23
|
| "items_removed"
|
|
20
24
|
| "pending_inventory_receiving"
|
|
21
25
|
| "items_partially_fulfilled"
|
|
22
|
-
| "customer_booking"
|
|
26
|
+
| "customer_booking"
|
|
27
|
+
| "pending_customer_pickup"
|
|
28
|
+
| "items_picked_up_by_customer";
|
|
23
29
|
|
|
24
30
|
export type OrderPlatform =
|
|
25
31
|
| "manual"
|
|
@@ -30,7 +36,7 @@ export type OrderPlatform =
|
|
|
30
36
|
| "shipstaion"
|
|
31
37
|
| "external_api";
|
|
32
38
|
|
|
33
|
-
interface
|
|
39
|
+
export interface FulfillmentOrderAddress extends BaseAddress {
|
|
34
40
|
customer_id: string;
|
|
35
41
|
contact_name: string;
|
|
36
42
|
customer_phone_number: string | null;
|
|
@@ -40,40 +46,44 @@ interface Address extends BaseAddress {
|
|
|
40
46
|
updated_at: string;
|
|
41
47
|
}
|
|
42
48
|
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
49
|
+
export type Order<V extends Version = "V1"> = V extends "V1"
|
|
50
|
+
? {
|
|
51
|
+
id: string;
|
|
52
|
+
order_id: string;
|
|
53
|
+
external_order_number: string;
|
|
54
|
+
external_order_id: string | null;
|
|
55
|
+
notes: string;
|
|
56
|
+
internal_notes?: string;
|
|
57
|
+
platform: OrderPlatform;
|
|
58
|
+
external_platform_version: number | null;
|
|
59
|
+
parcel_type: string;
|
|
60
|
+
cancelled: boolean;
|
|
61
|
+
fulfilled_from: FacilityCode;
|
|
62
|
+
client_type: string | null;
|
|
63
|
+
insurance_value: number;
|
|
64
|
+
shipping_service: string | null;
|
|
65
|
+
signature_required?: boolean;
|
|
66
|
+
customer: Customer;
|
|
67
|
+
address: FulfillmentOrderAddress;
|
|
68
|
+
created_at: string;
|
|
69
|
+
updated_at: string;
|
|
70
|
+
organization: Organization;
|
|
71
|
+
overdue: boolean;
|
|
72
|
+
user: BaseUser;
|
|
73
|
+
status?: string;
|
|
74
|
+
shipment_tags: ShipmentTag[];
|
|
75
|
+
shipments: Shipment<V>[];
|
|
76
|
+
items: OrderItem<V>[];
|
|
77
|
+
files: File[];
|
|
78
|
+
stock_status:
|
|
79
|
+
| "in_stock"
|
|
80
|
+
| "partially_in_stock"
|
|
81
|
+
| "out_of_stock"
|
|
82
|
+
| "unknown_stock";
|
|
83
|
+
on_hold: boolean;
|
|
84
|
+
on_hold_at: string;
|
|
85
|
+
requested_service_code?: ScServiceCode;
|
|
86
|
+
has_errors: boolean;
|
|
87
|
+
sales_channel?: Channel["name"];
|
|
88
|
+
}
|
|
89
|
+
: Omit<Order<"V1">, "items" | "shipments">;
|
|
@@ -1,16 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Version } from "../../_common";
|
|
2
|
+
import { BaseProduct, Product } from "../product";
|
|
2
3
|
import { ShipmentActionType } from "../shipment";
|
|
3
4
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
+
reverse_logistics_item_ids: OrderItem<"V1">["id"][];
|
|
30
|
+
setup_item_ids: OrderItem<"V1">["id"][];
|
|
31
|
+
};
|
|
32
|
+
removed_items: {
|
|
33
|
+
removed_reason: string;
|
|
34
|
+
quantity: number;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
@@ -3,14 +3,22 @@ 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
|
-
|
|
10
|
+
type: "base" | "kit";
|
|
11
|
+
active: boolean;
|
|
12
|
+
height: number;
|
|
13
|
+
length: number;
|
|
14
|
+
width: number;
|
|
15
|
+
weight: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Product extends Omit<BaseProduct, "type"> {
|
|
19
|
+
organization_id: string;
|
|
11
20
|
description: string;
|
|
12
21
|
platform: string;
|
|
13
|
-
active: boolean;
|
|
14
22
|
fragile: boolean;
|
|
15
23
|
dangerous: boolean;
|
|
16
24
|
liquid: boolean;
|
|
@@ -18,10 +26,6 @@ export interface BaseProduct {
|
|
|
18
26
|
tracks_lot_numbers: boolean;
|
|
19
27
|
contains_battery: boolean;
|
|
20
28
|
external_product_id: string | null;
|
|
21
|
-
height: number;
|
|
22
|
-
length: number;
|
|
23
|
-
width: number;
|
|
24
|
-
weight: number;
|
|
25
29
|
weight_unit: string;
|
|
26
30
|
usd_value: number;
|
|
27
31
|
value: number;
|
|
@@ -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: "
|
|
39
|
+
product_type: BaseProduct["type"];
|
|
36
40
|
stocks?: Stock[];
|
|
37
41
|
deleted_at: string;
|
|
38
42
|
created_at: string;
|
|
@@ -54,23 +58,18 @@ export interface BaseProduct {
|
|
|
54
58
|
return_days?: number;
|
|
55
59
|
insurance_required: boolean;
|
|
56
60
|
insurance_value: number | null;
|
|
61
|
+
has_errors: boolean;
|
|
57
62
|
under_conversion: boolean;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export interface Product extends BaseProduct {
|
|
61
|
-
base_products?: BaseProduct[];
|
|
63
|
+
base_products?: Product[];
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
export interface PackagingLevel {
|
|
65
67
|
id?: string;
|
|
66
68
|
product_id?: string;
|
|
67
|
-
product: {
|
|
68
|
-
id: string;
|
|
69
|
-
sku: string;
|
|
69
|
+
product: BaseProduct & {
|
|
70
70
|
upc: string;
|
|
71
|
-
scid: string;
|
|
72
|
-
name: string;
|
|
73
71
|
tracks_lot_numbers: boolean;
|
|
72
|
+
tracks_expiry_date: boolean;
|
|
74
73
|
};
|
|
75
74
|
level: "single_item" | "inner_pack" | "master_pack" | "pallet";
|
|
76
75
|
base_product_quantity: number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ResourceErrorAssignee } from "./resourceErrorAssignee";
|
|
2
|
+
|
|
3
|
+
export type ResourceErrorType = "order" | "product";
|
|
4
|
+
|
|
5
|
+
export interface ResourceError {
|
|
6
|
+
id: string;
|
|
7
|
+
resource_id: string;
|
|
8
|
+
resource_type: ResourceErrorType;
|
|
9
|
+
normalized_resource_type: ResourceErrorType;
|
|
10
|
+
issue: string;
|
|
11
|
+
issue_reason: string;
|
|
12
|
+
issue_category: string;
|
|
13
|
+
origin: string;
|
|
14
|
+
created_at: string;
|
|
15
|
+
updated_at: string;
|
|
16
|
+
caused_by_id?: string;
|
|
17
|
+
caused_by_type?: string;
|
|
18
|
+
assignee?: ResourceErrorAssignee | null;
|
|
19
|
+
deleted_at?: string | null;
|
|
20
|
+
}
|