chore: fixes to http and request types for orders (1) (#13822)

This commit is contained in:
Shahed Nasser
2025-10-28 11:14:43 +02:00
committed by GitHub
parent 25a20ca95f
commit fa93f18f7d
25 changed files with 217 additions and 68 deletions
@@ -109,6 +109,10 @@ export interface AdminCreateClaim {
* An internal note viewed by admin users only.
*/
internal_note?: string
/**
* The ID of the associated reason.
*/
reason_id?: string | null
/**
* Key-value pairs of custom data.
*/
@@ -116,13 +120,13 @@ export interface AdminCreateClaim {
}
export interface AdminAddClaimItems extends AdminClaimAddItems {}
export interface AdminUpdateClaimItem extends AdminClaimUpdateItem {}
export interface AdminUpdateClaimItem extends Omit<AdminClaimUpdateItem, "description"> {}
export interface AdminAddClaimInboundItems extends AdminClaimAddItems {}
export interface AdminUpdateClaimInboundItem extends AdminClaimUpdateItem {}
export interface AdminAddClaimOutboundItems extends AdminClaimAddItems {}
export interface AdminUpdateClaimOutboundItem extends AdminClaimUpdateItem {}
export interface AdminUpdateClaimOutboundItem extends Omit<AdminClaimUpdateItem, "description"> {}
export interface AdminClaimAddInboundShipping
extends AdminClaimAddShippingMethod {}
@@ -6,10 +6,48 @@ export interface AdminClaimListParams
extends BaseClaimListParams,
BaseFilterable<AdminClaimListParams> { }
export interface AdminClaimParams extends SelectParams {
export interface AdminClaimActionsParams extends SelectParams {
/**
* Filter by claim ID(s).
*/
id?: string | string[]
/**
* Filter by claim status(es).
*/
status?: string | string[]
/**
* Apply filters on the claim's creation date.
*/
created_at?: OperatorMap<string>
/**
* Apply filters on the claim's update date.
*/
updated_at?: OperatorMap<string>
/**
* Apply filters on the claim's deletion date.
*/
deleted_at?: OperatorMap<string>
}
export interface AdminClaimParams extends SelectParams {
/**
* Filter by claim ID(s).
*/
id?: string | string[]
/**
* Filter by claim status(es).
*/
status?: string | string[]
/**
* Apply filters on the claim's creation date.
*/
created_at?: OperatorMap<string>
/**
* Apply filters on the claim's update date.
*/
updated_at?: OperatorMap<string>
/**
* Apply filters on the claim's deletion date.
*/
deleted_at?: OperatorMap<string>
}
@@ -1,36 +1,32 @@
enum ExchangeReason {
MISSING_ITEM = "missing_item",
WRONG_ITEM = "wrong_item",
PRODUCTION_FAILURE = "production_failure",
OTHER = "other",
}
interface AdminExchangeAddItems {
export interface AdminAddExchangeOutboundItems {
/**
* The items to add to the exchange.
*/
items: {
/**
* If you're adding an inbound item, this is the ID of the order item returned.
* If you're adding an outbound item, this is the ID of the variant to add.
* The ID of the variant to add.
*/
id: string
variant_id: string
/**
* The item's quantity.
*/
quantity: number
/**
* The reason the item is being returned / sent to the customer.
* The item's unit price.
*/
reason?: ExchangeReason
/**
* The item's description.
*/
description?: string
unit_price?: number
/**
* An internal note viewed by admin users only.
*/
internal_note?: string
/**
* Whether to allow backorder for the item.
*/
allow_backorder?: boolean
/**
* Key-value pairs of custom data.
*/
metadata?: Record<string, unknown>
}[]
}
@@ -111,13 +107,46 @@ export interface AdminCreateExchange {
metadata?: Record<string, unknown> | null
}
export interface AdminAddExchangeInboundItems extends AdminExchangeAddItems {}
export interface AdminAddExchangeInboundItems {
/**
* The ID of the location the items are returned to.
*/
location_id?: string
/**
* The items to add to the exchange.
*/
items: {
/**
* The ID of the order item returned.
*/
id: string
/**
* The item's quantity.
*/
quantity: number
/**
* The description of why the item is being returned.
*/
description?: string
/**
* An internal note viewed by admin users only.
*/
internal_note?: string
/**
* The ID of the associated return reason.
*/
reason_id?: string
/**
* Key-value pairs of custom data.
*/
metadata?: Record<string, unknown>
}[]
}
export interface AdminUpdateExchangeInboundItem
extends AdminExchangeUpdateItem {}
export interface AdminAddExchangeOutboundItems extends AdminExchangeAddItems {}
export interface AdminUpdateExchangeOutboundItem
extends AdminExchangeUpdateItem {}
extends Omit<AdminExchangeUpdateItem, "reason_id" | "description"> {}
export interface AdminExchangeAddInboundShipping
extends AdminExchangeAddShippingMethod {}
@@ -1,11 +1,52 @@
import { OperatorMap } from "../../../dal"
import { SelectParams } from "../../common"
import { FindParams, SelectParams } from "../../common"
export interface AdminExchangeListParams extends SelectParams {
export interface AdminExchangeListParams extends FindParams {
/**
* Filter by exchange ID(s).
*/
id?: string | string[]
/**
* Filter by order ID(s) to get their associated exchanges.
*/
order_id?: string | string[]
/**
* Filter by exchange status(es).
*/
status?: string | string[]
/**
* Apply filters on the exchange's creation date.
*/
created_at?: OperatorMap<string>
/**
* Apply filters on the exchange's update date.
*/
updated_at?: OperatorMap<string>
/**
* Apply filters on the exchange's deletion date.
*/
deleted_at?: OperatorMap<string>
}
export interface AdminOrderExchangeListParams extends SelectParams {
/**
* Filter by exchange ID(s).
*/
id?: string | string[]
/**
* Filter by exchange status(es).
*/
status?: string | string[]
/**
* Apply filters on the exchange's creation date.
*/
created_at?: OperatorMap<string>
/**
* Apply filters on the exchange's update date.
*/
updated_at?: OperatorMap<string>
/**
* Apply filters on the exchange's deletion date.
*/
deleted_at?: OperatorMap<string>
}