fix(types): remove BigNumberValue usages in http types (#9285)

remove all `BigNumberValue` usages in http types, since http requests will only receive a number.
This commit is contained in:
Shahed Nasser
2024-09-25 15:12:43 +03:00
committed by GitHub
parent 6d16b3294e
commit d7dd7de0fe
4 changed files with 73 additions and 74 deletions

View File

@@ -1,4 +1,3 @@
import { BigNumberValue } from "../../totals"
import { BasePaymentCollection } from "../payment/common" import { BasePaymentCollection } from "../payment/common"
import { BaseProduct, BaseProductVariant } from "../product/common" import { BaseProduct, BaseProductVariant } from "../product/common"
import { BaseRegion } from "../region/common" import { BaseRegion } from "../region/common"
@@ -94,112 +93,112 @@ export interface BaseCart {
/** /**
* The original item total of the cart. * The original item total of the cart.
*/ */
original_item_total: BigNumberValue original_item_total: number
/** /**
* The original item subtotal of the cart. * The original item subtotal of the cart.
*/ */
original_item_subtotal: BigNumberValue original_item_subtotal: number
/** /**
* The original item tax total of the cart. * The original item tax total of the cart.
*/ */
original_item_tax_total: BigNumberValue original_item_tax_total: number
/** /**
* The item total of the cart. * The item total of the cart.
*/ */
item_total: BigNumberValue item_total: number
/** /**
* The item subtotal of the cart. * The item subtotal of the cart.
*/ */
item_subtotal: BigNumberValue item_subtotal: number
/** /**
* The item tax total of the cart. * The item tax total of the cart.
*/ */
item_tax_total: BigNumberValue item_tax_total: number
/** /**
* The original total of the cart. * The original total of the cart.
*/ */
original_total: BigNumberValue original_total: number
/** /**
* The original subtotal of the cart. * The original subtotal of the cart.
*/ */
original_subtotal: BigNumberValue original_subtotal: number
/** /**
* The original tax total of the cart. * The original tax total of the cart.
*/ */
original_tax_total: BigNumberValue original_tax_total: number
/** /**
* The total of the cart. * The total of the cart.
*/ */
total: BigNumberValue total: number
/** /**
* The subtotal of the cart. (Excluding taxes) * The subtotal of the cart. (Excluding taxes)
*/ */
subtotal: BigNumberValue subtotal: number
/** /**
* The tax total of the cart. * The tax total of the cart.
*/ */
tax_total: BigNumberValue tax_total: number
/** /**
* The discount total of the cart. * The discount total of the cart.
*/ */
discount_total: BigNumberValue discount_total: number
/** /**
* The discount tax total of the cart. * The discount tax total of the cart.
*/ */
discount_tax_total: BigNumberValue discount_tax_total: number
/** /**
* The gift card total of the cart. * The gift card total of the cart.
*/ */
gift_card_total: BigNumberValue gift_card_total: number
/** /**
* The gift card tax total of the cart. * The gift card tax total of the cart.
*/ */
gift_card_tax_total: BigNumberValue gift_card_tax_total: number
/** /**
* The shipping total of the cart. * The shipping total of the cart.
*/ */
shipping_total: BigNumberValue shipping_total: number
/** /**
* The shipping subtotal of the cart. * The shipping subtotal of the cart.
*/ */
shipping_subtotal: BigNumberValue shipping_subtotal: number
/** /**
* The shipping tax total of the cart. * The shipping tax total of the cart.
*/ */
shipping_tax_total: BigNumberValue shipping_tax_total: number
/** /**
* The original shipping total of the cart. * The original shipping total of the cart.
*/ */
original_shipping_total: BigNumberValue original_shipping_total: number
/** /**
* The original shipping subtotal of the cart. * The original shipping subtotal of the cart.
*/ */
original_shipping_subtotal: BigNumberValue original_shipping_subtotal: number
/** /**
* The original shipping tax total of the cart. * The original shipping tax total of the cart.
*/ */
original_shipping_tax_total: BigNumberValue original_shipping_tax_total: number
} }
export interface BaseCartAddress { export interface BaseCartAddress {
@@ -306,7 +305,7 @@ export interface BaseCartShippingMethod {
/** /**
* The price of the shipping method. * The price of the shipping method.
*/ */
amount: BigNumberValue amount: number
/** /**
* Whether the shipping method price is tax inclusive. * Whether the shipping method price is tax inclusive.
@@ -355,42 +354,42 @@ export interface BaseCartShippingMethod {
/** /**
* The original total of the cart shipping method. * The original total of the cart shipping method.
*/ */
original_total: BigNumberValue original_total: number
/** /**
* The original subtotal of the cart shipping method. * The original subtotal of the cart shipping method.
*/ */
original_subtotal: BigNumberValue original_subtotal: number
/** /**
* The original tax total of the cart shipping method. * The original tax total of the cart shipping method.
*/ */
original_tax_total: BigNumberValue original_tax_total: number
/** /**
* The total of the cart shipping method. * The total of the cart shipping method.
*/ */
total: BigNumberValue total: number
/** /**
* The subtotal of the cart shipping method. * The subtotal of the cart shipping method.
*/ */
subtotal: BigNumberValue subtotal: number
/** /**
* The tax total of the cart shipping method. * The tax total of the cart shipping method.
*/ */
tax_total: BigNumberValue tax_total: number
/** /**
* The discount total of the cart shipping method. * The discount total of the cart shipping method.
*/ */
discount_total: BigNumberValue discount_total: number
/** /**
* The discount tax total of the cart shipping method. * The discount tax total of the cart shipping method.
*/ */
discount_tax_total: BigNumberValue discount_tax_total: number
} }
/** /**
@@ -420,7 +419,7 @@ export interface BaseCartLineItem extends BaseCartLineItemTotals {
/** /**
* The line item's quantity in the cart. * The line item's quantity in the cart.
*/ */
quantity: BigNumberValue quantity: number
/** /**
* The associated product with the line item. * The associated product with the line item.
@@ -514,12 +513,12 @@ export interface BaseCartLineItem extends BaseCartLineItemTotals {
/** /**
* The calculated price of the line item. * The calculated price of the line item.
*/ */
compare_at_unit_price?: BigNumberValue compare_at_unit_price?: number
/** /**
* The unit price of the item. * The unit price of the item.
*/ */
unit_price: BigNumberValue unit_price: number
/** /**
* The associated tax lines. * The associated tax lines.
@@ -575,57 +574,57 @@ export interface BaseCartLineItemTotals {
/** /**
* The original total of the cart line item. * The original total of the cart line item.
*/ */
original_total: BigNumberValue original_total: number
/** /**
* The original subtotal of the cart line item. * The original subtotal of the cart line item.
*/ */
original_subtotal: BigNumberValue original_subtotal: number
/** /**
* The original tax total of the cart line item. * The original tax total of the cart line item.
*/ */
original_tax_total: BigNumberValue original_tax_total: number
/** /**
* The item total of the cart line item. * The item total of the cart line item.
*/ */
item_total: BigNumberValue item_total: number
/** /**
* The item subtotal of the cart line item. * The item subtotal of the cart line item.
*/ */
item_subtotal: BigNumberValue item_subtotal: number
/** /**
* The item tax total of the cart line item. * The item tax total of the cart line item.
*/ */
item_tax_total: BigNumberValue item_tax_total: number
/** /**
* The total of the cart line item. * The total of the cart line item.
*/ */
total: BigNumberValue total: number
/** /**
* The subtotal of the cart line item. * The subtotal of the cart line item.
*/ */
subtotal: BigNumberValue subtotal: number
/** /**
* The tax total of the cart line item. * The tax total of the cart line item.
*/ */
tax_total: BigNumberValue tax_total: number
/** /**
* The discount total of the cart line item. * The discount total of the cart line item.
*/ */
discount_total: BigNumberValue discount_total: number
/** /**
* The discount tax total of the cart line item. * The discount tax total of the cart line item.
*/ */
discount_tax_total: BigNumberValue discount_tax_total: number
} }
/** /**
@@ -646,7 +645,7 @@ export interface BaseAdjustmentLine {
/** /**
* The amount to adjust the original amount with. * The amount to adjust the original amount with.
*/ */
amount: BigNumberValue amount: number
/** /**
* The ID of the associated cart. * The ID of the associated cart.
@@ -773,12 +772,12 @@ export interface BaseShippingMethodTaxLine extends BaseTaxLine {
/** /**
* The total tax relative to the shipping method. * The total tax relative to the shipping method.
*/ */
total: BigNumberValue total: number
/** /**
* The subtotal tax relative to the shipping method. * The subtotal tax relative to the shipping method.
*/ */
subtotal: BigNumberValue subtotal: number
} }
/** /**
@@ -798,10 +797,10 @@ export interface BaseLineItemTaxLine extends BaseTaxLine {
/** /**
* The total tax relative to the item. * The total tax relative to the item.
*/ */
total: BigNumberValue total: number
/** /**
* The subtotal tax relative to the item. * The subtotal tax relative to the item.
*/ */
subtotal: BigNumberValue subtotal: number
} }

View File

@@ -1,5 +1,4 @@
import { BaseFilterable, OperatorMap } from "../../dal" import { BaseFilterable, OperatorMap } from "../../dal"
import { BigNumberValue } from "../../totals"
import { BaseClaim } from "../claim/common" import { BaseClaim } from "../claim/common"
import { FindParams } from "../common" import { FindParams } from "../common"
import { BasePaymentCollection } from "../payment/common" import { BasePaymentCollection } from "../payment/common"
@@ -101,15 +100,15 @@ export interface BaseOrderShippingMethod {
metadata: Record<string, unknown> | null metadata: Record<string, unknown> | null
tax_lines?: BaseOrderShippingMethodTaxLine[] tax_lines?: BaseOrderShippingMethodTaxLine[]
adjustments?: BaseOrderShippingMethodAdjustment[] adjustments?: BaseOrderShippingMethodAdjustment[]
original_total: BigNumberValue original_total: number
original_subtotal: BigNumberValue original_subtotal: number
original_tax_total: BigNumberValue original_tax_total: number
total: BigNumberValue total: number
detail?: BaseOrderShippingDetail detail?: BaseOrderShippingDetail
subtotal: BigNumberValue subtotal: number
tax_total: BigNumberValue tax_total: number
discount_total: BigNumberValue discount_total: number
discount_tax_total: BigNumberValue discount_tax_total: number
created_at: Date | string created_at: Date | string
updated_at: Date | string updated_at: Date | string
} }

View File

@@ -1,5 +1,4 @@
import { BaseFilterable, OperatorMap } from "../../dal" import { BaseFilterable, OperatorMap } from "../../dal"
import { BigNumberValue } from "../../totals"
/** /**
* The payment collection's status. * The payment collection's status.
@@ -49,22 +48,22 @@ export interface BasePaymentCollection {
/** /**
* The total amount to be authorized and captured. * The total amount to be authorized and captured.
*/ */
amount: BigNumberValue amount: number
/** /**
* The amount authorized within the associated payment sessions. * The amount authorized within the associated payment sessions.
*/ */
authorized_amount?: BigNumberValue authorized_amount?: number
/** /**
* The amount captured within the associated payment sessions. * The amount captured within the associated payment sessions.
*/ */
captured_amount?: BigNumberValue captured_amount?: number
/** /**
* The amount refunded within the associated payments. * The amount refunded within the associated payments.
*/ */
refunded_amount?: BigNumberValue refunded_amount?: number
/** /**
* When the payment collection was completed. * When the payment collection was completed.
@@ -122,12 +121,12 @@ export interface BasePayment {
/** /**
* The payment's total amount. * The payment's total amount.
*/ */
amount: BigNumberValue amount: number
/** /**
* The authorized amount of the payment. * The authorized amount of the payment.
*/ */
authorized_amount?: BigNumberValue authorized_amount?: number
/** /**
* The ISO 3 character currency code of the payment. * The ISO 3 character currency code of the payment.
@@ -187,12 +186,12 @@ export interface BasePayment {
/** /**
* The sum of the associated captures' amounts. * The sum of the associated captures' amounts.
*/ */
captured_amount?: BigNumberValue captured_amount?: number
/** /**
* The sum of the associated refunds' amounts. * The sum of the associated refunds' amounts.
*/ */
refunded_amount?: BigNumberValue refunded_amount?: number
/** /**
* The associated captures. * The associated captures.
@@ -235,7 +234,7 @@ export interface BaseCapture {
/** /**
* The captured amount. * The captured amount.
*/ */
amount: BigNumberValue amount: number
/** /**
* The creation date of the capture. * The creation date of the capture.
@@ -266,7 +265,7 @@ export interface BaseRefund {
/** /**
* The refunded amount. * The refunded amount.
*/ */
amount: BigNumberValue amount: number
/** /**
* The id of the refund_reason that is associated with the refund * The id of the refund_reason that is associated with the refund
@@ -312,7 +311,7 @@ export interface BasePaymentSession {
/** /**
* The amount to authorize. * The amount to authorize.
*/ */
amount: BigNumberValue amount: number
/** /**
* The 3 character currency code of the payment session. * The 3 character currency code of the payment session.
@@ -430,7 +429,7 @@ export interface BasePaymentSessionFilters
/** /**
* Filter the payment sessions by their amount. * Filter the payment sessions by their amount.
*/ */
amount?: BigNumberValue | OperatorMap<BigNumberValue> amount?: number | OperatorMap<number>
/** /**
* Filter the payment sessions by the ID of their associated payment provider. * Filter the payment sessions by the ID of their associated payment provider.

View File

@@ -37,5 +37,7 @@ export const POST = async (
req.remoteQueryConfig.fields req.remoteQueryConfig.fields
) )
res.status(200).json({ payment_collection: paymentCollection }) res.status(200).json({
payment_collection: paymentCollection as HttpTypes.StorePaymentCollection,
})
} }