Fas 3 steg 3a: cooking_sessions-tabell + lifecycle-endpoints + timeout-jobb, gamla /cook kvar som kortkommando

This commit is contained in:
Sven (AAMOS AI)
2026-08-07 03:14:13 +07:00
parent 4a4f448e1c
commit e9fb4a17d4
17 changed files with 10619 additions and 196 deletions
@@ -25,6 +25,7 @@ import { households, storageLocations } from "./households.js";
import { canonicalIngredients } from "./ingredients.js";
import { products } from "./products.js";
import { users } from "./users.js";
import { cookingSessions } from "./recipes.js";
/**
* Food Twin (spec §8): lagerposter med fullständig spårbarhet.
@@ -96,6 +97,9 @@ export const inventoryTransactions = pgTable(
unit: unitEnum("unit").notNull(),
refType: text("ref_type"),
refId: uuid("ref_id"),
cookingSessionId: uuid("cooking_session_id").references(() => cookingSessions.id, {
onDelete: "set null",
}),
actorUserId: uuid("actor_user_id").references(() => users.id, { onDelete: "set null" }),
note: text("note"),
/** Värde i SEK för matsvinnsberäkning vid discard (spec §12, §26). */