Skip to content

Commit

Permalink
Merge pull request #2579 from Shopify/js-fix-shipping-line-tax-line
Browse files Browse the repository at this point in the history
Fixed minor issues with shipping line
  • Loading branch information
js-goupil authored Jan 23, 2025
2 parents a3a9109 + 435569f commit 7745cd9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 29 deletions.
10 changes: 8 additions & 2 deletions packages/ui-extensions/src/surfaces/point-of-sale/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,16 @@ export type {
LineItemDiscount,
CustomSale,
Address,
ShippingLine,
TaxLine,
} from './types/cart';

export type {
ShippingLine,
CalculatedShippingLine,
CustomShippingLine,
} from './types/shipping-line';

export type {TaxLine} from './types/tax-line';

export type {PaymentMethod} from './types/payment';

export type {MultipleResourceResult} from './types/multiple-resource-result';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface TransactionCompleteInput extends BaseInput {
lineItems: LineItem[];
orderId?: number;
paymentMethods: PaymentMethod[];
shippingLines?: ShippingLine;
shippingLine?: ShippingLine;
taxLines?: TaxLine[];
};
}
26 changes: 0 additions & 26 deletions packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,29 +108,3 @@ export interface Address {
provinceCode?: string;
countryCode?: CountryCode;
}

export type ShippingLine = CalculatedShippingLine | CustomShippingLine;

export interface CalculatedShippingLine {
uuid: string;
price: string;
title: string;
methodType: 'SHIPPING' | 'RETAIL';
type: 'Calculated';
}

export interface CustomShippingLine {
uuid: string;
price: string;
title: string;
type: 'Custom';
}

export interface TaxLine {
uuid: string;
price: string;
rate: number;
rateRange?: {min: number; max: number};
title: string;
enabled: boolean;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type ShippingLine = CalculatedShippingLine | CustomShippingLine;

export interface CalculatedShippingLine {
price: string;
title: string;
methodType: 'SHIPPING' | 'RETAIL';
type: 'Calculated';
}

export interface CustomShippingLine {
price: string;
title: string;
type: 'Custom';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface TaxLine {
uuid: string;
price: string;
rate: number;
rateRange?: {min: number; max: number};
title: string;
enabled: boolean;
}

0 comments on commit 7745cd9

Please sign in to comment.