chore: Added TSDocs for the Fulfillment Module (#6912)

Added TSDocs for the Fulfillment Module
This commit is contained in:
Shahed Nasser
2024-04-08 11:17:38 +03:00
committed by GitHub
parent 2a0e010f73
commit ef39985d66
25 changed files with 3352 additions and 227 deletions

View File

@@ -1,3 +1,6 @@
/**
* The accepted values for the shipping rule option's operator.
*/
export type RuleOperatorType =
| "in"
| "eq"

View File

@@ -1,18 +1,84 @@
/**
* The fulfillment address details.
*/
export interface FulfillmentAddressDTO {
/**
* The ID of the address.
*/
id: string
/**
* The associated fulfillment's ID.
*/
fulfillment_id: string | null
/**
* The company of the address.
*/
company: string | null
/**
* The first name of the address.
*/
first_name: string | null
/**
* The last name of the address.
*/
last_name: string | null
/**
* The first line of the address.
*/
address_1: string | null
/**
* The second line of the address.
*/
address_2: string | null
/**
* The city of the address.
*/
city: string | null
/**
* The ISO 2 character country code of the address.
*/
country_code: string | null
/**
* The province of the address.
*/
province: string | null
/**
* The postal code of the address.
*/
postal_code: string | null
/**
* The phone of the address.
*/
phone: string | null
/**
* Holds custom data in key-value pairs.
*/
metadata: Record<string, unknown> | null
/**
* The creation date of the address.
*/
created_at: Date
/**
* The update date of the address.
*/
updated_at: Date
/**
* The deletion date of the address.
*/
deleted_at: Date | null
}

View File

@@ -1,16 +1,66 @@
import { FulfillmentDTO } from "./fulfillment"
/**
* The fulfillment item details.
*/
export interface FulfillmentItemDTO {
/**
* The ID of the fulfillment item.
*/
id: string
/**
* The title of the fulfillment item.
*/
title: string
/**
* The quantity of the fulfillment item.
*/
quantity: number
/**
* The sku of the fulfillment item.
*/
sku: string
/**
* The barcode of the fulfillment item.
*/
barcode: string
/**
* The associated line item's ID.
*/
line_item_id: string | null
/**
* The associated inventory item's ID.
*/
inventory_item_id: string | null
/**
* The associated fulfillment's ID.
*/
fulfillment_id: string
/**
* The associated fulfillment.
*/
fulfillment: FulfillmentDTO
/**
* The creation date of the fulfillment item.
*/
created_at: Date
/**
* The update date of the fulfillment item.
*/
updated_at: Date
/**
* The deletion date of the fulfillment item.
*/
deleted_at: Date | null
}

View File

@@ -1,13 +1,51 @@
import { FulfillmentDTO } from "./fulfillment"
/**
* The fulfillment label details.
*/
export interface FulfillmentLabelDTO {
/**
* The ID of the fulfillment label.
*/
id: string
/**
* The tracking number of the fulfillment label.
*/
tracking_number: string
/**
* The tracking URL of the fulfillment label.
*/
tracking_url: string
/**
* The label's URL.
*/
label_url: string
/**
* The associated fulfillment's ID.
*/
fulfillment_id: string
/**
* The associated fulfillment.
*/
fulfillment: FulfillmentDTO
/**
* The creation date of the fulfillment label.
*/
created_at: Date
/**
* The update date of the fulfillment label.
*/
updated_at: Date
/**
* The deletion date of the fulfillment label.
*/
deleted_at: Date | null
}

View File

@@ -1,11 +1,41 @@
import { ShippingOptionDTO } from "./shipping-option"
/**
* The fulfillment provider details.
*/
export interface FulfillmentProviderDTO {
/**
* The ID of the fulfillment provider.
*/
id: string
/**
* The name of the fulfillment provider.
*/
name: string
/**
* Holds custom data in key-value pairs.
*/
metadata: Record<string, unknown> | null
/**
* The shipping options associated with the fulfillment provider.
*/
shipping_options: ShippingOptionDTO[]
/**
* The creation date of the fulfillment provider.
*/
created_at: Date
/**
* The update date of the fulfillment provider.
*/
updated_at: Date
/**
* The deletion date of the fulfillment provider.
*/
deleted_at: Date | null
}

View File

@@ -1,21 +1,73 @@
import { FilterableServiceZoneProps, ServiceZoneDTO } from "./service-zone"
import { BaseFilterable } from "../../dal"
/**
* The fulfillment set details.
*/
export interface FulfillmentSetDTO {
/**
* The ID of the fulfillment set.
*/
id: string
/**
* The name of the fulfillment set.
*/
name: string
/**
* The type of the fulfillment set.
*/
type: string
/**
* Holds custom data in key-value pairs.
*/
metadata: Record<string, unknown> | null
/**
* The service zones associated with the fulfillment set.
*/
service_zones: ServiceZoneDTO[]
/**
* The creation date of the fulfillment set.
*/
created_at: Date
/**
* The update date of the fulfillment set.
*/
updated_at: Date
/**
* The deletion date of the fulfillment set.
*/
deleted_at: Date | null
}
/**
* The filters to apply on the retrieved fulfillment sets.
*/
export interface FilterableFulfillmentSetProps
extends BaseFilterable<FilterableFulfillmentSetProps> {
/**
* The IDs to filter the fulfillment sets by.
*/
id?: string | string[]
/**
* Filter the fulfillment sets by their name.
*/
name?: string | string[]
/**
* Filter the fulfillment sets by their type.
*/
type?: string | string[]
/**
* The filters to apply on the retrieved service zones.
*/
service_zones?: FilterableServiceZoneProps
}

View File

@@ -5,37 +5,154 @@ import { FulfillmentItemDTO } from "./fulfillment-item"
import { FulfillmentLabelDTO } from "./fulfillment-label"
import { BaseFilterable, OperatorMap } from "../../dal"
/**
* The fulfillment details.
*/
export interface FulfillmentDTO {
/**
* The ID of the fulfillment.
*/
id: string
/**
* The associated location's ID.
*/
location_id: string
/**
* The date the fulfillment was packed.
*/
packed_at: Date | null
/**
* The date the fulfillment was shipped.
*/
shipped_at: Date | null
/**
* The date the fulfillment was delivered.
*/
delivered_at: Date | null
/**
* The date the fulfillment was canceled.
*/
canceled_at: Date | null
/**
* The data necessary for the fulfillment provider to process
* the fulfillment.
*/
data: Record<string, unknown> | null
/**
* The associated fulfillment provider's ID.
*/
provider_id: string
/**
* The associated shipping option's ID.
*/
shipping_option_id: string | null
/**
* Holds custom data in key-value pairs.
*/
metadata: Record<string, unknown> | null
/**
* The associated shipping option.
*/
shipping_option: ShippingOptionDTO | null
/**
* The associated fulfillment provider.
*/
provider: FulfillmentProviderDTO
/**
* The associated fulfillment address used for delivery.
*/
delivery_address: FulfillmentAddressDTO
/**
* The items of the fulfillment.
*/
items: FulfillmentItemDTO[]
/**
* The labels of the fulfillment.
*/
labels: FulfillmentLabelDTO[]
/**
* The creation date of the fulfillment.
*/
created_at: Date
/**
* The update date of the fulfillment.
*/
updated_at: Date
/**
* The deletion date of the fulfillment.
*/
deleted_at: Date | null
}
/**
* The filters to apply on the retrieved fulfillments.
*/
export interface FilterableFulfillmentProps
extends BaseFilterable<FilterableFulfillmentProps> {
/**
* The IDs to filter the fulfillments by.
*/
id?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the fulfillments by the ID of their associated location.
*/
location_id?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the fulfillments by their packing date.
*/
packed_at?: Date | OperatorMap<string | string[]>
/**
* Filter the fulfillments by their shipping date.
*/
shipped_at?: Date | OperatorMap<string | string[]>
/**
* Filter the fulfillments by their delivery date.
*/
delivered_at?: Date | OperatorMap<string | string[]>
/**
* Filter the fulfillments by their cancelation date.
*/
canceled_at?: Date | OperatorMap<string | string[]>
/**
* Filter the fulfillments by the ID of their associated fulfillment provider.
*/
provider_id?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the fulfillments by the ID of their associated shipping option.
*/
shipping_option_id?: string | null
/**
* Filter the fulfillments by their creation date.
*/
created_at?: Date | OperatorMap<string | string[]>
/**
* Filter the fulfillments by their update date.
*/
updated_at?: Date | OperatorMap<string | string[]>
}

View File

@@ -1,26 +1,94 @@
import { BaseFilterable } from "../../dal"
/**
* The type of the geo zone.
*/
export type GeoZoneType = "country" | "province" | "city" | "zip"
/**
* The geo zone details.
*/
export interface GeoZoneDTO {
/**
* The ID of the geo zone.
*/
id: string
/**
* The type of the geo zone.
*/
type: GeoZoneType
/**
* The country code of the geo zone.
*/
country_code: string
/**
* The province code of the geo zone.
*/
province_code: string | null
/**
* The city of the geo zone.
*/
city: string | null
/**
* The postal expression of the geo zone.
*/
postal_expression: Record<string, unknown> | null
/**
* Holds custom data in key-value pairs.
*/
metadata: Record<string, unknown> | null
/**
* The creation date of the geo zone.
*/
created_at: Date
/**
* The update date of the geo zone.
*/
updated_at: Date
/**
* The deletion date of the geo zone.
*/
deleted_at: Date | null
}
/**
* The filters to apply on the retrieved geo zones.
*/
export interface FilterableGeoZoneProps
extends BaseFilterable<FilterableGeoZoneProps> {
/**
* The IDs to filter the geo zones by.
*/
id?: string | string[]
/**
* Filter the geo zones by their type.
*/
type?: GeoZoneType | GeoZoneType[]
/**
* Filter the geo zones by their country code.
*/
country_code?: string | string[]
/**
* Filter the geo zones by their province code.
*/
province_code?: string | string[]
/**
* Filter the geo zones by their city.
*/
city?: string | string[]
// postal_expression?: Record<string, unknown> | Record<string, unknown>[] // TODO: Add support for postal_expression filtering
// TODO add support for postal_expression filtering
}

View File

@@ -6,23 +6,87 @@ import { FilterableGeoZoneProps, GeoZoneDTO } from "./geo-zone"
import { ShippingOptionDTO } from "./shipping-option"
import { BaseFilterable, OperatorMap } from "../../dal"
/**
* The service zone details.
*/
export interface ServiceZoneDTO {
/**
* The ID of the service zone.
*/
id: string
/**
* The name of the service zone.
*/
name: string
/**
* Holds custom data in key-value pairs.
*/
metadata: Record<string, unknown> | null
/**
* The fulfillment sets assoiated with the service zone.
*/
fulfillment_sets: FulfillmentSetDTO[]
/**
* The geo zones assoiated with the service zone.
*/
geo_zones: GeoZoneDTO[]
/**
* The shipping options assoiated with the service zone.
*/
shipping_options: ShippingOptionDTO[]
/**
* The creation date of the service zone.
*/
created_at: Date
/**
* The update date of the service zone.
*/
updated_at: Date
/**
* The deletion date of the service zone.
*/
deleted_at: Date | null
}
/**
* The filters to apply on the retrieved service zones.
*/
export interface FilterableServiceZoneProps
extends BaseFilterable<FilterableServiceZoneProps> {
/**
* The IDs to filter the service zones by.
*/
id?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the service zones by their name.
*/
name?: string | string[] | OperatorMap<string | string[]>
/**
* The filters to apply on the associated geo zones.
*/
geo_zones?: FilterableGeoZoneProps
/**
* The filters to apply on the associated fulfillment sets.
*/
fulfillment_set?: FilterableFulfillmentSetProps
/**
* @ignore
*
* @privateRemarks
* Added the `@\ignore` because of the `TODO`. Once implemented, the
* `@\ignore` (and this comment) should be removed.
*/
shipping_options?: any // TODO
}

View File

@@ -1,22 +1,86 @@
import { ShippingOptionDTO } from "./shipping-option"
import { BaseFilterable, OperatorMap } from "../../dal"
/**
* The shipping option rule details.
*/
export interface ShippingOptionRuleDTO {
/**
* The ID of the shipping option rule.
*/
id: string
/**
* The attribute of the shipping option rule.
*/
attribute: string
/**
* The operator of the shipping option rule.
*
* @example
* in
*/
operator: string
value: { value: string | string[] } | null
/**
* The values of the shipping option rule.
*/
value: {
/**
* The values of the shipping option rule.
*/
value: string | string[]
} | null
/**
* The associated shipping option's ID.
*/
shipping_option_id: string
/**
* The associated shipping option.
*/
shipping_option: ShippingOptionDTO
/**
* The creation date of the shipping option rule.
*/
created_at: Date
/**
* The update date of the shipping option rule.
*/
updated_at: Date
/**
* The deletion date of the shipping option rule.
*/
deleted_at: Date | null
}
/**
* The filters to apply on the retrieved shipping option rules.
*/
export interface FilterableShippingOptionRuleProps
extends BaseFilterable<FilterableShippingOptionRuleProps> {
/**
* The IDs to filter the shipping option rules by.
*/
id?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping option rules by their attribute.
*/
attribute?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping option rules by their operator.
*/
operator?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping option rules by their values.
*/
value?: string | string[] | OperatorMap<string | string[]>
}

View File

@@ -1,22 +1,78 @@
import { ShippingOptionDTO } from "./shipping-option"
import { BaseFilterable, OperatorMap } from "../../dal"
/**
* The shipping option type details.
*/
export interface ShippingOptionTypeDTO {
/**
* The ID of the shipping option type.
*/
id: string
/**
* The label of the shipping option type.
*/
label: string
/**
* The description of the shipping option type.
*/
description: string
/**
* The code of the shipping option type.
*/
code: string
/**
* The associated shipping option's ID.
*/
shipping_option_id: string
/**
* The associated shipping option.
*/
shipping_option: ShippingOptionDTO
/**
* The creation date of the shipping option type.
*/
created_at: Date
/**
* The update date of the shipping option type.
*/
updated_at: Date
/**
* The deletion date of the shipping option type.
*/
deleted_at: Date | null
}
/**
* The filters to apply on the retrieved shipping option types.
*/
export interface FilterableShippingOptionTypeProps
extends BaseFilterable<FilterableShippingOptionTypeProps> {
/**
* The IDs to filter the shipping option types by.
*/
id?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping option types by their label.
*/
label?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping option types by their description.
*/
description?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping option types by their code.
*/
code?: string | string[] | OperatorMap<string | string[]>
}

View File

@@ -12,57 +12,203 @@ import {
} from "./shipping-option-type"
import { ShippingProfileDTO } from "./shipping-profile"
/**
* The shipping option's price type.
*
* - Use `calculated` if the shipping option's price amount is calculated by the fulfillment provider.
* - Use `flat_rate` if the shipping option's price is always the same amount.
*
*/
export type ShippingOptionPriceType = "calculated" | "flat"
/**
* The shipping option details.
*/
export interface ShippingOptionDTO {
/**
* The ID of the shipping option.
*/
id: string
/**
* The name of the shipping option.
*/
name: string
/**
* The type of the shipping option's price.
*/
price_type: ShippingOptionPriceType
/**
* The associated service zone's ID.
*/
service_zone_id: string
/**
* The associated shipping profile's ID.
*/
shipping_profile_id: string
/**
* The associated fulfillment provider's ID.
*/
provider_id: string
/**
* The associated shipping option type's ID.
*/
shipping_option_type_id: string | null
/**
* The data necessary for the associated fulfillment provider to process the shipping option
* and, later, its associated fulfillments.
*/
data: Record<string, unknown> | null
/**
* Holds custom data in key-value pairs.
*/
metadata: Record<string, unknown> | null
/**
* The associated service zone.
*/
service_zone: ServiceZoneDTO
/**
* The associated shipping profile.
*/
shipping_profile: ShippingProfileDTO
/**
* The associated fulfillment provider.
*/
fulfillment_provider: FulfillmentProviderDTO
/**
* The associated shipping option type.
*/
type: ShippingOptionTypeDTO
/**
* The rules associated with the shipping option.
*/
rules: ShippingOptionRuleDTO[]
/**
* The fulfillments associated with the shipping option.
*/
fulfillments: FulfillmentDTO[]
/**
* The creation date of the shipping option.
*/
created_at: Date
/**
* The update date of the shipping option.
*/
updated_at: Date
/**
* The deletion date of the shipping option.
*/
deleted_at: Date | null
}
/**
* The filters to apply on the retrieved shipping options.
*/
export interface FilterableShippingOptionProps
extends BaseFilterable<FilterableShippingOptionProps> {
/**
* The IDs to filter the shipping options by.
*/
id?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping options by their name.
*/
name?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping options by the ID of their associated shipping profile.
*/
shipping_profile_id?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping options by their price type.
*/
price_type?:
| ShippingOptionPriceType
| ShippingOptionPriceType[]
| OperatorMap<ShippingOptionPriceType | ShippingOptionPriceType[]>
/**
* The filters to apply on the retrieved service zones.
*/
service_zone?: FilterableServiceZoneProps
/**
* The filters to apply on the retrieved shipping option types.
*/
shipping_option_type?: FilterableShippingOptionTypeProps
/**
* The filters to apply on the retrieved shipping option rules.
*/
rules?: FilterableShippingOptionRuleProps
}
/**
* A context's details used to filter the shipping option.
*/
export interface FilterableShippingOptionForContextProps
extends FilterableShippingOptionProps {
fulfillment_set_id?: string | string[] | OperatorMap<string | string[]>
fulfillment_set_type?: string | string[] | OperatorMap<string | string[]>
/**
* The fulfillment set's ID used in the context.
*/
fulfillment_set_id?: string | string[] | OperatorMap<string | string[]>
/**
* The fulfillment set's type used in the context.
*/
fulfillment_set_type?: string | string[] | OperatorMap<string | string[]>
/**
* The address used in the context. It filters the shipping options based on
* the geo zones of their associated service zone.
*
* @privateRemarks
* The address is a shortcut to filter through geo_zones
* and build opinionated validation and filtering around the geo_zones.
* For custom filtering you can go through the service_zone.geo_zones directly.
*/
address?: {
/**
* The ISO 2 character country code.
*/
country_code?: string
/**
* The province code.
*/
province_code?: string
/**
* The city.
*/
city?: string
/**
* The postal expression
*/
postal_expression?: string
}
/**
* The shipping option's context to filter directly.
*/
context?: Record<string, any>
}

View File

@@ -4,21 +4,73 @@ import {
} from "./shipping-option"
import { BaseFilterable, OperatorMap } from "../../dal"
/**
* The shipping profile details.
*/
export interface ShippingProfileDTO {
/**
* The ID of the shipping profile.
*/
id: string
/**
* The name of the shipping profile.
*/
name: string
/**
* The type of the shipping profile.
*/
type: string
/**
* Holds custom data in key-value pairs.
*/
metadata: Record<string, unknown> | null
/**
* The shipping options associated with the shipping profile.
*/
shipping_options: ShippingOptionDTO[]
/**
* The creation date of the shipping profile.
*/
created_at: Date
/**
* The update date of the shipping profile.
*/
updated_at: Date
/**
* The deletion date of the shipping profile.
*/
deleted_at: Date | null
}
/**
* The filters to apply on the retrieved shipping profiles.
*/
export interface FilterableShippingProfileProps
extends BaseFilterable<FilterableShippingProfileProps> {
/**
* The IDs to filter the shipping profiles by.
*/
id?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping profiles by their name.
*/
name?: string | string[] | OperatorMap<string | string[]>
/**
* Filter the shipping profiles by their type.
*/
type?: string | string[] | OperatorMap<string | string[]>
/**
* The filters to apply on the retrieved shipping options.
*/
shipping_options?: FilterableShippingOptionProps
}

View File

@@ -1,14 +1,64 @@
/**
* The fulfillment address to be created.
*/
export interface CreateFulfillmentAddressDTO {
/**
* The associated fulfillment's ID.
*/
fulfillment_id: string
/**
* The company of the fulfillment address.
*/
company?: string | null
/**
* The first name of the fulfillment address.
*/
first_name?: string | null
/**
* The last name of the fulfillment address.
*/
last_name?: string | null
/**
* The first line of the fulfillment address.
*/
address_1?: string | null
/**
* The second line of the fulfillment address.
*/
address_2?: string | null
/**
* The city of the fulfillment address.
*/
city?: string | null
/**
* The ISO 2 character country code of the fulfillment address.
*/
country_code?: string | null
/**
* The province of the fulfillment address.
*/
province?: string | null
/**
* The postal code of the fulfillment address.
*/
postal_code?: string | null
/**
* The phone of the fulfillment address.
*/
phone?: string | null
/**
* Holds custom data in key-value pairs.
*/
metadata?: Record<string, unknown> | null
}

View File

@@ -1,9 +1,39 @@
/**
* The fulfillment item to be created.
*/
export interface CreateFulfillmentItemDTO {
/**
* The associated fulfillment's ID.
*/
fulfillment_id: string
/**
* The title of the fulfillment item.
*/
title: string
/**
* The SKU of the fulfillment item.
*/
sku: string
/**
* The quantity of the fulfillment item.
*/
quantity: number
/**
* The barcode of the fulfillment item.
*/
barcode: string
/**
* The associated line item's ID.
*/
line_item_id?: string | null
/**
* The associated inventory item's ID.
*/
inventory_item_id?: string | null
}

View File

@@ -1,6 +1,24 @@
/**
* The fulfillment label to be created.
*/
export interface CreateFulfillmentLabelDTO {
/**
* The tracking number of the fulfillment label.
*/
tracking_number: string
/**
* The tracking URL of the fulfillment label.
*/
tracking_url: string
/**
* The URL of the label.
*/
label_url: string
/**
* The associated fulfillment's ID.
*/
fulfillment_id: string
}

View File

@@ -1,14 +1,54 @@
import { CreateServiceZoneDTO } from "./service-zone"
/**
* The fulfillment set to be created.
*/
export interface CreateFulfillmentSetDTO {
/**
* The name of the fulfillment set.
*/
name: string
/**
* The type of the fulfillment set.
*/
type: string
service_zones?: Omit<CreateServiceZoneDTO, 'fulfillment_set_id'>[]
/**
* The service zones associated with the fulfillment set.
*/
service_zones?: Omit<CreateServiceZoneDTO, "fulfillment_set_id">[]
}
/**
* The attributes to update in the fulfillment set.
*/
export interface UpdateFulfillmentSetDTO {
/**
* The ID of the fulfillment set.
*/
id: string
/**
* The name of the fulfillment set.
*/
name?: string
/**
* The type of the fulfillment set.
*/
type?: string
service_zones?: (Omit<CreateServiceZoneDTO, 'fulfillment_set_id'> | { id: string })[]
/**
* The service zones associated with the fulfillment set.
*/
service_zones?: (
| Omit<CreateServiceZoneDTO, "fulfillment_set_id">
| {
/**
* The ID of the service zone.
*/
id: string
}
)[]
}

View File

@@ -2,29 +2,112 @@ import { CreateFulfillmentAddressDTO } from "./fulfillment-address"
import { CreateFulfillmentItemDTO } from "./fulfillment-item"
import { CreateFulfillmentLabelDTO } from "./fulfillment-label"
/**
* The fulfillment order to be created.
*/
export interface CreateFulfillmentOrderDTO {}
/**
* The fulfillment to be created.
*/
export interface CreateFulfillmentDTO {
/**
* The associated location's ID.
*/
location_id: string
/**
* The date the fulfillment was packed.
*/
packed_at?: Date | null
/**
* The date the fulfillment was shipped.
*/
shipped_at?: Date | null
/**
* The date the fulfillment was delivered.
*/
delivered_at?: Date | null
/**
* The date the fulfillment was canceled.
*/
canceled_at?: Date | null
/**
* The data necessary for the associated fulfillment provider to process the fulfillment.
*/
data?: Record<string, unknown> | null
/**
* The associated fulfillment provider's ID.
*/
provider_id: string
/**
* The associated shipping option's ID.
*/
shipping_option_id?: string | null
/**
* Holds custom data in key-value pairs.
*/
metadata?: Record<string, unknown> | null
/**
* The address associated with the fulfillment. It's used for delivery.
*/
delivery_address: Omit<CreateFulfillmentAddressDTO, "fulfillment_id">
/**
* The items associated with the fulfillment.
*/
items: Omit<CreateFulfillmentItemDTO, "fulfillment_id">[]
/**
* The labels associated with the fulfillment.
*/
labels: Omit<CreateFulfillmentLabelDTO, "fulfillment_id">[]
/**
* The associated fulfillment order.
*/
order: CreateFulfillmentOrderDTO
}
/**
* The attributes to update in the fulfillment.
*/
export interface UpdateFulfillmentDTO {
/**
* The associated location's ID.
*/
location_id?: string
/**
* The date the fulfillment was packed.
*/
packed_at?: Date | null
/**
* The date the fulfillment was shipped.
*/
shipped_at?: Date | null
/**
* The date the fulfillment was delivered.
*/
delivered_at?: Date | null
/**
* The data necessary for the associated fulfillment provider to process the fulfillment.
*/
data?: Record<string, unknown> | null
/**
* Holds custom data in key-value pairs.
*/
metadata?: Record<string, unknown> | null
}

View File

@@ -1,66 +1,204 @@
import { GeoZoneType } from "../common"
/**
* The geo zone to be created.
*/
interface CreateGeoZoneBaseDTO {
/**
* The type of the geo zone.
*/
type: GeoZoneType
/**
* The associated service zone's ID.
*/
service_zone_id: string
/**
* The ISO 2 character country code of the geo zone.
*/
country_code: string
/**
* Holds custom data in key-value pairs.
*/
metadata?: Record<string, any> | null
}
/**
* The geo zone to be created of type `country`.
*/
export interface CreateCountryGeoZoneDTO extends CreateGeoZoneBaseDTO {
/**
* The type of the geo zone.
* @defaultValue `"country"`
*/
type: "country"
}
/**
* The geo zone to be created of type `province`.
*/
export interface CreateProvinceGeoZoneDTO extends CreateGeoZoneBaseDTO {
/**
* The type of the geo zone.
* @defaultValue `"province"`
*/
type: "province"
/**
* The province code of the geo zone.
*/
province_code: string
}
/**
* The geo zone to be created of type `city`.
*/
export interface CreateCityGeoZoneDTO extends CreateGeoZoneBaseDTO {
/**
* The type of the geo zone.
* @defaultValue `"city"`
*/
type: "city"
/**
* The province code of the geo zone.
*/
province_code: string
/**
* The city of the geo zone.
*/
city: string
}
/**
* The geo zone to be created of type `zip`.
*/
export interface CreateZipGeoZoneDTO extends CreateGeoZoneBaseDTO {
/**
* The type of the geo zone.
* @defaultValue `"zip"`
*/
type: "zip"
/**
* The province code of the geo zone.
*/
province_code: string
/**
* The city of the geo zone.
*/
city: string
/**
* The postal expression of the geo zone.
*/
postal_expression: Record<string, any>
}
/**
* @interface
*
* The geo zone to be created. The value of the `type` attributes allows for passing more attributes.
*/
export type CreateGeoZoneDTO =
| CreateCountryGeoZoneDTO
| CreateProvinceGeoZoneDTO
| CreateCityGeoZoneDTO
| CreateZipGeoZoneDTO
/**
* The attributes to update in the geo zone.
*/
export interface UpdateGeoZoneBaseDTO extends Partial<CreateGeoZoneBaseDTO> {
/**
* The ID of the geo zone.
*/
id: string
}
/**
* The attributes to update in the geo zone of type `country`.
*/
export interface UpdateCountryGeoZoneDTO extends UpdateGeoZoneBaseDTO {
/**
* The type of the geo zone.
* @defaultValue `"country"`
*/
type: "country"
}
/**
* The attributes to update in the geo zone of type `province`.
*/
export interface UpdateProvinceGeoZoneDTO extends UpdateGeoZoneBaseDTO {
/**
* The type of the geo zone.
* @defaultValue `"province"`
*/
type: "province"
/**
* The province code of the geo zone.
*/
province_code: string
}
/**
* The attributes to update in the geo zone of type `city`.
*/
export interface UpdateCityGeoZoneDTO extends UpdateGeoZoneBaseDTO {
/**
* The type of the geo zone.
* @defaultValue `"city"`
*/
type: "city"
/**
* The province code of the geo zone.
*/
province_code?: string
/**
* The city of the geo zone.
*/
city?: string
}
/**
* The attributes to update in the geo zone of type `zip`.
*/
export interface UpdateZipGeoZoneDTO extends UpdateGeoZoneBaseDTO {
/**
* The type of the geo zone.
* @defaultValue `"zip"`
*/
type: "zip"
/**
* The province code of the geo zone.
*/
province_code?: string
/**
* The city of the geo zone.
*/
city?: string
/**
* The postal expression of the geo zone.
*/
postal_expression?: Record<string, any>
}
/**
* @interface
*
* The attributes to update in the geo zone. The value of the `type` attributes allows for passing more attributes.
*/
export type UpdateGeoZoneDTO =
| UpdateCountryGeoZoneDTO
| UpdateProvinceGeoZoneDTO

View File

@@ -5,9 +5,23 @@ import {
CreateZipGeoZoneDTO,
} from "./geo-zone"
/**
* The service zone to be created.
*/
export interface CreateServiceZoneDTO {
/**
* The name of the service zone.
*/
name: string
/**
* The associated fulfillment set's ID.
*/
fulfillment_set_id: string
/**
* The geo zones associated with the service zone.
*/
geo_zones?: (
| Omit<CreateCountryGeoZoneDTO, "service_zone_id">
| Omit<CreateProvinceGeoZoneDTO, "service_zone_id">
@@ -16,16 +30,38 @@ export interface CreateServiceZoneDTO {
)[]
}
/**
* The attributes to update in the service zone.
*/
export interface UpdateServiceZoneDTO {
/**
* The ID of the service zone.
*/
id?: string
/**
* The name of the service zone.
*/
name?: string
/**
* The geo zones associated with the service zone.
*/
geo_zones?: (
| Omit<CreateCountryGeoZoneDTO, "service_zone_id">
| Omit<CreateProvinceGeoZoneDTO, "service_zone_id">
| Omit<CreateCityGeoZoneDTO, "service_zone_id">
| Omit<CreateZipGeoZoneDTO, "service_zone_id">
| { id: string }
| {
/**
* The ID of the geo zone.
*/
id: string
}
)[]
}
/**
* A service zone to be created or updated.
*/
export interface UpsertServiceZoneDTO extends UpdateServiceZoneDTO {}

View File

@@ -1,13 +1,35 @@
import { RuleOperatorType } from "../../common"
/**
* The shipping option rule to be created.
*/
export interface CreateShippingOptionRuleDTO {
/**
* The attribute of the shipping option rule.
*/
attribute: string
/**
* The operator of the shipping option rule.
*/
operator: RuleOperatorType
/**
* The value(s) of the shipping option rule.
*/
value: string | string[]
/**
* The associated shipping option's ID.
*/
shipping_option_id: string
}
/**
* The attributes to update in the shipping option rule.
*/
export interface UpdateShippingOptionRuleDTO
extends Partial<CreateShippingOptionRuleDTO> {
/**
* The ID of the shipping option rule.
*/
id: string
}

View File

@@ -1,11 +1,35 @@
/**
* The shipping option type to be created.
*/
export interface CreateShippingOptionTypeDTO {
/**
* The label of the shipping option type.
*/
label: string
/**
* The description of the shipping option type.
*/
description: string
/**
* The code of the shipping option type.
*/
code: string
/**
* The associated shipping option's ID.
*/
shipping_option_id: string
}
/**
* The attributes to update in the shipping option type.
*/
export interface UpdateShippingOptionTypeDTO
extends Partial<CreateShippingOptionTypeDTO> {
/**
* The ID of the shipping option type.
*/
id: string
}

View File

@@ -2,32 +2,119 @@ import { CreateShippingOptionTypeDTO } from "./shipping-option-type"
import { ShippingOptionPriceType } from "../common"
import { CreateShippingOptionRuleDTO } from "./shipping-option-rule"
/**
* The shipping option to be created.
*/
export interface CreateShippingOptionDTO {
/**
* The name of the shipping option.
*/
name: string
/**
* The type of the shipping option's price.
*/
price_type: ShippingOptionPriceType
/**
* The associated service zone's ID.
*/
service_zone_id: string
/**
* The associated shipping profile's ID.
*/
shipping_profile_id: string
/**
* The associated provider's ID.
*/
provider_id: string
/**
* The shipping option type associated with the shipping option.
*/
type: Omit<CreateShippingOptionTypeDTO, "shipping_option_id">
/**
* The data necessary for the associated fulfillment provider to process the shipping option
* and its associated fulfillments.
*/
data?: Record<string, unknown> | null
/**
* The shipping option rules associated with the shipping option.
*/
rules?: Omit<CreateShippingOptionRuleDTO, "shipping_option_id">[]
}
/**
* The attributes to update in the shipping option.
*/
export interface UpdateShippingOptionDTO {
/**
* The ID of the shipping option.
*/
id?: string
/**
* The name of the shipping option.
*/
name?: string
/**
* The type of the shipping option's price.
*/
price_type?: ShippingOptionPriceType
/**
* The associated service zone's ID.
*/
service_zone_id?: string
/**
* The associated shipping profile's ID.
*/
shipping_profile_id?: string
/**
* The associated provider's ID.
*/
provider_id?: string
type: Omit<CreateShippingOptionTypeDTO, "shipping_option_id"> | { id: string }
/**
* The shipping option type associated with the shipping option.
*/
type:
| Omit<CreateShippingOptionTypeDTO, "shipping_option_id">
| {
/**
* The ID of the shipping option type.
*/
id: string
}
/**
* The data necessary for the associated fulfillment provider to process the shipping option
* and its associated fulfillments.
*/
data?: Record<string, unknown> | null
/**
* The shipping option rules associated with the shipping option.
*/
rules?: (
| Omit<CreateShippingOptionRuleDTO, "shipping_option_id">
| { id: string }
| {
/**
* The ID of the shipping option rule.
*/
id: string
}
)[]
}
export interface UpsertShippingOptionDTO extends UpdateShippingOptionDTO {
}
/**
* A shipping option to be created or updated.
*/
export interface UpsertShippingOptionDTO extends UpdateShippingOptionDTO {}

View File

@@ -1,8 +1,25 @@
/**
* The shipping profile to be created.
*/
export interface CreateShippingProfileDTO {
/**
* The name of the shipping profile.
*/
name: string
/**
* The type of the shipping profile.
*/
type?: string
/**
* Holds custom data in key-value pairs.
*/
metadata?: Record<string, unknown>
}
/**
* The attributes to update in the shipping profile.
*/
export interface UpdateShippingProfileDTO
extends Partial<CreateShippingProfileDTO> {}

File diff suppressed because it is too large Load Diff