Feat: draft order api (#6797)

This commit is contained in:
Carlos R. L. Rodrigues
2024-04-06 16:35:10 +02:00
committed by GitHub
parent 883a75c4f3
commit df0751f122
63 changed files with 2179 additions and 1424 deletions
+49 -21
View File
@@ -233,8 +233,7 @@ export interface OrderShippingMethodDTO {
/**
* The price of the shipping method
*/
unit_price: number
amount: BigNumberRawValue
/**
* Whether the shipping method price is tax inclusive or not
*/
@@ -416,6 +415,16 @@ export interface OrderLineItemDTO extends OrderLineItemTotalsDTO {
*/
raw_unit_price: BigNumberRawValue
/**
* The quantity of the order line item.
*/
quantity: number
/**
* The raw quantity of the order line item.
*/
raw_quantity: BigNumberRawValue
/**
* The associated tax lines.
*
@@ -443,6 +452,11 @@ export interface OrderLineItemDTO extends OrderLineItemTotalsDTO {
* The date when the order line item was last updated.
*/
updated_at: Date
/**
* Holds custom data in key-value pairs.
*/
metadata?: Record<string, unknown> | null
}
export interface OrderItemDTO {
@@ -738,11 +752,11 @@ export interface OrderChangeActionDTO {
/**
* The action of the order change action
*/
action: Record<string, unknown>
action: string
/**
* The metadata of the order change action
* The details of the order change action
*/
metadata?: Record<string, unknown> | null
details: Record<string, unknown> | null
/**
* The internal note of the order change action
*/
@@ -877,28 +891,42 @@ export interface FilterableOrderShippingMethodTaxLineProps
export interface FilterableOrderChangeProps
extends BaseFilterable<FilterableOrderChangeProps> {
id?: string | string[]
order_id?: string | string[]
status?: string | string[]
requested_by?: string | string[]
confirmed_by?: string | string[]
declined_by?: string | string[]
canceled_by?: string | string[]
id?: string | string[] | OperatorMap<string>
order_id?: string | string[] | OperatorMap<string>
status?: string | string[] | OperatorMap<string>
requested_by?: string | string[] | OperatorMap<string>
confirmed_by?: string | string[] | OperatorMap<string>
declined_by?: string | string[] | OperatorMap<string>
canceled_by?: string | string[] | OperatorMap<string>
created_at?: OperatorMap<string>
updated_at?: OperatorMap<string>
deleted_at?: OperatorMap<string>
canceled_at?: OperatorMap<string>
}
export interface FilterableOrderChangeActionProps
extends BaseFilterable<FilterableOrderChangeActionProps> {
id?: string | string[]
order_change_id?: string | string[]
reference?: string | string[]
reference_id?: string | string[]
id?: string | string[] | OperatorMap<string>
order_change_id?: string | string[] | OperatorMap<string>
reference?: string | string[] | OperatorMap<string>
reference_id?: string | string[] | OperatorMap<string>
}
export interface FilterableOrderTransactionProps
extends BaseFilterable<FilterableOrderTransactionProps> {
id?: string | string[]
order_id?: string | string[]
currency_code?: string | string[]
reference?: string | string[]
reference_id?: string | string[]
id?: string | string[] | OperatorMap<string>
order_id?: string | string[] | OperatorMap<string>
currency_code?: string | string[] | OperatorMap<string>
reference?: string | string[] | OperatorMap<string>
reference_id?: string | string[] | OperatorMap<string>
created_at?: OperatorMap<string>
}
export interface FilterableOrderItemProps
extends BaseFilterable<FilterableOrderItemProps> {
id?: string | string[] | OperatorMap<string>
order_id?: string | string[] | OperatorMap<string>
version?: string | string[] | OperatorMap<string>
item_id?: string | string[] | OperatorMap<string>
}
+1
View File
@@ -1,3 +1,4 @@
export * from "./common"
export * from "./mutations"
export * from "./service"
export * from "./workflows"
+10 -10
View File
@@ -32,16 +32,18 @@ export interface CreateOrderDTO {
sales_channel_id?: string
status?: string
email?: string
currency_code: string
currency_code?: string
shipping_address_id?: string
billing_address_id?: string
shipping_address?: CreateOrderAddressDTO | UpdateOrderAddressDTO
billing_address?: CreateOrderAddressDTO | UpdateOrderAddressDTO
no_notification?: boolean
items?: CreateOrderLineItemDTO[]
shipping_methods?: CreateOrderShippingMethodDTO[]
shipping_methods?: Omit<CreateOrderShippingMethodDTO, "order_id">[]
transactions?: CreateOrderTransactionDTO[]
metadata?: Record<string, unknown>
promo_codes?: string[]
}
export interface UpdateOrderDTO {
@@ -162,6 +164,8 @@ export interface CreateOrderLineItemDTO {
tax_lines?: CreateOrderTaxLineDTO[]
adjustments?: CreateOrderAdjustmentDTO[]
metadata?: Record<string, unknown>
}
export interface CreateOrderLineItemForOrderDTO extends CreateOrderLineItemDTO {
@@ -194,9 +198,9 @@ export interface UpdateOrderLineItemDTO
export interface CreateOrderShippingMethodDTO {
name: string
shipping_method_id: string
order_id: string
amount: BigNumberInput
shipping_option_id?: string
data?: Record<string, unknown>
tax_lines?: CreateOrderTaxLineDTO[]
adjustments?: CreateOrderAdjustmentDTO[]
@@ -205,7 +209,7 @@ export interface CreateOrderShippingMethodDTO {
export interface UpdateOrderShippingMethodDTO {
id: string
name?: string
shipping_method_id: string
shipping_option_id?: string
amount?: BigNumberInput
data?: Record<string, unknown>
tax_lines?: UpdateOrderTaxLineDTO[] | CreateOrderTaxLineDTO[]
@@ -285,18 +289,14 @@ export interface CreateOrderChangeActionDTO {
order_change_id: string
reference: string
reference_id: string
action: Record<string, unknown>
action: string
internal_note?: string
metadata?: Record<string, unknown>
details?: Record<string, unknown>
}
export interface UpdateOrderChangeActionDTO {
id: string
reference?: string
reference_id?: string
action?: Record<string, unknown>
internal_note?: string
metadata?: Record<string, unknown>
}
/** ORDER TRANSACTION START */
File diff suppressed because it is too large Load Diff
+8
View File
@@ -0,0 +1,8 @@
import { CustomerDTO } from "../customer"
import { RegionDTO } from "../region"
import { OrderDTO } from "./common"
export interface OrderWorkflowDTO extends OrderDTO {
customer?: CustomerDTO
region?: RegionDTO
}
+4 -3
View File
@@ -1,5 +1,6 @@
import { BaseFilterable } from "../dal"
import { OperatorMap } from "../dal/utils"
import { BigNumberInput } from "../totals"
/**
* The tax rate details.
@@ -386,12 +387,12 @@ export interface TaxableItemDTO {
/**
* The quantity of the taxable item.
*/
quantity?: number
quantity?: BigNumberInput
/**
* The unit price of the taxable item.
*/
unit_price?: number
unit_price?: BigNumberInput
/**
* The ISO 3 character currency code of the taxable item.
@@ -416,7 +417,7 @@ export interface TaxableShippingDTO {
/**
* The unit price of the taxable shipping.
*/
unit_price?: number
unit_price?: BigNumberInput
/**
* The ISO 3 character currency code of the taxable shipping.