@secondcloset/types 2.5.8-beta-epic29357-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.
Files changed (76) hide show
  1. package/.vscode/settings.json +5 -0
  2. package/README.md +13 -0
  3. package/package.json +24 -0
  4. package/src/_common/address.ts +19 -0
  5. package/src/_common/credential.ts +12 -0
  6. package/src/_common/facility.ts +38 -0
  7. package/src/_common/file.ts +7 -0
  8. package/src/_common/image.ts +7 -0
  9. package/src/_common/index.ts +9 -0
  10. package/src/_common/note.ts +9 -0
  11. package/src/_common/organization.ts +63 -0
  12. package/src/_common/serviceArea.ts +1 -0
  13. package/src/_common/user.ts +26 -0
  14. package/src/fulfillment/appointment/appointment.ts +77 -0
  15. package/src/fulfillment/appointment/appointmentStatus.ts +21 -0
  16. package/src/fulfillment/appointment/appointmentType.ts +7 -0
  17. package/src/fulfillment/appointment/index.ts +3 -0
  18. package/src/fulfillment/asn/asn.ts +68 -0
  19. package/src/fulfillment/asn/asnItem.ts +15 -0
  20. package/src/fulfillment/asn/index.ts +2 -0
  21. package/src/fulfillment/index.ts +6 -0
  22. package/src/fulfillment/order/customer.ts +23 -0
  23. package/src/fulfillment/order/index.ts +3 -0
  24. package/src/fulfillment/order/order.ts +79 -0
  25. package/src/fulfillment/order/orderItem.ts +16 -0
  26. package/src/fulfillment/product/index.ts +2 -0
  27. package/src/fulfillment/product/product.ts +86 -0
  28. package/src/fulfillment/product/stock.ts +21 -0
  29. package/src/fulfillment/shipment/carrier.ts +17 -0
  30. package/src/fulfillment/shipment/index.ts +7 -0
  31. package/src/fulfillment/shipment/package.ts +32 -0
  32. package/src/fulfillment/shipment/packageIssue.ts +11 -0
  33. package/src/fulfillment/shipment/shipment.ts +56 -0
  34. package/src/fulfillment/shipment/shipmentItem.ts +42 -0
  35. package/src/fulfillment/shipment/shippingMethod.ts +136 -0
  36. package/src/fulfillment/warehouseReceivingOrder/incomingShipment.ts +35 -0
  37. package/src/fulfillment/warehouseReceivingOrder/index.ts +2 -0
  38. package/src/fulfillment/warehouseReceivingOrder/warehouseReceivingOrder.ts +34 -0
  39. package/src/index.ts +5 -0
  40. package/src/logistics/availability.ts +18 -0
  41. package/src/logistics/index.ts +2 -0
  42. package/src/logistics/shippingRate.ts +19 -0
  43. package/src/storage/address.ts +9 -0
  44. package/src/storage/appointment/appointment.ts +100 -0
  45. package/src/storage/appointment/appointmentItem.ts +34 -0
  46. package/src/storage/appointment/appointmentStatus.ts +21 -0
  47. package/src/storage/appointment/appointmentType.ts +8 -0
  48. package/src/storage/appointment/index.ts +4 -0
  49. package/src/storage/availability.ts +19 -0
  50. package/src/storage/categoryItem.ts +12 -0
  51. package/src/storage/closet.ts +16 -0
  52. package/src/storage/index.ts +8 -0
  53. package/src/storage/inventoryItem.ts +41 -0
  54. package/src/storage/order/index.ts +2 -0
  55. package/src/storage/order/order.ts +29 -0
  56. package/src/storage/order/orderItem.ts +26 -0
  57. package/src/storage/product.ts +26 -0
  58. package/src/warehouse/asnProcessLog.ts +15 -0
  59. package/src/warehouse/bin.ts +7 -0
  60. package/src/warehouse/index.ts +17 -0
  61. package/src/warehouse/location.ts +20 -0
  62. package/src/warehouse/locationItem.ts +23 -0
  63. package/src/warehouse/locationTemplate.ts +8 -0
  64. package/src/warehouse/manualItem.ts +20 -0
  65. package/src/warehouse/organization.ts +31 -0
  66. package/src/warehouse/pallet.ts +11 -0
  67. package/src/warehouse/palletRequestLog.ts +15 -0
  68. package/src/warehouse/product.ts +14 -0
  69. package/src/warehouse/return.ts +78 -0
  70. package/src/warehouse/shipmentProductsTracking.ts +18 -0
  71. package/src/warehouse/stock.ts +7 -0
  72. package/src/warehouse/supply.ts +41 -0
  73. package/src/warehouse/supplyStock.ts +10 -0
  74. package/src/warehouse/supplyTransaction.ts +14 -0
  75. package/src/warehouse/transaction.ts +25 -0
  76. package/tsconfig.json +17 -0
@@ -0,0 +1,8 @@
1
+ export * from "./address";
2
+ export * from "./appointment";
3
+ export * from "./order";
4
+ export * from "./availability";
5
+ export * from "./categoryItem";
6
+ export * from "./closet";
7
+ export * from "./inventoryItem";
8
+ export * from "./product";
@@ -0,0 +1,41 @@
1
+ import { CategoryItem } from "./categoryItem";
2
+ import { BaseUser, BaseImage } from "../_common";
3
+
4
+ export interface InventoryItemImage extends BaseImage {
5
+ deleted_at: string;
6
+ resource_id: string;
7
+ resource_type: string;
8
+ }
9
+
10
+ export interface InventoryItem {
11
+ id: string;
12
+ status: string;
13
+ name: string;
14
+ nickname: string;
15
+ image_url: string;
16
+ item_id: string;
17
+ notes: string;
18
+ stripe_plan_id: string;
19
+ stripe_subscription_id: string;
20
+ stripe_subscription_item_id: string;
21
+ created_at: string;
22
+ description: string;
23
+ item_type: string;
24
+ last_pick_up_address_id: string;
25
+ last_drop_off_address_id: string;
26
+ closet_id: string;
27
+ barcode: string;
28
+ qr_code: string;
29
+ customer: BaseUser;
30
+ orders: any[];
31
+ images: InventoryItemImage[];
32
+ category_item: CategoryItem;
33
+ internal_status: string;
34
+ internal_notes: string;
35
+ admin_images: string;
36
+ has_parts: boolean;
37
+ material: string;
38
+ color: string;
39
+ size: string;
40
+ brand: string;
41
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./order";
2
+ export * from "./orderItem";
@@ -0,0 +1,29 @@
1
+ import { OrderItem } from "./orderItem";
2
+ import { Appointment } from "../appointment";
3
+
4
+ export interface Order {
5
+ id?: string;
6
+ number: string;
7
+ user_id: string;
8
+ kind: string;
9
+ temporary: boolean;
10
+ status: string;
11
+ created_at?: string;
12
+ updated_at?: string;
13
+ fragile: boolean;
14
+ heavy: boolean;
15
+ immediate: boolean;
16
+ notes?: string;
17
+ bulky_order_only: boolean;
18
+ billing_type: string;
19
+ space_order: boolean;
20
+ user_code: string;
21
+ subtotal: number;
22
+ tax_percentage: number;
23
+ total: number;
24
+ items: OrderItem[];
25
+ user_email: string;
26
+ user_firstname: string;
27
+ user_lastname: string;
28
+ appointments: Appointment[];
29
+ }
@@ -0,0 +1,26 @@
1
+ export interface OrderItem {
2
+ name: string;
3
+ stripe_id: string;
4
+ quantity: number;
5
+ price: number;
6
+ recurring: true;
7
+ type: string;
8
+ item_type: string;
9
+ item_id: string;
10
+ description: string;
11
+ barcode: string;
12
+ category_id?: string;
13
+ category_name?: string;
14
+ category_description?: string;
15
+ category_volume?: string;
16
+ qr_code?: string;
17
+ status?: string;
18
+ internal_status: string;
19
+ nickname?: string;
20
+ material?: string;
21
+ color?: string;
22
+ size?: string;
23
+ brand?: string;
24
+ images: string[];
25
+ metadata?: any;
26
+ }
@@ -0,0 +1,26 @@
1
+ type TrueOrFalse = "true" | "false";
2
+
3
+ interface Metadata {
4
+ group: string;
5
+ hidden: TrueOrFalse;
6
+ inStock: TrueOrFalse;
7
+ adminHidden: TrueOrFalse;
8
+ movingFees: TrueOrFalse;
9
+ images: string;
10
+ size: string;
11
+ spacePlan: TrueOrFalse;
12
+ dropoffable: TrueOrFalse;
13
+ retrievable: TrueOrFalse;
14
+ sierraHidden: TrueOrFalse;
15
+ webHidden: TrueOrFalse;
16
+ pricing_segment: string;
17
+ fr: string;
18
+ }
19
+
20
+ export interface Product {
21
+ id: string;
22
+ category: string;
23
+ name: string;
24
+ price: number;
25
+ metadata: Metadata;
26
+ }
@@ -0,0 +1,15 @@
1
+ export type ASNProcessAction = "receive" | "set_damage" | "reset" | "complete";
2
+
3
+ export interface ASNProcessLog {
4
+ id: string;
5
+ user_email: string;
6
+ external_asn_id: string;
7
+ external_asn_number: string;
8
+ external_product_id?: string;
9
+ product_name?: string;
10
+ product_sku?: string;
11
+ product_upc?: string;
12
+ quantity: number;
13
+ action: ASNProcessAction;
14
+ created_at: string;
15
+ }
@@ -0,0 +1,7 @@
1
+ import { LocationItem } from "./locationItem";
2
+
3
+ export interface Bin {
4
+ id: string;
5
+ location_items?: LocationItem[];
6
+ created_at: string;
7
+ }
@@ -0,0 +1,17 @@
1
+ export * from "./asnProcessLog";
2
+ export * from "./bin";
3
+ export * from "./location";
4
+ export * from "./locationItem";
5
+ export * from "./locationTemplate";
6
+ export * from "./organization";
7
+ export * from "./pallet";
8
+ export * from "./product";
9
+ export * from "./shipmentProductsTracking";
10
+ export * from "./supply";
11
+ export * from "./supplyStock";
12
+ export * from "./supplyTransaction";
13
+ export * from "./transaction";
14
+ export * from "./palletRequestLog";
15
+ export * from "./manualItem";
16
+ export * from "./return";
17
+ export * from "./stock";
@@ -0,0 +1,20 @@
1
+ import { LocationTemplate } from "./locationTemplate";
2
+ import { LocationItem } from "./locationItem";
3
+ import { FacilityCode } from "../_common";
4
+
5
+ export enum LocationType {
6
+ SHELF = "SHELF",
7
+ PACKING_STATION = "PACKING_STATION",
8
+ RACKING = "RACKING",
9
+ CART = "CART",
10
+ PALLET_ZONE = "PALLET_ZONE",
11
+ }
12
+
13
+ export interface Location {
14
+ code: string;
15
+ facility: FacilityCode;
16
+ type: LocationType;
17
+ location_template_id: string;
18
+ location_template?: LocationTemplate;
19
+ location_items?: LocationItem[];
20
+ }
@@ -0,0 +1,23 @@
1
+ import { Product } from "./product";
2
+ import { Location } from "./location";
3
+ import { Pallet } from "./pallet";
4
+ import { Bin } from "./bin";
5
+ import { ManualItem } from "./manualItem";
6
+
7
+ export interface LocationItem {
8
+ id: string;
9
+ lot_number?: string;
10
+ quantity: number;
11
+ product_id?: string;
12
+ product?: Product;
13
+ manual_item_id?: string;
14
+ manual_item?: ManualItem;
15
+ location_code: string;
16
+ location?: Location;
17
+ pallet_id: string;
18
+ pallet?: Pallet;
19
+ bin_id: string;
20
+ bin: Bin;
21
+ created_at: string;
22
+ updated_at: string;
23
+ }
@@ -0,0 +1,8 @@
1
+ import { Location } from "./location";
2
+
3
+ export interface LocationTemplate {
4
+ id: string;
5
+ format: string;
6
+ name: string;
7
+ locations?: Location[];
8
+ }
@@ -0,0 +1,20 @@
1
+ import { Organization } from "./organization";
2
+
3
+ export type ManualItemType =
4
+ | "structube_pallet"
5
+ | "ikea_pallet"
6
+ | "rove_pallet"
7
+ | "other";
8
+
9
+ export interface ManualItem {
10
+ id: string;
11
+ code: string;
12
+ type: ManualItemType;
13
+ customer_name: string;
14
+ order_number?: string;
15
+ note?: string;
16
+ created_at: string;
17
+ updated_at: string;
18
+ organization?: Organization;
19
+ organization_id?: string;
20
+ }
@@ -0,0 +1,31 @@
1
+ import { Product } from "./product";
2
+ import { Supply } from "./supply";
3
+ import { ShipmentProductsTracking } from "./shipmentProductsTracking";
4
+
5
+ export interface Organization {
6
+ id: string;
7
+ name: string;
8
+ products?: Product[];
9
+ supplies?: Supply[];
10
+ shipment_products_trackings?: ShipmentProductsTracking[];
11
+ }
12
+
13
+ export enum OrganizationConfigKey {
14
+ ENABLE_SCAN_ITEMS = "ENABLE_SCAN_ITEMS",
15
+ OPENED_GOOD_CONDITION_SHIP_TO_ADDRESS = "OPENED_GOOD_CONDITION_SHIP_TO_ADDRESS",
16
+ SHIP_TO_ME = "SHIP_TO_ME",
17
+ OPENED_GOOD_CONDITION_INSTRUCTION = "OPENED_GOOD_CONDITION_INSTRUCTION",
18
+ DAMAGED_CONDITION_INSTRUCTION = "DAMAGED_CONDITION_INSTRUCTION",
19
+ GOOD_CONDITION_DAMAGED_PACKAGING_INSTRUCTION = "GOOD_CONDITION_DAMAGED_PACKAGING_INSTRUCTION",
20
+ RTS_INSTRUCTION = "RTS_INSTRUCTION",
21
+ ENABLE_SEND_EMAIL_TO_CUSTOMERS = "ENABLE_SEND_EMAIL_TO_CUSTOMERS",
22
+ }
23
+ export interface OrganizationConfig {
24
+ id: string;
25
+ key: OrganizationConfigKey;
26
+ value: string;
27
+ organization_id: string;
28
+ organization?: Organization;
29
+ created_at: string;
30
+ updated_at: string;
31
+ }
@@ -0,0 +1,11 @@
1
+ import { LocationItem } from "./locationItem";
2
+
3
+ export enum PalletType {
4
+ SINGLE = "single",
5
+ DOUBLE = "double",
6
+ }
7
+ export interface Pallet {
8
+ id: string;
9
+ type: PalletType;
10
+ location_items?: LocationItem[];
11
+ }
@@ -0,0 +1,15 @@
1
+ export enum PalletRequestStatus {
2
+ FAILED = "failed",
3
+ SUCCESS = "success",
4
+ IN_PROGRESS = "in_progress",
5
+ }
6
+
7
+ export interface PalletRequestLog {
8
+ id: string;
9
+ status: PalletRequestStatus;
10
+ user_email: string;
11
+ file_link?: string;
12
+ count: number;
13
+ fail_reason?: string;
14
+ created_at: string;
15
+ }
@@ -0,0 +1,14 @@
1
+ import { LocationItem } from "./locationItem";
2
+ import { Organization } from "./organization";
3
+ import { Transaction } from "./transaction";
4
+
5
+ export interface Product {
6
+ id: string;
7
+ sku: string;
8
+ upc: string;
9
+ name: string;
10
+ organization_id: string;
11
+ organization?: Organization;
12
+ location_item?: LocationItem;
13
+ transaction?: Transaction;
14
+ }
@@ -0,0 +1,78 @@
1
+ import { Organization } from "./organization";
2
+
3
+ export enum ReturnItemCondition {
4
+ RESELLABLE = "resellable",
5
+ UNSELLABLE = "unsellable",
6
+ OTHER = "other",
7
+ }
8
+
9
+ export enum ReturnType {
10
+ RTS = "RTS",
11
+ REGULAR = "REGULAR",
12
+ }
13
+
14
+ export enum ReturnStatus {
15
+ READY_TO_PROCESS = "READY_TO_PROCESS",
16
+ NEEDS_REVIEW = "NEEDS_REVIEW",
17
+ ARRIVED = "ARRIVED",
18
+ PROCESSING = "PROCESSING",
19
+ REQUESTED = "REQUESTED",
20
+ ON_HOLD = "ON_HOLD",
21
+ COMPLETED = "COMPLETED",
22
+ CANCELLED = "CANCELLED",
23
+ TO_BE_RESHIPPED = "TO_BE_RESHIPPED",
24
+ }
25
+
26
+ export interface ReturnPhoto {
27
+ id: string;
28
+ return_id?: string;
29
+ photo_link: string;
30
+ }
31
+
32
+ export interface ReturnItem {
33
+ id: string;
34
+ name: string;
35
+ external_product_id: string;
36
+ sku?: string;
37
+ upc?: string;
38
+ condition?: string;
39
+ condition_notes?: string;
40
+ reason?: string;
41
+ reason_notes?: string;
42
+ }
43
+
44
+ export interface ReturnAddress {
45
+ name: string;
46
+ phone_number: string;
47
+ address_1: string;
48
+ address_2?: string;
49
+ city: string;
50
+ province: string;
51
+ postal_code: string;
52
+ country: string;
53
+ }
54
+
55
+ export interface Return {
56
+ id: string;
57
+ rma?: string;
58
+ tracking_number?: string;
59
+ tracking_url?: string;
60
+ label_url?: string;
61
+ carrier_logo?: string;
62
+ external_order_number: string;
63
+ reship_external_order_number?: string;
64
+ status: ReturnStatus;
65
+ type: ReturnType;
66
+ shipping_from?: ReturnAddress;
67
+ carrier?: string;
68
+ organization: Organization;
69
+ photos?: ReturnPhoto[];
70
+ return_items?: ReturnItem[];
71
+ reason?: string;
72
+ reason_notes?: string;
73
+ external_notes?: string;
74
+ internal_notes?: string;
75
+ order_date?: string;
76
+ created_at: string;
77
+ updated_at: string;
78
+ }
@@ -0,0 +1,18 @@
1
+ import { Organization } from "./organization";
2
+
3
+ export interface ShipmentProductsTracking {
4
+ id: string;
5
+ external_shipment_id: string;
6
+ external_order_id: string;
7
+ external_product_id: string;
8
+ lot_number: string;
9
+ serial_number: string;
10
+ product_name?: string;
11
+ product_sku?: string;
12
+ product_upc?: string;
13
+ quantity: number;
14
+ organization_id: string;
15
+ organization?: Organization;
16
+ created_at: string;
17
+ user_email: string;
18
+ }
@@ -0,0 +1,7 @@
1
+ import { Product } from "./product";
2
+ import { FacilityCode } from "../_common";
3
+ export interface Stock {
4
+ on_hand_quantity: number;
5
+ product: Product;
6
+ facility: FacilityCode;
7
+ }
@@ -0,0 +1,41 @@
1
+ import { Organization } from "./organization";
2
+ import { SupplyStock } from "./supplyStock";
3
+ import { SupplyTransaction } from "./supplyTransaction";
4
+
5
+ export enum DimensionUnitType {
6
+ in = "in",
7
+ ft = "ft",
8
+ cm = "cm",
9
+ m = "m",
10
+ }
11
+
12
+ export enum WeightUnitType {
13
+ lb = "lb",
14
+ oz = "oz",
15
+ kg = "kg",
16
+ g = "g",
17
+ }
18
+
19
+ export enum SupplyType {
20
+ BOX = "BOX",
21
+ PACKAGING = "PACKAGING",
22
+ }
23
+
24
+ export interface Supply {
25
+ id: string;
26
+ name: string;
27
+ length: number;
28
+ width: number;
29
+ height: number;
30
+ weight: number;
31
+ weight_unit?: WeightUnitType;
32
+ dimension_unit?: DimensionUnitType;
33
+ active: boolean;
34
+ type: SupplyType;
35
+ created_at: string;
36
+ updated_at: string;
37
+ organization_id: string;
38
+ organization?: Organization;
39
+ supply_stock?: SupplyStock[];
40
+ supply_transactions?: SupplyTransaction[];
41
+ }
@@ -0,0 +1,10 @@
1
+ import { Supply } from "./supply";
2
+ import { FacilityCode } from "../_common/facility";
3
+
4
+ export interface SupplyStock {
5
+ id: string;
6
+ supply_id: string;
7
+ supply?: Supply;
8
+ quantity: number;
9
+ facility: FacilityCode;
10
+ }
@@ -0,0 +1,14 @@
1
+ import { FacilityCode } from "../_common/facility";
2
+ import { Supply } from "./supply";
3
+
4
+ export interface SupplyTransaction {
5
+ id: string;
6
+ supply_id: string;
7
+ delta: number;
8
+ facility: FacilityCode;
9
+ external_shipment_id: string;
10
+ external_order_id: string;
11
+ user_email: string;
12
+ created_at: string;
13
+ supply?: Supply;
14
+ }
@@ -0,0 +1,25 @@
1
+ import { Product } from "./product";
2
+
3
+ export enum TransactionActionType {
4
+ MOVE = "MOVE",
5
+ RECEIVE = "RECEIVE",
6
+ CREATE_PALLET = "CREATE_PALLET",
7
+ BREAK_DOWN = "BREAK_DOWN",
8
+ AUDIT = "AUDIT",
9
+ }
10
+
11
+ export interface Transaction {
12
+ id: string;
13
+ from_location_code: string;
14
+ to_location_code: string;
15
+ product_id: string;
16
+ pallet_id: string;
17
+ from_bin_id: string;
18
+ to_bin_id: string;
19
+ quantity: number;
20
+ lot_number: string;
21
+ created_at: string;
22
+ user_email: string;
23
+ action: TransactionActionType;
24
+ product?: Product;
25
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Basic Options */
4
+ "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
5
+ "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
6
+ "declaration": true /* Generates corresponding '.d.ts' file. */,
7
+ "sourceMap": true /* Generates corresponding '.map' file. */,
8
+ "outDir": "./dist" /* Redirect output structure to the directory. */,
9
+
10
+ /* Strict Type-Checking Options */
11
+ "strict": true /* Enable all strict type-checking options. */,
12
+
13
+ /* Module Resolution Options */
14
+ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
15
+ },
16
+ "include": ["./src/**/*"]
17
+ }