Split audits into Weigh Ins (bulk) and Bin Checks (discrete)
Build and push image / build (push) Successful in 57s
Build and push image / build (push) Successful in 57s
Replaces the unified audit system with two purpose-built flows: - Weigh Ins: rebranded audit flow for bulk products (Flower, Concentrate, Tincture) with scale weigh, container weigh, and estimate modes - Bin Checks: new bin-level presence check — select a bin, scan every item, resolve discrepancies (wrong bin, unknown, missing), auto-records presence audits on verified items Adds cadence_days and last_checked to bins table, with per-bin overdue tracking on the dashboard and bins view. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+9
-1
@@ -91,6 +91,8 @@ export interface Bin {
|
||||
id: string;
|
||||
name: string;
|
||||
capacity: number;
|
||||
cadenceDays: number;
|
||||
lastChecked: string | null;
|
||||
}
|
||||
|
||||
export interface TypeConfig {
|
||||
@@ -203,9 +205,15 @@ export const helpers = {
|
||||
auditOverdue(p: Item, today = TODAY_STR): boolean {
|
||||
if (p.status !== "active" && p.status !== "checked-out") return false;
|
||||
const cfg = TYPES.find((t) => t.id === p.type);
|
||||
if (!cfg) return false;
|
||||
if (!cfg || cfg.kind === "discrete") return false;
|
||||
return this.daysSinceCheck(p, today) >= cfg.cadenceDays;
|
||||
},
|
||||
binCheckOverdue(bin: Bin, today = TODAY_STR): boolean {
|
||||
return this.daysSinceBinCheck(bin, today) >= bin.cadenceDays;
|
||||
},
|
||||
daysSinceBinCheck(bin: Bin, today = TODAY_STR): number {
|
||||
return this.daysSince(bin.lastChecked, today);
|
||||
},
|
||||
remaining(p: Item): number {
|
||||
if (p.status !== "active" && p.status !== "checked-out") return 0;
|
||||
if (p.kind === "discrete") {
|
||||
|
||||
Reference in New Issue
Block a user