fix(pos): type checkout test stub as PosPb to satisfy tsc

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Dave 2026-08-31 01:41:26 +02:00
parent 0282d43109
commit 4d58bde6ff

View file

@ -4,6 +4,7 @@ import {
listActiveStockCatalog,
listSalesInRange,
searchCustomersForPos,
type PosPb,
} from "./pos-service";
function stubPb(items: unknown[]) {
@ -88,6 +89,8 @@ function stubCheckoutPb(opts: {
let itemCounter = 0;
return {
// Cast because the stub's collection() returns concrete row shapes,
// while PosPb declares getList/getOne/create generically.
pb: {
collection: (name: string) => ({
getFullList: vi.fn(),
@ -147,7 +150,7 @@ function stubCheckoutPb(opts: {
return { id, ...data };
}),
}),
},
} as unknown as PosPb,
created,
updates,
};