chore(medusa,types): [2] Add request types to API routes (#8559)

* chore(medusa,types): [2] Add request types to API routes

* fix up base currency
This commit is contained in:
Shahed Nasser
2024-08-13 09:36:41 +03:00
committed by GitHub
parent 96bdf3e2c6
commit e5e8489cc0
17 changed files with 87 additions and 34 deletions

View File

@@ -1,14 +1,3 @@
import { RawRounding } from "../../../common"
import { BaseCurrency } from "../common"
export interface AdminCurrency {
code: string
symbol: string
symbol_native: string
name: string
decimal_digits: number
raw_rounding: RawRounding
rounding: number
created_at: string
updated_at: string
deleted_at: string | null
}
export interface AdminCurrency extends BaseCurrency {}

View File

@@ -0,0 +1,14 @@
import { RawRounding } from "../../common"
export interface BaseCurrency {
code: string
symbol: string
symbol_native: string
name: string
decimal_digits: number
rounding: number
raw_rounding: RawRounding
created_at: string
updated_at: string
deleted_at: string | null
}

View File

@@ -1 +1,3 @@
export * from "./admin"
export * from "./common"
export * from "./store"

View File

@@ -0,0 +1,3 @@
import { BaseCurrency } from "../common";
export interface StoreCurrency extends BaseCurrency {}

View File

@@ -0,0 +1,2 @@
export * from "./entities"
export * from "./responses"

View File

@@ -0,0 +1,9 @@
import { PaginatedResponse } from "../../common";
import { StoreCurrency } from "./entities";
export interface StoreCurrencyResponse {
currency: StoreCurrency
}
export interface StoreCurrencyListResponse
extends PaginatedResponse<{ currencies: StoreCurrency[] }> {}

View File

@@ -0,0 +1,7 @@
import {
BaseCustomer,
BaseCustomerAddress,
} from "../common"
export interface StoreCustomer extends BaseCustomer {}
export interface StoreCustomerAddress extends BaseCustomerAddress {}

View File

@@ -0,0 +1,4 @@
export * from "./entities"
export * from "./payloads"
export * from "./queries"
export * from "./responses"

View File

@@ -1,19 +1,9 @@
import {
BaseCreateCustomer,
BaseCreateCustomerAddress,
BaseCustomer,
BaseCustomerAddress,
BaseCustomerAddressFilters,
BaseCustomerFilters,
BaseUpdateCustomer,
BaseUpdateCustomerAddress,
} from "./common"
export interface StoreCustomer extends BaseCustomer {}
export interface StoreCustomerAddress extends BaseCustomerAddress {}
export interface StoreCustomerFilters extends BaseCustomerFilters {}
export interface StoreCustomerAddressFilters
extends BaseCustomerAddressFilters {}
} from "../common"
export interface StoreCreateCustomer extends BaseCreateCustomer {}
export interface StoreUpdateCustomer extends BaseUpdateCustomer {}

View File

@@ -0,0 +1,8 @@
import {
BaseCustomerAddressFilters,
BaseCustomerFilters,
} from "../common"
export interface StoreCustomerFilters extends BaseCustomerFilters {}
export interface StoreCustomerAddressFilters
extends BaseCustomerAddressFilters {}

View File

@@ -0,0 +1,13 @@
import { PaginatedResponse } from "../../common";
import { StoreCustomer, StoreCustomerAddress } from "./entities";
export interface StoreCustomerResponse {
customer: StoreCustomer
}
export interface StoreCustomerAddressResponse {
address: StoreCustomerAddress
}
export interface StoreCustomerAddressListResponse
extends PaginatedResponse<{ addresses: StoreCustomerAddress[] }> {}