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
17
shared/package.json
Normal file
17
shared/package.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "@wutzcalc/shared",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.4.0"
|
||||
}
|
||||
}
|
||||
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[];
|
||||
}
|
||||
7
shared/tsconfig.json
Normal file
7
shared/tsconfig.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue