scaffold festival drink tracker (pnpm workspace, Fastify + SQLite, Preact tablet UI, admin)
This commit is contained in:
parent
cf33e6ea04
commit
e0898bea22
34 changed files with 5446 additions and 0 deletions
55
shared/src/index.ts
Normal file
55
shared/src/index.ts
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
export interface Bar {
|
||||
id: number;
|
||||
name: string;
|
||||
pfand_cents: number;
|
||||
}
|
||||
|
||||
export interface Drink {
|
||||
id: number;
|
||||
name: string;
|
||||
price_cents: number;
|
||||
archived: boolean;
|
||||
}
|
||||
|
||||
export interface BarConfig {
|
||||
bar: Bar;
|
||||
drinks: Drink[];
|
||||
}
|
||||
|
||||
export interface CartItem {
|
||||
drink_id: number;
|
||||
qty: number;
|
||||
}
|
||||
|
||||
export interface CreateTransactionRequest {
|
||||
client_uuid: string;
|
||||
bar_id: number;
|
||||
crew: boolean;
|
||||
items: CartItem[];
|
||||
pfand_returns: number;
|
||||
}
|
||||
|
||||
export interface CreateTransactionResponse {
|
||||
id: number;
|
||||
total_cents: number;
|
||||
}
|
||||
|
||||
export interface TransactionItemRecord {
|
||||
drink_id: number;
|
||||
drink_name: string;
|
||||
qty: number;
|
||||
unit_price_cents: number;
|
||||
pfand_cents_per_unit: number;
|
||||
}
|
||||
|
||||
export interface TransactionRecord {
|
||||
id: number;
|
||||
bar_id: number;
|
||||
bar_name: string;
|
||||
created_at: string;
|
||||
total_cents: number;
|
||||
crew: boolean;
|
||||
pfand_returns: number;
|
||||
client_ip: string | null;
|
||||
items: TransactionItemRecord[];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue