chore(medusa,types): [12] Add request types to API routes (#8574)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { BaseOrder } from "../order/common";
|
||||
import { AdminBaseReturnItem, AdminReturn } from "../return";
|
||||
import { AdminReturnItem, AdminReturn } from "../return";
|
||||
|
||||
export interface BaseExchangeItem {
|
||||
id: string
|
||||
@@ -14,7 +14,7 @@ export interface BaseExchangeItem {
|
||||
|
||||
export interface BaseExchange extends Omit<BaseOrder, "status" | "version" | "items"> {
|
||||
order_id: string
|
||||
return_items: AdminBaseReturnItem[]
|
||||
return_items: AdminReturnItem[]
|
||||
additional_items: BaseExchangeItem[]
|
||||
no_notification?: boolean
|
||||
difference_due?: number
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import {
|
||||
BaseRegion,
|
||||
BaseRegionCountry,
|
||||
} from "../common"
|
||||
|
||||
export interface AdminRegion extends BaseRegion {}
|
||||
export interface AdminRegionCountry extends BaseRegionCountry {}
|
||||
@@ -0,0 +1,4 @@
|
||||
export * from "./entities"
|
||||
export * from "./payloads"
|
||||
export * from "./queries"
|
||||
export * from "./responses"
|
||||
-12
@@ -1,15 +1,3 @@
|
||||
import {
|
||||
BaseRegion,
|
||||
BaseRegionCountry,
|
||||
BaseRegionCountryFilters,
|
||||
BaseRegionFilters,
|
||||
} from "./common"
|
||||
|
||||
export interface AdminRegion extends BaseRegion {}
|
||||
export interface AdminRegionCountry extends BaseRegionCountry {}
|
||||
export interface AdminRegionFilters extends BaseRegionFilters {}
|
||||
export interface AdminRegionCountryFilters extends BaseRegionCountryFilters {}
|
||||
|
||||
export interface AdminCreateRegion {
|
||||
name: string
|
||||
currency_code: string
|
||||
@@ -0,0 +1,7 @@
|
||||
import {
|
||||
BaseRegionCountryFilters,
|
||||
BaseRegionFilters,
|
||||
} from "../common"
|
||||
|
||||
export interface AdminRegionFilters extends BaseRegionFilters {}
|
||||
export interface AdminRegionCountryFilters extends BaseRegionCountryFilters {}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { PaginatedResponse } from "../../common";
|
||||
import { AdminRegion } from "./entities";
|
||||
|
||||
export interface AdminRegionResponse {
|
||||
region: AdminRegion
|
||||
}
|
||||
|
||||
export type AdminRegionListResponse = PaginatedResponse<{
|
||||
regions: AdminRegion[]
|
||||
}>
|
||||
+2
-12
@@ -1,6 +1,4 @@
|
||||
import { PaginatedResponse } from "../../common"
|
||||
|
||||
interface ReservationResponse {
|
||||
export interface ReservationResponse {
|
||||
id: string
|
||||
line_item_id: string | null
|
||||
location_id: string
|
||||
@@ -14,12 +12,4 @@ interface ReservationResponse {
|
||||
deleted_at?: Date | string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
}
|
||||
|
||||
export interface AdminReservationResponse {
|
||||
reservation: ReservationResponse
|
||||
}
|
||||
|
||||
export type AdminReservationListResponse = PaginatedResponse<{
|
||||
reservations: ReservationResponse[]
|
||||
}>
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
export * from "./reservation"
|
||||
export * from "./entities"
|
||||
export * from "./responses"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { PaginatedResponse } from "../../common"
|
||||
import { ReservationResponse } from "./entities"
|
||||
|
||||
export interface AdminReservationResponse {
|
||||
reservation: ReservationResponse
|
||||
}
|
||||
|
||||
export type AdminReservationListResponse = PaginatedResponse<{
|
||||
reservations: ReservationResponse[]
|
||||
}>
|
||||
@@ -0,0 +1,4 @@
|
||||
import { BaseReturn, BaseReturnItem } from "../common";
|
||||
|
||||
export interface AdminReturnItem extends BaseReturnItem {}
|
||||
export interface AdminReturn extends BaseReturn {}
|
||||
@@ -0,0 +1,4 @@
|
||||
export * from "./entities"
|
||||
export * from "./payloads"
|
||||
export * from "./queries"
|
||||
export * from "./responses"
|
||||
+1
-49
@@ -1,39 +1,3 @@
|
||||
import { OperatorMap } from "../../dal"
|
||||
import { FindParams } from "../common"
|
||||
|
||||
export interface AdminBaseReturnItem {
|
||||
id: string
|
||||
quantity: number
|
||||
received_quantity: number
|
||||
reason_id?: string
|
||||
note?: string
|
||||
item_id: string
|
||||
return_id: string
|
||||
metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface AdminReturn {
|
||||
id: string
|
||||
order_id: string
|
||||
status?: string
|
||||
exchange_id?: string
|
||||
location_id?: string
|
||||
claim_id?: string
|
||||
order_version: number
|
||||
display_id: number
|
||||
no_notification?: boolean
|
||||
refund_amount?: number
|
||||
items: AdminBaseReturnItem[]
|
||||
}
|
||||
|
||||
export interface AdminReturnResponse {
|
||||
return: AdminReturn
|
||||
}
|
||||
|
||||
export interface AdminReturnsResponse {
|
||||
returns: AdminReturn[]
|
||||
}
|
||||
|
||||
export interface AdminInitiateReturnRequest {
|
||||
order_id: string
|
||||
location_id?: string
|
||||
@@ -115,16 +79,4 @@ export interface AdminUpdateDismissItems {
|
||||
internal_note?: string
|
||||
reason_id?: string
|
||||
metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface AdminReturnFilters extends FindParams {
|
||||
id?: string[] | string | OperatorMap<string | string[]>
|
||||
order_id?: string[] | string | OperatorMap<string | string[]>
|
||||
status?:
|
||||
| string[]
|
||||
| string
|
||||
| Record<string, unknown>
|
||||
| OperatorMap<Record<string, unknown>>
|
||||
created_at?: OperatorMap<string>
|
||||
updated_at?: OperatorMap<string>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { OperatorMap } from "../../../dal"
|
||||
import { FindParams } from "../../common"
|
||||
|
||||
export interface AdminReturnFilters extends FindParams {
|
||||
id?: string[] | string | OperatorMap<string | string[]>
|
||||
order_id?: string[] | string | OperatorMap<string | string[]>
|
||||
status?:
|
||||
| string[]
|
||||
| string
|
||||
| Record<string, unknown>
|
||||
| OperatorMap<Record<string, unknown>>
|
||||
created_at?: OperatorMap<string>
|
||||
updated_at?: OperatorMap<string>
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { OrderDTO } from "../../../order"
|
||||
import { PaginatedResponse } from "../../common"
|
||||
import { AdminOrderPreview } from "../../order"
|
||||
import { AdminReturn } from "./entities"
|
||||
|
||||
export interface AdminReturnResponse {
|
||||
return: AdminReturn
|
||||
}
|
||||
|
||||
export type AdminReturnsResponse = PaginatedResponse<{
|
||||
returns: AdminReturn[]
|
||||
}>
|
||||
|
||||
export interface AdminOrderReturnResponse {
|
||||
order: OrderDTO
|
||||
return: AdminReturn
|
||||
}
|
||||
|
||||
export interface AdminReturnPreviewResponse {
|
||||
order_preview: AdminOrderPreview
|
||||
return: AdminReturn
|
||||
}
|
||||
Reference in New Issue
Block a user