Feat: draft order api (#6797)

This commit is contained in:
Carlos R. L. Rodrigues
2024-04-06 16:35:10 +02:00
committed by GitHub
parent 883a75c4f3
commit df0751f122
63 changed files with 2179 additions and 1424 deletions

View File

@@ -50,15 +50,21 @@ export const LINKS = {
Modules.STOCK_LOCATION,
"location_id"
),
PublishableApiKeySalesChannel: composeLinkName(
Modules.API_KEY,
"api_key_id",
OrderPromotion: composeLinkName(
Modules.ORDER,
"order_id",
Modules.PROMOTION,
"promotion_id"
),
OrderSalesChannel: composeLinkName(
Modules.ORDER,
"order_id",
Modules.SALES_CHANNEL,
"sales_channel_id"
),
ProductSalesChannel: composeLinkName(
Modules.PRODUCT,
"product_id",
PublishableApiKeySalesChannel: composeLinkName(
Modules.API_KEY,
"api_key_id",
Modules.SALES_CHANNEL,
"sales_channel_id"
),
@@ -70,9 +76,9 @@ export const LINKS = {
"shippingProfileService",
"profile_id"
),
OrderSalesChannel: composeLinkName(
"orderService",
"order_id",
ProductSalesChannel: composeLinkName(
Modules.PRODUCT,
"product_id",
Modules.SALES_CHANNEL,
"sales_channel_id"
),

View File

@@ -6,6 +6,10 @@ import { BigNumber } from "./big-number"
type BNInput = BigNumberInput | BigNumber
export class MathBN {
static convert(num: BNInput): BigNumberJS {
if (num == null) {
return new BigNumberJS(0)
}
if (num instanceof BigNumber) {
return num.bigNumber!
} else if (num instanceof BigNumberJS) {