rework app shell, strip coach hooks, wire barcode flow
rename state vars throughout, add barcode scanner trigger and draft flow, drop coach navigation and session, add ForecastPoint type
This commit is contained in:
+840
-779
File diff suppressed because it is too large
Load Diff
+64
-16
@@ -34,6 +34,57 @@ export type EntryDraft = Omit<
|
||||
source?: RedBullEntry["source"];
|
||||
};
|
||||
|
||||
export type BarcodeFormatName = "ean-13" | "ean-8" | "upc-a" | "upc-e" | "unknown";
|
||||
|
||||
export type BarcodeProductDraft = {
|
||||
flavourName: string;
|
||||
sizeMl: number;
|
||||
pricePerCan: number;
|
||||
sugarFree?: boolean;
|
||||
caffeineMgPerCan?: number;
|
||||
};
|
||||
|
||||
export type ResolvedBarcodeProduct = BarcodeProductDraft & {
|
||||
flavourAccent: string;
|
||||
source: "built-in" | "user";
|
||||
};
|
||||
|
||||
export type BarcodeSeedProduct = BarcodeProductDraft & {
|
||||
verifiedBy: string;
|
||||
sourceName?: string;
|
||||
sourceUrl?: string;
|
||||
notes?: string;
|
||||
variant?: string;
|
||||
};
|
||||
|
||||
export type UserBarcodeMapping = BarcodeProductDraft & {
|
||||
barcode: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type BarcodeLookupCatalog = {
|
||||
verifiedProducts?: Record<string, BarcodeSeedProduct>;
|
||||
userMappings?: UserBarcodeMapping[];
|
||||
};
|
||||
|
||||
export type BarcodeLookupResult =
|
||||
| {
|
||||
status: "known" | "user";
|
||||
barcode: string;
|
||||
product: ResolvedBarcodeProduct;
|
||||
}
|
||||
| {
|
||||
status: "partial";
|
||||
barcode: string;
|
||||
product: BarcodeProductDraft;
|
||||
reason: string;
|
||||
}
|
||||
| {
|
||||
status: "unknown";
|
||||
barcode: string;
|
||||
};
|
||||
|
||||
export type Filters = {
|
||||
flavour: string;
|
||||
dateRange: DateFilter;
|
||||
@@ -55,22 +106,19 @@ export type ImportPreview = {
|
||||
rows: ImportPreviewRow[];
|
||||
};
|
||||
|
||||
export type ChatRole = "user" | "assistant";
|
||||
|
||||
export type CoachMessage = {
|
||||
id: string;
|
||||
role: ChatRole;
|
||||
content: string;
|
||||
thinking?: string;
|
||||
pending?: boolean;
|
||||
stopped?: boolean;
|
||||
export type UserLimits = {
|
||||
dailyCanLimit?: number;
|
||||
dailySpendLimit?: number;
|
||||
stopTime?: string;
|
||||
};
|
||||
|
||||
export type CoachChat = {
|
||||
id: string;
|
||||
userId: string;
|
||||
title: string;
|
||||
messages: CoachMessage[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
export type LimitViolation = "cans" | "spend" | "stopTime";
|
||||
|
||||
export type LimitCheckResult = {
|
||||
violations: LimitViolation[];
|
||||
projectedCans: number;
|
||||
projectedSpend: number;
|
||||
todayCans: number;
|
||||
todaySpend: number;
|
||||
pastStopTime: boolean;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user