feat(POS-008): completed feature
This commit is contained in:
48
project/src/modules/pos/domain/pos-sale.ts
Normal file
48
project/src/modules/pos/domain/pos-sale.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user