Add container weight tracking for weigh-based concentrate audits
Build and push image / build (push) Successful in 1m6s

Record the total weight of a jar (product + container) at acquisition so
audits can be done by simply re-weighing the sealed jar. The tare is
derived (containerWeight − productWeight), and the audit flow offers a
"Weigh container" toggle that auto-calculates remaining product from the
scale reading.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 23:11:39 -04:00
parent e9e66ab1cb
commit a1be29ab6e
11 changed files with 205 additions and 26 deletions
+18
View File
@@ -67,6 +67,12 @@ export function ProductDetail({
: []),
["Purchase date", fmt.date(item.purchaseDate, getStoredTimezone())],
["Bin", isCheckedOut ? "In your custody" : bin ? bin.name : <span style={{ color: "var(--ink-3)" }}></span>],
...(item.containerWeight != null
? [
["Container weight", `${item.containerWeight.toFixed(2)}g`] as [string, React.ReactNode],
["Tare (empty jar)", `${(item.containerWeight - item.weight).toFixed(2)}g`] as [string, React.ReactNode],
]
: []),
["Audit cadence", `Every ${cfg?.cadenceDays ?? "—"} days · ${cfg?.auditMode ?? "—"}`],
[
"Cost per gram",
@@ -294,6 +300,18 @@ export function ProductDetail({
{cfg?.unit}). Re-audit to update.
</div>
)}
{item.containerWeight != null && (
<div
style={{
fontSize: 11,
color: "var(--ink-3)",
marginTop: 6,
fontStyle: "italic",
}}
>
Expected container total: {((item.containerWeight - item.weight) + est).toFixed(2)}g
</div>
)}
</div>
)}