feat(POS-008): completed feature

This commit is contained in:
chattie
2026-08-22 13:42:08 +02:00
parent 25e4e5b622
commit 63eaa3e58f
12 changed files with 356 additions and 10 deletions

View File

@@ -0,0 +1,48 @@
export interface PosSaleLineItem {
variantId: string;
productId: string;
sku: string;
ean: string | null;
name: string;
unitPriceCents: number;
discountCents: number;
taxCents: number;
quantity: number;
}
export type PosPaymentKind = 'cash' | 'card' | 'other';
export interface PosPaymentInput {
kind: PosPaymentKind;
amountCents: number;
/** For cash payments: actual amount given by customer. */
tenderedCents?: number;
/** For card: last 4 digits if known. */
last4?: string;
}
export interface PosSaleInput {
idempotencyKey: string;
cashSessionId: string;
terminalId: string;
userId: string;
items: PosSaleLineItem[];
payments: PosPaymentInput[];
/** Optional customer ID for loyalty. */
customerId?: string;
}
export interface PosSaleResult {
orderId: string;
idempotencyKey: string;
totalCents: number;
items: PosSaleLineItem[];
payments: PosPaymentResult[];
createdAt: Date;
}
export interface PosPaymentResult {
id: string;
kind: PosPaymentKind;
amountCents: number;
}