Fas 2 steg 3: Household Trust Score (admin + i18n status i appen)

This commit is contained in:
Sven (AAMOS AI)
2026-08-06 23:45:28 +07:00
parent bcf932d2ff
commit 4385fe5125
21 changed files with 396 additions and 23 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
import { and, eq, gt, inArray, isNull, lte, sql } from "drizzle-orm";
import { and, asc, eq, gt, inArray, isNull, lte, sql } from "drizzle-orm";
import { schema } from "@app/database";
import { classifyExpiry, computeTrust } from "@app/inventory-engine";
import { deriveMemoryUpdates } from "@app/memory-client";
@@ -57,6 +57,7 @@ export async function processTrustDecay(ctx: WorkerContext): Promise<number> {
.select()
.from(schema.inventoryItems)
.where(and(isNull(schema.inventoryItems.depletedAt), gt(schema.inventoryItems.quantity, 0)))
.orderBy(asc(schema.inventoryItems.updatedAt))
.limit(500);
let updated = 0;