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
+1 -1
View File
@@ -210,7 +210,7 @@ async function registerRepeatableJobs() {
);
await queue.upsertJobScheduler(
"scheduler-trust",
{ every: 300_000 },
{ every: 6 * 60 * 60 * 1000 }, // var 6:e timme; decay lever på dygnsskala
{ name: "UPDATE_TRUST_STATES", data: { jobType: "UPDATE_TRUST_STATES" }, opts: baseOpts },
);
await queue.upsertJobScheduler(
+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;