chore(medusa,types): [4] Add request types to API routes (#8561)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-08-13 09:37:11 +03:00
1 parent 578e5182dd
commit 078c2df773
27 files changed
+143 -19

No files matched your search

@@ -1,4 +1,3 @@
export interface AdminFulfillmentProvider {
id: string
is_enabled: boolean
}
import { BaseFulfillmentProvider } from "../common";
export interface AdminFulfillmentProvider extends BaseFulfillmentProvider {}
@@ -0,0 +1,4 @@
export interface BaseFulfillmentProvider {
id: string
is_enabled: boolean
}
@@ -0,0 +1,7 @@
import {
BaseRegion,
BaseRegionCountry,
} from "../common"
export interface StoreRegion extends BaseRegion {}
export interface StoreRegionCountry extends BaseRegionCountry {}
@@ -0,0 +1,3 @@
export * from "./entities"
export * from "./queries"
export * from "./responses"
@@ -1,11 +1,7 @@
import {
BaseRegion,
BaseRegionCountry,
BaseRegionCountryFilters,
BaseRegionFilters,
} from "./common"
} from "../common"
export interface StoreRegion extends BaseRegion {}
export interface StoreRegionCountry extends BaseRegionCountry {}
export interface StoreRegionFilters extends BaseRegionFilters {}
export interface StoreRegionCountryFilters extends BaseRegionCountryFilters {}
@@ -0,0 +1,8 @@
import { PaginatedResponse } from "../../common";
import { StoreRegion } from "./entities";
export type StoreRegionResponse = {
region: StoreRegion
}
export type StoreRegionListResponse = PaginatedResponse<{ regions: StoreRegion[] }>
@@ -1 +1,2 @@
export * from "./admin"
export * from "./store"
@@ -0,0 +1,3 @@
import { BaseReturnReason } from "../common";
export interface StoreReturnReason extends BaseReturnReason {}
@@ -0,0 +1,2 @@
export * from "./entities"
export * from "./responses"
@@ -0,0 +1,10 @@
import { PaginatedResponse } from "../../common";
import { StoreReturnReason } from "./entities";
export interface StoreReturnReasonResponse {
return_reason: StoreReturnReason
}
export type StoreReturnReasonListResponse = PaginatedResponse<{
return_reasons: StoreReturnReason[]
}>
@@ -0,0 +1,24 @@
export interface BaseReturnItem {
id: string
quantity: number
received_quantity: number
reason_id?: string
note?: string
item_id: string
return_id: string
metadata?: Record<string, unknown>
}
export interface BaseReturn {
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: BaseReturnItem[]
}
@@ -1 +1,2 @@
export * from "./admin"
export * from "./store"
@@ -0,0 +1,3 @@
import { BaseReturn } from "../common";
export interface StoreReturn extends BaseReturn {}
@@ -0,0 +1,2 @@
export * from "./entities"
export * from "./responses"
@@ -0,0 +1,5 @@
import { StoreReturn } from "./entities";
export interface StoreReturnResponse {
return: StoreReturn
}
@@ -1 +1,2 @@
export * from "./admin"
export * from "./store"
@@ -0,0 +1,29 @@
import { ShippingOptionPriceType } from "../../../fulfillment"
import { BaseFulfillmentProvider } from "../../fulfillment-provider/common"
export interface StoreShippingOptionType {
id: string
label: string
description: string
code: string
shipping_option_id: string
created_at: string
updated_at: string
deleted_at: string | null
}
export interface StoreShippingOption {
id: string
name: string
price_type: ShippingOptionPriceType
service_zone_id: string
provider_id: string
provider: BaseFulfillmentProvider
shipping_option_type_id: string | null
type: StoreShippingOptionType
shipping_profile_id: string
amount: number
is_tax_inclusive: boolean
data: Record<string, unknown> | null
metadata: Record<string, unknown> | null
}
@@ -0,0 +1,2 @@
export * from "./entities"
export * from "./responses"
@@ -0,0 +1,5 @@
import { StoreShippingOption } from ".";
export interface StoreShippingOptionListResponse {
shipping_options: StoreShippingOption[]
}