Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/discount-allocations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/ui-extensions': minor
---

Added optional `discountAllocations` field to Cart Line Item API so that POS extensions can see the precise proportion of a discount applied to a particular line item. Only the `allocatedAmount` field is included for this purpose, matching the Storefront API structure. See https://shopify.dev/docs/api/storefront/latest/objects/DiscountAllocation.
5 changes: 5 additions & 0 deletions .changeset/hip-seas-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/ui-extensions': minor
---

Adds pos.receipt-header.block.render extension target
5 changes: 5 additions & 0 deletions .changeset/tough-panthers-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/ui-extensions': minor
---

Modified transaction data interface fields to include returnId and refundId to Return and Exchange TransactionData.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {LineItem} from '../../types/cart';

export interface ExchangeTransactionData extends BaseTransactionComplete {
transactionType: 'Exchange';
returnId?: number;
exchangeId?: number;
lineItemsAdded: LineItem[];
lineItemsRemoved: LineItem[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {LineItem} from '../../types/cart';

export interface ReturnTransactionData extends BaseTransactionComplete {
transactionType: 'Return';
refundId?: number;
returnId?: number;
exchangeId?: number;
lineItems: LineItem[];
Expand Down
4 changes: 4 additions & 0 deletions packages/ui-extensions/src/surfaces/point-of-sale/targets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ export interface ExtensionTargets {
{[key: string]: any} & StorageApi & TransactionCompleteWithReprintData,
ReceiptComponents
>;
'pos.receipt-header.block.render': RenderExtension<
{[key: string]: any} & StorageApi & TransactionCompleteWithReprintData,
ReceiptComponents
>;
}

export type ExtensionTarget = keyof ExtensionTargets;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {CountryCode} from './country-code';
import {TaxLine} from './tax-line';
import {DiscountAllocation} from './discount-allocation';

export interface Cart {
/**
Expand Down Expand Up @@ -40,6 +41,7 @@ export interface LineItem {
variantId?: number;
productId?: number;
discounts: Discount[];
discountAllocations?: DiscountAllocation[];
taxable: boolean;
taxLines: TaxLine[];
sku?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type {MoneyV2} from './money';

export interface DiscountAllocation {
allocatedAmount: MoneyV2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ export interface Money {
amount: number;
currency: string;
}

export interface MoneyV2 {
amount: string;
currencyCode: string;
}