feat: Clean up shipping options management (#6977)

**What**
- cleanup existing route on some aspects but not all
- add new create shipping options end point and types
- add set of integration tests
- cleanup existing fulfillment routes
- align existing integration tests
- transform old type to zod types and validators
- fix stock location route
This commit is contained in:
Adrien de Peretti
2024-04-06 16:52:05 +00:00
committed by GitHub
parent 5724d80286
commit bc06ad2db4
22 changed files with 556 additions and 205 deletions
@@ -4,12 +4,12 @@ import { AdminShippingOptionTypeResponse } from "./shipping-option-type"
import { AdminShippingOptionRuleResponse } from "./shipping-option-rule"
import { AdminShippingProfileResponse } from "./shipping-profile"
import { AdminFulfillmentProviderResponse } from "./fulfillment-provider"
import { AdminFulfillmentResponse } from "./fulfillment"
import { AdminPriceSetPriceResponse } from "../../pricing"
/**
* @experimental
*/
export interface AdminShippingOptionResponse {
interface AdminShippingOptionResponse {
id: string
name: string
price_type: ShippingOptionPriceType
@@ -21,11 +21,18 @@ export interface AdminShippingOptionResponse {
metadata: Record<string, unknown> | null
service_zone: AdminServiceZoneResponse
shipping_profile: AdminShippingProfileResponse
fulfillment_provider: AdminFulfillmentProviderResponse
provider: AdminFulfillmentProviderResponse
type: AdminShippingOptionTypeResponse
rules: AdminShippingOptionRuleResponse[]
fulfillments: AdminFulfillmentResponse[]
prices: AdminPriceSetPriceResponse[]
created_at: Date
updated_at: Date
deleted_at: Date | null
}
/**
* @experimental
*/
export interface AdminShippingOptionRetrieveResponse {
shipping_option: AdminShippingOptionResponse[]
}
+1
View File
@@ -1,4 +1,5 @@
export * from "./api-key"
export * from "./fulfillment"
export * from "./pricing"
export * from "./sales-channel"
export * from "./stock-locations"
+1
View File
@@ -0,0 +1 @@
export * from "./price"
+7
View File
@@ -0,0 +1,7 @@
export interface AdminPriceSetPriceResponse {
id: string
amount: number
currency_code: string
created_at: string
updated_at: string
}