fix(types, medusa): fixes to HTTP types (#9273)
### types - Remove `is_internal` and `is_active` from `StoreProductCategory` - Add missing status, reference, and action enums from `BaseOrderChange` and `BaseOrderChangeAction` - Remove unused totals from `BaseOrderSummary`. - Fix references to base types from admin / store types - Other general fixes ### medusa - Use HTTP types for create / update return reason routes - Remove type arguments from the calculate taxes route since it's a `POST` API route but the type argument for the select query parameters only. - Add `metadata` to the list of cart's fields. - Add type casting for order previews in response
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
import { StorePaymentCollection } from "../../payment"
|
||||||
|
import { StoreProduct, StoreProductVariant } from "../../product"
|
||||||
|
import { StoreRegion } from "../../region"
|
||||||
import {
|
import {
|
||||||
BaseCart,
|
BaseCart,
|
||||||
BaseCartAddress,
|
BaseCartAddress,
|
||||||
@@ -5,7 +8,18 @@ import {
|
|||||||
BaseCartShippingMethod,
|
BaseCartShippingMethod,
|
||||||
} from "../common"
|
} from "../common"
|
||||||
|
|
||||||
export interface StoreCart extends BaseCart {}
|
export interface StoreCart extends Omit<BaseCart, "items"> {
|
||||||
export interface StoreCartLineItem extends BaseCartLineItem {}
|
shipping_address?: StoreCartAddress
|
||||||
|
billing_address?: StoreCartAddress
|
||||||
|
items?: StoreCartLineItem[]
|
||||||
|
shipping_methods?: StoreCartShippingMethod[]
|
||||||
|
payment_collection?: StorePaymentCollection
|
||||||
|
region?: StoreRegion
|
||||||
|
}
|
||||||
|
export interface StoreCartLineItem extends Omit<BaseCartLineItem, "product" | "variant" | "cart"> {
|
||||||
|
product?: StoreProduct
|
||||||
|
variant?: StoreProductVariant
|
||||||
|
cart: StoreCart
|
||||||
|
}
|
||||||
export interface StoreCartAddress extends BaseCartAddress {}
|
export interface StoreCartAddress extends BaseCartAddress {}
|
||||||
export interface StoreCartShippingMethod extends BaseCartShippingMethod {}
|
export interface StoreCartShippingMethod extends BaseCartShippingMethod {}
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
import { AdminOrder, AdminOrderShippingMethod } from "../../order"
|
||||||
|
import { AdminReturn } from "../../return"
|
||||||
import { BaseClaim } from "../common"
|
import { BaseClaim } from "../common"
|
||||||
|
|
||||||
export interface AdminClaim extends BaseClaim {}
|
export interface AdminClaim extends BaseClaim {
|
||||||
|
order: AdminOrder
|
||||||
|
return: AdminReturn
|
||||||
|
shipping_methods?: AdminOrderShippingMethod[]
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { OrderDTO, OrderPreviewDTO } from "../../../order"
|
import { OrderDTO } from "../../../order"
|
||||||
import { DeleteResponse, PaginatedResponse } from "../../common"
|
import { DeleteResponse, PaginatedResponse } from "../../common"
|
||||||
|
import { AdminOrderPreview } from "../../order"
|
||||||
import { AdminReturn } from "../../return"
|
import { AdminReturn } from "../../return"
|
||||||
import { AdminClaim } from "./entities"
|
import { AdminClaim } from "./entities"
|
||||||
|
|
||||||
@@ -18,12 +19,12 @@ export interface AdminClaimOrderResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminClaimPreviewResponse {
|
export interface AdminClaimPreviewResponse {
|
||||||
order_preview: OrderPreviewDTO
|
order_preview: AdminOrderPreview
|
||||||
claim: AdminClaim
|
claim: AdminClaim
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminClaimReturnPreviewResponse {
|
export interface AdminClaimReturnPreviewResponse {
|
||||||
order_preview: OrderPreviewDTO
|
order_preview: AdminOrderPreview
|
||||||
return: AdminReturn
|
return: AdminReturn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { OrderDTO, OrderPreviewDTO } from "../../../order"
|
import { OrderDTO } from "../../../order"
|
||||||
import { DeleteResponse, PaginatedResponse } from "../../common"
|
import { DeleteResponse, PaginatedResponse } from "../../common"
|
||||||
|
import { AdminOrderPreview } from "../../order"
|
||||||
import { AdminReturn } from "../../return"
|
import { AdminReturn } from "../../return"
|
||||||
import { AdminExchange } from "./entities"
|
import { AdminExchange } from "./entities"
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ export interface AdminExchangeOrderResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminExchangePreviewResponse {
|
export interface AdminExchangePreviewResponse {
|
||||||
order_preview: OrderPreviewDTO
|
order_preview: AdminOrderPreview
|
||||||
exchange: AdminExchange
|
exchange: AdminExchange
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ export interface AdminExchangeRequestResponse
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminExchangeReturnResponse {
|
export interface AdminExchangeReturnResponse {
|
||||||
order_preview: OrderPreviewDTO
|
order_preview: AdminOrderPreview
|
||||||
return: AdminReturn
|
return: AdminReturn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { OrderChangeDTO, OrderPreviewDTO } from "../../../order"
|
|
||||||
import { DeleteResponse } from "../../common"
|
import { DeleteResponse } from "../../common"
|
||||||
|
import { AdminOrderChange, AdminOrderPreview } from "../../order/admin"
|
||||||
|
|
||||||
export interface AdminOrderEditPreviewResponse {
|
export interface AdminOrderEditPreviewResponse {
|
||||||
order_preview: OrderPreviewDTO
|
order_preview: AdminOrderPreview
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminOrderEditResponse {
|
export interface AdminOrderEditResponse {
|
||||||
order_change: OrderChangeDTO
|
order_change: AdminOrderChange
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AdminOrderEditDeleteResponse = DeleteResponse<"order-edit">
|
export type AdminOrderEditDeleteResponse = DeleteResponse<"order-edit">
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
|
import { AdminClaim } from "../../claim"
|
||||||
import { AdminCustomer } from "../../customer"
|
import { AdminCustomer } from "../../customer"
|
||||||
|
import { AdminExchange } from "../../exchange"
|
||||||
import { AdminPaymentCollection } from "../../payment/admin"
|
import { AdminPaymentCollection } from "../../payment/admin"
|
||||||
import { AdminProductVariant } from "../../product"
|
import { AdminProduct, AdminProductVariant } from "../../product"
|
||||||
import { AdminRegionCountry } from "../../region"
|
import { AdminRegionCountry } from "../../region"
|
||||||
|
import { AdminReturn } from "../../return"
|
||||||
import { AdminSalesChannel } from "../../sales-channel"
|
import { AdminSalesChannel } from "../../sales-channel"
|
||||||
import {
|
import {
|
||||||
BaseOrder,
|
BaseOrder,
|
||||||
@@ -13,24 +16,37 @@ import {
|
|||||||
BaseOrderShippingMethod,
|
BaseOrderShippingMethod,
|
||||||
} from "../common"
|
} from "../common"
|
||||||
|
|
||||||
export interface AdminOrder extends BaseOrder {
|
export interface AdminOrder extends Omit<BaseOrder, "items"> {
|
||||||
payment_collections: AdminPaymentCollection[]
|
payment_collections: AdminPaymentCollection[]
|
||||||
fulfillments?: BaseOrderFulfillment[]
|
fulfillments?: AdminOrderFulfillment[]
|
||||||
sales_channel?: AdminSalesChannel
|
sales_channel?: AdminSalesChannel
|
||||||
customer?: AdminCustomer
|
customer?: AdminCustomer
|
||||||
shipping_address?: AdminOrderAddress | null
|
shipping_address?: AdminOrderAddress | null
|
||||||
billing_address?: AdminOrderAddress | null
|
billing_address?: AdminOrderAddress | null
|
||||||
items: AdminOrderLineItem[]
|
items: AdminOrderLineItem[]
|
||||||
|
shipping_methods: AdminOrderShippingMethod[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminOrderLineItem extends BaseOrderLineItem {
|
export interface AdminOrderChange extends
|
||||||
variant?: AdminProductVariant
|
Omit<BaseOrderChange, "order" | "claim" | "return_order" | "exchange" | "actions"> {
|
||||||
|
order: AdminOrder
|
||||||
|
claim: AdminClaim
|
||||||
|
return_order: AdminReturn
|
||||||
|
exchange: AdminExchange
|
||||||
|
actions: AdminOrderChangeAction[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AdminOrderChangeAction extends Omit<BaseOrderChangeAction, "order_change" | "order"> {
|
||||||
|
order_change: AdminOrderChange
|
||||||
|
order: AdminOrder | null
|
||||||
}
|
}
|
||||||
export interface AdminOrderChange extends BaseOrderChange {}
|
|
||||||
|
|
||||||
export interface AdminOrderFulfillment extends BaseOrderFulfillment {}
|
export interface AdminOrderFulfillment extends BaseOrderFulfillment {}
|
||||||
|
|
||||||
export interface AdminOrderLineItem extends BaseOrderLineItem {}
|
export interface AdminOrderLineItem extends Omit<BaseOrderLineItem, "variant" | "product"> {
|
||||||
|
variant?: AdminProductVariant
|
||||||
|
product?: AdminProduct
|
||||||
|
}
|
||||||
|
|
||||||
export interface AdminOrderAddress extends BaseOrderAddress {
|
export interface AdminOrderAddress extends BaseOrderAddress {
|
||||||
country?: AdminRegionCountry
|
country?: AdminRegionCountry
|
||||||
@@ -41,9 +57,9 @@ export interface AdminOrderShippingMethod extends BaseOrderShippingMethod {}
|
|||||||
export interface AdminOrderPreview
|
export interface AdminOrderPreview
|
||||||
extends Omit<AdminOrder, "items" | "shipping_methods"> {
|
extends Omit<AdminOrder, "items" | "shipping_methods"> {
|
||||||
return_requested_total: number
|
return_requested_total: number
|
||||||
order_change: BaseOrderChange
|
order_change: AdminOrderChange
|
||||||
items: (BaseOrderLineItem & { actions?: BaseOrderChangeAction[] })[]
|
items: (AdminOrderLineItem & { actions?: AdminOrderChangeAction[] })[]
|
||||||
shipping_methods: (BaseOrderShippingMethod & {
|
shipping_methods: (AdminOrderShippingMethod & {
|
||||||
actions?: BaseOrderChangeAction[]
|
actions?: AdminOrderChangeAction[]
|
||||||
})[]
|
})[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { PaginatedResponse } from "../../common"
|
import { PaginatedResponse } from "../../common"
|
||||||
import { BaseOrderChange } from "../common"
|
import { AdminOrder, AdminOrderChange, AdminOrderPreview } from "./entities"
|
||||||
import { AdminOrder, AdminOrderPreview } from "./entities"
|
|
||||||
|
|
||||||
export interface AdminOrderResponse {
|
export interface AdminOrderResponse {
|
||||||
order: AdminOrder
|
order: AdminOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminOrderChangesResponse {
|
export interface AdminOrderChangesResponse {
|
||||||
order_changes: BaseOrderChange[]
|
order_changes: AdminOrderChange[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AdminOrderListResponse = PaginatedResponse<{
|
export type AdminOrderListResponse = PaginatedResponse<{
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
import { BaseFilterable, OperatorMap } from "../../dal"
|
import { BaseFilterable, OperatorMap } from "../../dal"
|
||||||
|
import { ChangeActionType, OrderChangeStatus } from "../../order"
|
||||||
import { BaseClaim } from "../claim/common"
|
import { BaseClaim } from "../claim/common"
|
||||||
import { FindParams } from "../common"
|
import { FindParams } from "../common"
|
||||||
|
import { BaseExchange } from "../exchange/common"
|
||||||
import { BasePaymentCollection } from "../payment/common"
|
import { BasePaymentCollection } from "../payment/common"
|
||||||
import { BaseProduct, BaseProductVariant } from "../product/common"
|
import { BaseProduct, BaseProductVariant } from "../product/common"
|
||||||
|
import { BaseReturn } from "../return/common"
|
||||||
|
|
||||||
export interface BaseOrderSummary {
|
export interface BaseOrderSummary {
|
||||||
total: number
|
total: number
|
||||||
@@ -13,11 +16,6 @@ export interface BaseOrderSummary {
|
|||||||
returned_total: number
|
returned_total: number
|
||||||
return_request_total: number
|
return_request_total: number
|
||||||
write_off_total: number
|
write_off_total: number
|
||||||
projected_total: number
|
|
||||||
net_total: number
|
|
||||||
net_subtotal: number
|
|
||||||
net_total_tax: number
|
|
||||||
balance: number
|
|
||||||
paid_total: number
|
paid_total: number
|
||||||
refunded_total: number
|
refunded_total: number
|
||||||
}
|
}
|
||||||
@@ -180,52 +178,19 @@ export interface BaseOrderShippingDetail {
|
|||||||
id: string
|
id: string
|
||||||
shipping_method_id: string
|
shipping_method_id: string
|
||||||
shipping_method: BaseOrderShippingMethod
|
shipping_method: BaseOrderShippingMethod
|
||||||
claim_id: string
|
claim_id?: string
|
||||||
exchange_id: string
|
exchange_id?: string
|
||||||
return_id: string
|
return_id?: string
|
||||||
created_at: Date
|
created_at: Date
|
||||||
updated_at: Date
|
updated_at: Date
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BaseOrderChange {
|
|
||||||
id: string
|
|
||||||
order_id: string
|
|
||||||
actions: BaseOrderChangeAction[]
|
|
||||||
status: string
|
|
||||||
requested_by: string | null
|
|
||||||
requested_at: Date | string | null
|
|
||||||
confirmed_by: string | null
|
|
||||||
confirmed_at: Date | string | null
|
|
||||||
declined_by: string | null
|
|
||||||
declined_reason: string | null
|
|
||||||
metadata: Record<string, unknown> | null
|
|
||||||
declined_at: Date | string | null
|
|
||||||
canceled_by: string | null
|
|
||||||
canceled_at: Date | string | null
|
|
||||||
created_at: Date | string
|
|
||||||
updated_at: Date | string
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BaseOrderChangeAction {
|
|
||||||
id: string
|
|
||||||
order_change_id: string | null
|
|
||||||
order_change: BaseOrderChange | null
|
|
||||||
order_id: string | null
|
|
||||||
reference: string
|
|
||||||
reference_id: string
|
|
||||||
action: string
|
|
||||||
details: Record<string, unknown> | null
|
|
||||||
internal_note: string | null
|
|
||||||
created_at: Date | string
|
|
||||||
updated_at: Date | string
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BaseOrderTransaction {
|
export interface BaseOrderTransaction {
|
||||||
id: string
|
id: string
|
||||||
order_id: string
|
order_id: string
|
||||||
amount: number
|
amount: number
|
||||||
currency_code: string
|
currency_code: string
|
||||||
reference: string
|
reference: "capture" | "refund"
|
||||||
reference_id: string
|
reference_id: string
|
||||||
metadata: Record<string, unknown> | null
|
metadata: Record<string, unknown> | null
|
||||||
created_at: Date | string
|
created_at: Date | string
|
||||||
@@ -289,7 +254,7 @@ export interface BaseOrder {
|
|||||||
fulfillment_status: FulfillmentStatus
|
fulfillment_status: FulfillmentStatus
|
||||||
transactions?: BaseOrderTransaction[]
|
transactions?: BaseOrderTransaction[]
|
||||||
summary: BaseOrderSummary
|
summary: BaseOrderSummary
|
||||||
metadata: Record<string, unknown> | null
|
metadata?: Record<string, unknown> | null
|
||||||
created_at: string | Date
|
created_at: string | Date
|
||||||
updated_at: string | Date
|
updated_at: string | Date
|
||||||
original_item_total: number
|
original_item_total: number
|
||||||
@@ -378,14 +343,14 @@ export interface BaseOrderChange {
|
|||||||
*
|
*
|
||||||
* @expandable
|
* @expandable
|
||||||
*/
|
*/
|
||||||
return_order: any
|
return_order: BaseReturn
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The associated exchange order
|
* The associated exchange order
|
||||||
*
|
*
|
||||||
* @expandable
|
* @expandable
|
||||||
*/
|
*/
|
||||||
exchange: any
|
exchange: BaseExchange
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The associated claim order
|
* The associated claim order
|
||||||
@@ -404,7 +369,7 @@ export interface BaseOrderChange {
|
|||||||
/**
|
/**
|
||||||
* The status of the order change
|
* The status of the order change
|
||||||
*/
|
*/
|
||||||
status: string
|
status: OrderChangeStatus
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The requested by of the order change
|
* The requested by of the order change
|
||||||
@@ -414,7 +379,7 @@ export interface BaseOrderChange {
|
|||||||
/**
|
/**
|
||||||
* When the order change was requested
|
* When the order change was requested
|
||||||
*/
|
*/
|
||||||
requested_at: Date | string | null
|
requested_at: Date | null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The confirmed by of the order change
|
* The confirmed by of the order change
|
||||||
@@ -424,7 +389,7 @@ export interface BaseOrderChange {
|
|||||||
/**
|
/**
|
||||||
* When the order change was confirmed
|
* When the order change was confirmed
|
||||||
*/
|
*/
|
||||||
confirmed_at: Date | string | null
|
confirmed_at: Date | null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The declined by of the order change
|
* The declined by of the order change
|
||||||
@@ -444,7 +409,7 @@ export interface BaseOrderChange {
|
|||||||
/**
|
/**
|
||||||
* When the order change was declined
|
* When the order change was declined
|
||||||
*/
|
*/
|
||||||
declined_at: Date | string | null
|
declined_at: Date | null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The canceled by of the order change
|
* The canceled by of the order change
|
||||||
@@ -454,7 +419,7 @@ export interface BaseOrderChange {
|
|||||||
/**
|
/**
|
||||||
* When the order change was canceled
|
* When the order change was canceled
|
||||||
*/
|
*/
|
||||||
canceled_at: Date | string | null
|
canceled_at: Date | null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When the order change was created
|
* When the order change was created
|
||||||
@@ -518,7 +483,7 @@ export interface BaseOrderChangeAction {
|
|||||||
/**
|
/**
|
||||||
* The reference of the order change action
|
* The reference of the order change action
|
||||||
*/
|
*/
|
||||||
reference: string
|
reference: "claim" | "exchange" | "return" | "order_shipping_method"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID of the reference
|
* The ID of the reference
|
||||||
@@ -528,7 +493,7 @@ export interface BaseOrderChangeAction {
|
|||||||
/**
|
/**
|
||||||
* The action of the order change action
|
* The action of the order change action
|
||||||
*/
|
*/
|
||||||
action: string
|
action: ChangeActionType
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The details of the order change action
|
* The details of the order change action
|
||||||
|
|||||||
@@ -1,11 +1,30 @@
|
|||||||
|
import { StoreCustomer } from "../../customer"
|
||||||
|
import { StorePaymentCollection } from "../../payment"
|
||||||
|
import { StoreProduct, StoreProductVariant } from "../../product"
|
||||||
|
import { StoreRegionCountry } from "../../region"
|
||||||
import {
|
import {
|
||||||
BaseOrder,
|
BaseOrder,
|
||||||
BaseOrderAddress,
|
BaseOrderAddress,
|
||||||
|
BaseOrderFulfillment,
|
||||||
BaseOrderLineItem,
|
BaseOrderLineItem,
|
||||||
BaseOrderShippingMethod,
|
BaseOrderShippingMethod,
|
||||||
} from "../common"
|
} from "../common"
|
||||||
|
|
||||||
export interface StoreOrder extends BaseOrder {}
|
export interface StoreOrder extends Omit<BaseOrder, "items"> {
|
||||||
export interface StoreOrderLineItem extends BaseOrderLineItem {}
|
shipping_address?: StoreOrderAddress | null
|
||||||
export interface StoreOrderAddress extends BaseOrderAddress {}
|
billing_address?: StoreOrderAddress | null
|
||||||
|
items: StoreOrderLineItem[] | null
|
||||||
|
shipping_methods: StoreOrderShippingMethod[] | null
|
||||||
|
payment_collections?: StorePaymentCollection[]
|
||||||
|
fulfillments?: StoreOrderFulfillment[]
|
||||||
|
customer?: StoreCustomer
|
||||||
|
}
|
||||||
|
export interface StoreOrderLineItem extends Omit<BaseOrderLineItem, "product" | "variant"> {
|
||||||
|
variant?: StoreProductVariant
|
||||||
|
product?: StoreProduct
|
||||||
|
}
|
||||||
|
export interface StoreOrderAddress extends BaseOrderAddress {
|
||||||
|
country?: StoreRegionCountry
|
||||||
|
}
|
||||||
export interface StoreOrderShippingMethod extends BaseOrderShippingMethod {}
|
export interface StoreOrderShippingMethod extends BaseOrderShippingMethod {}
|
||||||
|
export interface StoreOrderFulfillment extends BaseOrderFulfillment {}
|
||||||
@@ -11,8 +11,18 @@ export interface AdminPaymentProvider extends BasePaymentProvider {
|
|||||||
is_enabled: boolean
|
is_enabled: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminPayment extends BasePayment {}
|
export interface AdminPayment extends BasePayment {
|
||||||
export interface AdminPaymentCollection extends BasePaymentCollection {}
|
refunds?: AdminRefund[]
|
||||||
export interface AdminPaymentSession extends BasePaymentSession {}
|
payment_collection?: AdminPaymentCollection
|
||||||
|
payment_session?: AdminPaymentSession
|
||||||
|
}
|
||||||
|
export interface AdminPaymentCollection extends BasePaymentCollection {
|
||||||
|
payments?: AdminPayment[]
|
||||||
|
payment_sessions?: AdminPaymentSession[]
|
||||||
|
payment_providers: AdminPaymentProvider[]
|
||||||
|
}
|
||||||
|
export interface AdminPaymentSession extends BasePaymentSession {
|
||||||
|
payment_collection?: AdminPaymentCollection
|
||||||
|
}
|
||||||
export interface AdminRefund extends BaseRefund {}
|
export interface AdminRefund extends BaseRefund {}
|
||||||
export interface AdminRefundReason extends RefundReason {}
|
export interface AdminRefundReason extends RefundReason {}
|
||||||
@@ -5,5 +5,10 @@ import {
|
|||||||
} from "../common"
|
} from "../common"
|
||||||
|
|
||||||
export interface StorePaymentProvider extends BasePaymentProvider {}
|
export interface StorePaymentProvider extends BasePaymentProvider {}
|
||||||
export interface StorePaymentCollection extends BasePaymentCollection {}
|
export interface StorePaymentCollection extends BasePaymentCollection {
|
||||||
export interface StorePaymentSession extends BasePaymentSession {}
|
payment_sessions?: StorePaymentSession[]
|
||||||
|
payment_providers: StorePaymentProvider[]
|
||||||
|
}
|
||||||
|
export interface StorePaymentSession extends BasePaymentSession {
|
||||||
|
payment_collection?: StorePaymentCollection
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
import { StoreProduct } from "../../product/store"
|
import { StoreProduct } from "../../product/store"
|
||||||
import { BaseProductCategory } from "../common"
|
import { BaseProductCategory } from "../common"
|
||||||
|
|
||||||
export interface StoreProductCategory extends BaseProductCategory {
|
export interface StoreProductCategory extends
|
||||||
products?: StoreProduct[]
|
Omit<BaseProductCategory, "is_active" | "is_internal" | "products" | "parent_category" | "category_children"> {
|
||||||
|
products?: StoreProduct[]
|
||||||
|
parent_category: StoreProductCategory | null
|
||||||
|
category_children: StoreProductCategory[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,18 +15,27 @@ import {
|
|||||||
|
|
||||||
export interface AdminProductVariant extends BaseProductVariant {
|
export interface AdminProductVariant extends BaseProductVariant {
|
||||||
prices: AdminPrice[] | null
|
prices: AdminPrice[] | null
|
||||||
|
options: AdminProductOptionValue[] | null
|
||||||
|
product?: AdminProduct | null
|
||||||
|
}
|
||||||
|
export interface AdminProductOption extends BaseProductOption {
|
||||||
|
product?: AdminProduct | null
|
||||||
|
values?: AdminProductOptionValue[]
|
||||||
}
|
}
|
||||||
export interface AdminProductOption extends BaseProductOption {}
|
|
||||||
export interface AdminProductImage extends BaseProductImage {}
|
export interface AdminProductImage extends BaseProductImage {}
|
||||||
export interface AdminProductOptionValue extends BaseProductOptionValue {}
|
export interface AdminProductOptionValue extends BaseProductOptionValue {
|
||||||
|
option?: AdminProductOption | null
|
||||||
|
}
|
||||||
export interface AdminProduct
|
export interface AdminProduct
|
||||||
extends Omit<BaseProduct, "categories" | "variants"> {
|
extends Omit<BaseProduct, "categories" | "variants"> {
|
||||||
collection?: AdminCollection | null
|
collection?: AdminCollection | null
|
||||||
categories?: AdminProductCategory[] | null
|
categories?: AdminProductCategory[] | null
|
||||||
sales_channels?: AdminSalesChannel[] | null
|
sales_channels?: AdminSalesChannel[] | null
|
||||||
variants?: AdminProductVariant[] | null
|
variants: AdminProductVariant[] | null
|
||||||
type: AdminProductType | null
|
type: AdminProductType | null
|
||||||
tags?: AdminProductTag[] | null
|
tags?: AdminProductTag[] | null
|
||||||
|
options: AdminProductOption[] | null
|
||||||
|
images: AdminProductImage[] | null
|
||||||
}
|
}
|
||||||
export type AdminProductStatus = ProductStatus
|
export type AdminProductStatus = ProductStatus
|
||||||
export interface AdminProductVariantInventoryLink {
|
export interface AdminProductVariantInventoryLink {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
import { StoreCollection } from "../../collection"
|
||||||
import { StoreProductCategory } from "../../product-category"
|
import { StoreProductCategory } from "../../product-category"
|
||||||
|
import { StoreProductTag } from "../../product-tag"
|
||||||
import { StoreProductType } from "../../product-type"
|
import { StoreProductType } from "../../product-type"
|
||||||
import {
|
import {
|
||||||
BaseProduct,
|
BaseProduct,
|
||||||
@@ -9,12 +11,25 @@ import {
|
|||||||
ProductStatus,
|
ProductStatus,
|
||||||
} from "../common"
|
} from "../common"
|
||||||
|
|
||||||
export interface StoreProduct extends Omit<BaseProduct, "categories"> {
|
export interface StoreProduct extends Omit<BaseProduct, "categories" | "sales_channels" | "variants" | "options"> {
|
||||||
|
collection?: StoreCollection | null
|
||||||
categories?: StoreProductCategory[] | null
|
categories?: StoreProductCategory[] | null
|
||||||
|
variants: StoreProductVariant[] | null
|
||||||
type?: StoreProductType | null
|
type?: StoreProductType | null
|
||||||
|
tags?: StoreProductTag[] | null
|
||||||
|
options: StoreProductOption[] | null
|
||||||
|
images: StoreProductImage[] | null
|
||||||
|
}
|
||||||
|
export interface StoreProductVariant extends Omit<BaseProductVariant, "product" | "options"> {
|
||||||
|
options: StoreProductOptionValue[] | null
|
||||||
|
product?: StoreProduct | null
|
||||||
|
}
|
||||||
|
export interface StoreProductOption extends Omit<BaseProductOption, "product" | "values"> {
|
||||||
|
product?: StoreProduct | null
|
||||||
|
values?: StoreProductOptionValue[]
|
||||||
}
|
}
|
||||||
export interface StoreProductVariant extends BaseProductVariant {}
|
|
||||||
export interface StoreProductOption extends BaseProductOption {}
|
|
||||||
export interface StoreProductImage extends BaseProductImage {}
|
export interface StoreProductImage extends BaseProductImage {}
|
||||||
export interface StoreProductOptionValue extends BaseProductOptionValue {}
|
export interface StoreProductOptionValue extends Omit<BaseProductOptionValue, "option"> {
|
||||||
|
option?: StoreProductOption | null
|
||||||
|
}
|
||||||
export type StoreProductStatus = ProductStatus
|
export type StoreProductStatus = ProductStatus
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
BaseApplicationMethod,
|
||||||
BasePromotion,
|
BasePromotion,
|
||||||
BasePromotionRule,
|
BasePromotionRule,
|
||||||
BaseRuleAttributeOptions,
|
BaseRuleAttributeOptions,
|
||||||
@@ -6,7 +7,15 @@ import {
|
|||||||
BaseRuleValueOptions
|
BaseRuleValueOptions
|
||||||
} from "../common";
|
} from "../common";
|
||||||
|
|
||||||
export interface AdminPromotion extends BasePromotion {}
|
export interface AdminPromotion extends BasePromotion {
|
||||||
|
application_method?: AdminApplicationMethod
|
||||||
|
rules?: AdminPromotionRule[]
|
||||||
|
}
|
||||||
|
export interface AdminApplicationMethod extends BaseApplicationMethod {
|
||||||
|
promotion?: AdminPromotion
|
||||||
|
target_rules?: AdminPromotionRule[]
|
||||||
|
buy_rules?: AdminPromotionRule[]
|
||||||
|
}
|
||||||
export interface AdminPromotionRule extends BasePromotionRule {}
|
export interface AdminPromotionRule extends BasePromotionRule {}
|
||||||
export interface AdminRuleAttributeOption extends BaseRuleAttributeOptions {}
|
export interface AdminRuleAttributeOption extends BaseRuleAttributeOptions {}
|
||||||
export interface AdminRuleOperatorOption extends BaseRuleOperatorOptions {}
|
export interface AdminRuleOperatorOption extends BaseRuleOperatorOptions {}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import { AdminReturnReason } from "./entities"
|
type AdminBaseReturnReasonPayload = {
|
||||||
|
value: string
|
||||||
type AdminBaseReturnReasonPayload = Pick<
|
label: string
|
||||||
AdminReturnReason,
|
description?: string
|
||||||
"value" | "label" | "description"
|
metadata?: Record<string, unknown> | null
|
||||||
>
|
}
|
||||||
|
|
||||||
export interface AdminCreateReturnReason extends AdminBaseReturnReasonPayload {
|
export interface AdminCreateReturnReason extends AdminBaseReturnReasonPayload {
|
||||||
metadata?: Record<string, unknown> | null
|
parent_return_reason_id?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdminUpdateReturnReason extends AdminBaseReturnReasonPayload {
|
export interface AdminUpdateReturnReason extends AdminBaseReturnReasonPayload {
|
||||||
metadata?: Record<string, unknown> | null
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { BaseReturn, BaseReturnItem } from "../common";
|
import { BaseReturn, BaseReturnItem } from "../common";
|
||||||
|
|
||||||
export interface AdminReturnItem extends BaseReturnItem {}
|
export interface AdminReturnItem extends BaseReturnItem {}
|
||||||
export interface AdminReturn extends BaseReturn {}
|
export interface AdminReturn extends BaseReturn {
|
||||||
|
items: AdminReturnItem[]
|
||||||
|
}
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
import { BaseReturn } from "../common";
|
import { BaseReturn, BaseReturnItem } from "../common";
|
||||||
|
|
||||||
export interface StoreReturn extends BaseReturn {}
|
export interface StoreReturn extends BaseReturn {
|
||||||
|
items: StoreReturnItem[]
|
||||||
|
}
|
||||||
|
export interface StoreReturnItem extends BaseReturnItem {}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ export type ChangeActionType =
|
|||||||
| "WRITE_OFF_ITEM"
|
| "WRITE_OFF_ITEM"
|
||||||
| "REINSTATE_ITEM"
|
| "REINSTATE_ITEM"
|
||||||
|
|
||||||
|
export type OrderChangeStatus = "confirmed" | "declined" | "requested" | "pending" | "canceled"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @interface
|
* @interface
|
||||||
*
|
*
|
||||||
@@ -1093,12 +1095,12 @@ export interface OrderDTO {
|
|||||||
/**
|
/**
|
||||||
* When the order was created.
|
* When the order was created.
|
||||||
*/
|
*/
|
||||||
created_at?: string | Date
|
created_at: string | Date
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When the order was updated.
|
* When the order was updated.
|
||||||
*/
|
*/
|
||||||
updated_at?: string | Date
|
updated_at: string | Date
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The original item total of the order.
|
* The original item total of the order.
|
||||||
@@ -1801,7 +1803,7 @@ export interface OrderChangeDTO {
|
|||||||
/**
|
/**
|
||||||
* The status of the order change
|
* The status of the order change
|
||||||
*/
|
*/
|
||||||
status: string
|
status: OrderChangeStatus
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The requested by of the order change
|
* The requested by of the order change
|
||||||
@@ -2699,4 +2701,5 @@ export interface OrderPreviewDTO
|
|||||||
shipping_methods: (OrderShippingMethodDTO & {
|
shipping_methods: (OrderShippingMethodDTO & {
|
||||||
actions?: OrderChangeActionDTO[]
|
actions?: OrderChangeActionDTO[]
|
||||||
})[]
|
})[]
|
||||||
|
return_requested_total: number
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -610,7 +610,7 @@ export interface PaymentProviderDTO {
|
|||||||
/**
|
/**
|
||||||
* Whether the payment provider is enabled.
|
* Whether the payment provider is enabled.
|
||||||
*/
|
*/
|
||||||
is_enabled: string
|
is_enabled: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export const POST = async (
|
|||||||
const [orderClaim] = await remoteQuery(queryObject)
|
const [orderClaim] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ export const DELETE = async (
|
|||||||
const [orderClaim] = await remoteQuery(queryObject)
|
const [orderClaim] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const POST = async (
|
|||||||
const [orderClaim] = await remoteQuery(queryObject)
|
const [orderClaim] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export const POST = async (
|
|||||||
const [orderReturn] = await remoteQuery(queryObject)
|
const [orderReturn] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ export const DELETE = async (
|
|||||||
)
|
)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as HttpTypes.AdminOrderPreview,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export const POST = async (
|
|||||||
const [orderReturn] = await remoteQuery(queryObject)
|
const [orderReturn] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -57,7 +57,7 @@ export const POST = async (
|
|||||||
const [orderClaim] = await remoteQuery(queryObject)
|
const [orderClaim] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ export const DELETE = async (
|
|||||||
const [orderReturn] = await remoteQuery(queryObject)
|
const [orderReturn] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as HttpTypes.AdminOrderPreview,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export const POST = async (
|
|||||||
const [orderReturn] = await remoteQuery(queryObject)
|
const [orderReturn] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export const POST = async (
|
|||||||
const [orderClaim] = await remoteQuery(queryObject)
|
const [orderClaim] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ export const DELETE = async (
|
|||||||
const [orderClaim] = await remoteQuery(queryObject)
|
const [orderClaim] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export const POST = async (
|
|||||||
const [orderClaim] = await remoteQuery(queryObject)
|
const [orderClaim] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -43,7 +43,7 @@ export const POST = async (
|
|||||||
const [orderClaim] = await remoteQuery(queryObject)
|
const [orderClaim] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ export const DELETE = async (
|
|||||||
const [orderClaim] = await remoteQuery(queryObject)
|
const [orderClaim] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const POST = async (
|
|||||||
const [orderClaim] = await remoteQuery(queryObject)
|
const [orderClaim] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export const POST = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
claim: orderClaim,
|
claim: orderClaim,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export const POST = async (
|
|||||||
const [orderReturn] = await remoteQuery(queryObject)
|
const [orderReturn] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ export const DELETE = async (
|
|||||||
const [orderReturn] = await remoteQuery(queryObject)
|
const [orderReturn] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as HttpTypes.AdminOrderPreview,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export const POST = async (
|
|||||||
const [orderReturn] = await remoteQuery(queryObject)
|
const [orderReturn] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -12,7 +12,7 @@ import {
|
|||||||
} from "../../../../../../../types/routing"
|
} from "../../../../../../../types/routing"
|
||||||
import { defaultAdminDetailsReturnFields } from "../../../../../returns/query-config"
|
import { defaultAdminDetailsReturnFields } from "../../../../../returns/query-config"
|
||||||
import { AdminPostExchangesShippingActionReqSchemaType } from "../../../../validators"
|
import { AdminPostExchangesShippingActionReqSchemaType } from "../../../../validators"
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { AdminOrderPreview, HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminPostExchangesShippingActionReqSchemaType>,
|
req: AuthenticatedMedusaRequest<AdminPostExchangesShippingActionReqSchemaType>,
|
||||||
@@ -57,7 +57,7 @@ export const POST = async (
|
|||||||
const [orderExchange] = await remoteQuery(queryObject)
|
const [orderExchange] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as AdminOrderPreview,
|
||||||
exchange: orderExchange,
|
exchange: orderExchange,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ export const DELETE = async (
|
|||||||
const [orderReturn] = await remoteQuery(queryObject)
|
const [orderReturn] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as AdminOrderPreview,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export const POST = async (
|
|||||||
const [orderReturn] = await remoteQuery(queryObject)
|
const [orderReturn] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export const POST = async (
|
|||||||
const [orderExchange] = await remoteQuery(queryObject)
|
const [orderExchange] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
exchange: orderExchange,
|
exchange: orderExchange,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ export const DELETE = async (
|
|||||||
const [orderExchange] = await remoteQuery(queryObject)
|
const [orderExchange] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as HttpTypes.AdminOrderPreview,
|
||||||
exchange: orderExchange,
|
exchange: orderExchange,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export const POST = async (
|
|||||||
const [orderExchange] = await remoteQuery(queryObject)
|
const [orderExchange] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
exchange: orderExchange,
|
exchange: orderExchange,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -43,7 +43,7 @@ export const POST = async (
|
|||||||
const [orderExchange] = await remoteQuery(queryObject)
|
const [orderExchange] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
exchange: orderExchange,
|
exchange: orderExchange,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ export const DELETE = async (
|
|||||||
const [orderExchange] = await remoteQuery(queryObject)
|
const [orderExchange] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as HttpTypes.AdminOrderPreview,
|
||||||
exchange: orderExchange,
|
exchange: orderExchange,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const POST = async (
|
|||||||
const [orderExchange] = await remoteQuery(queryObject)
|
const [orderExchange] = await remoteQuery(queryObject)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
exchange: orderExchange,
|
exchange: orderExchange,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export const POST = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
exchange: orderExchange,
|
exchange: orderExchange,
|
||||||
return: orderReturn,
|
return: orderReturn,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -19,6 +19,6 @@ export const POST = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const POST = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,6 +44,6 @@ export const DELETE = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as HttpTypes.AdminOrderPreview,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,6 @@ export const POST = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,6 @@ export const POST = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,6 @@ export const POST = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export const POST = async (
|
|||||||
)
|
)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,6 +46,6 @@ export const DELETE = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: orderPreview,
|
order_preview: orderPreview as unknown as HttpTypes.AdminOrderPreview,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,6 @@ export const POST = async (
|
|||||||
)
|
)
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_preview: result,
|
order_preview: result as unknown as HttpTypes.AdminOrderPreview,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,6 @@ export const POST = async (
|
|||||||
})
|
})
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
order_change: result,
|
order_change: result as unknown as HttpTypes.AdminOrderChange,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,7 @@ import {
|
|||||||
deleteReturnReasonsWorkflow,
|
deleteReturnReasonsWorkflow,
|
||||||
updateReturnReasonsWorkflow,
|
updateReturnReasonsWorkflow,
|
||||||
} from "@medusajs/core-flows"
|
} from "@medusajs/core-flows"
|
||||||
import {
|
import { AdminReturnReasonResponse, HttpTypes } from "@medusajs/types"
|
||||||
AdminReturnReasonResponse,
|
|
||||||
HttpTypes,
|
|
||||||
UpdateOrderReturnReasonDTO,
|
|
||||||
} from "@medusajs/types"
|
|
||||||
import {
|
import {
|
||||||
ContainerRegistrationKeys,
|
ContainerRegistrationKeys,
|
||||||
MedusaError,
|
MedusaError,
|
||||||
@@ -40,7 +36,7 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<UpdateOrderReturnReasonDTO>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminUpdateReturnReason>,
|
||||||
res: MedusaResponse<AdminReturnReasonResponse>
|
res: MedusaResponse<AdminReturnReasonResponse>
|
||||||
) => {
|
) => {
|
||||||
const workflow = updateReturnReasonsWorkflow(req.scope)
|
const workflow = updateReturnReasonsWorkflow(req.scope)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { createReturnReasonsWorkflow } from "@medusajs/core-flows"
|
import { createReturnReasonsWorkflow } from "@medusajs/core-flows"
|
||||||
import { CreateOrderReturnReasonDTO, HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
import {
|
import {
|
||||||
ContainerRegistrationKeys,
|
ContainerRegistrationKeys,
|
||||||
remoteQueryObjectFromString,
|
remoteQueryObjectFromString,
|
||||||
@@ -36,7 +36,7 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<CreateOrderReturnReasonDTO>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateReturnReason>,
|
||||||
res: MedusaResponse<HttpTypes.AdminReturnReasonResponse>
|
res: MedusaResponse<HttpTypes.AdminReturnReasonResponse>
|
||||||
) => {
|
) => {
|
||||||
const workflow = createReturnReasonsWorkflow(req.scope)
|
const workflow = createReturnReasonsWorkflow(req.scope)
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { updateTaxLinesWorkflow } from "@medusajs/core-flows"
|
import { updateTaxLinesWorkflow } from "@medusajs/core-flows"
|
||||||
import { MedusaRequest, MedusaResponse } from "../../../../../types/routing"
|
import { MedusaRequest, MedusaResponse } from "../../../../../types/routing"
|
||||||
import { refetchCart } from "../../helpers"
|
import { refetchCart } from "../../helpers"
|
||||||
import { StoreCalculateCartTaxesType } from "../../validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: MedusaRequest<StoreCalculateCartTaxesType>,
|
req: MedusaRequest,
|
||||||
res: MedusaResponse<HttpTypes.StoreCartResponse>
|
res: MedusaResponse<HttpTypes.StoreCartResponse>
|
||||||
) => {
|
) => {
|
||||||
const workflow = updateTaxLinesWorkflow(req.scope)
|
const workflow = updateTaxLinesWorkflow(req.scope)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export const defaultStoreCartFields = [
|
|||||||
"original_shipping_tax_total",
|
"original_shipping_tax_total",
|
||||||
"original_shipping_subtotal",
|
"original_shipping_subtotal",
|
||||||
"original_shipping_total",
|
"original_shipping_total",
|
||||||
|
"metadata",
|
||||||
"promotions.id",
|
"promotions.id",
|
||||||
"promotions.code",
|
"promotions.code",
|
||||||
"promotions.is_automatic",
|
"promotions.is_automatic",
|
||||||
|
|||||||
Reference in New Issue
Block a user