ci: trigga på master + formatfix inför Gitea Actions
CI / Typecheck, test & build (push) Failing after 2s
CI / Typecheck, test & build (push) Failing after 2s
This commit is contained in:
@@ -18,7 +18,12 @@ export interface ExistingProfile {
|
||||
averageEatenPortions: number | null;
|
||||
averageLeftoverPortions: number | null;
|
||||
observationCount: number;
|
||||
lastSessionAnswers?: Array<{ sessionId: string; eaten: number; leftovers: number; date: string }> | null;
|
||||
lastSessionAnswers?: Array<{
|
||||
sessionId: string;
|
||||
eaten: number;
|
||||
leftovers: number;
|
||||
date: string;
|
||||
}> | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,7 +48,9 @@ const MS_PER_DAY = 86_400_000;
|
||||
* Deterministisk, UTC, alltid samma svar för samma input.
|
||||
*/
|
||||
export function buildReconciliationCandidates(
|
||||
items: Array<InventoryItemLike & { id: string; displayName: string; unit: string; locationName: string }>,
|
||||
items: Array<
|
||||
InventoryItemLike & { id: string; displayName: string; unit: string; locationName: string }
|
||||
>,
|
||||
context: ReconciliationContext,
|
||||
now: Date = new Date(),
|
||||
maxItems = 15,
|
||||
|
||||
@@ -19,12 +19,7 @@ export interface NewScanObservation {
|
||||
observationConfidence: number;
|
||||
}
|
||||
|
||||
export type ScanDiffRowKind =
|
||||
| "new_item"
|
||||
| "moved"
|
||||
| "quantity_changed"
|
||||
| "vanished"
|
||||
| "unchanged";
|
||||
export type ScanDiffRowKind = "new_item" | "moved" | "quantity_changed" | "vanished" | "unchanged";
|
||||
|
||||
export interface ScanDiffRow {
|
||||
kind: ScanDiffRowKind;
|
||||
|
||||
@@ -175,7 +175,8 @@ export function householdTrustScore(
|
||||
|
||||
// 3. Andel uppskattade mängder (0–100, 100 = alla har confidence 1)
|
||||
const confidenceScore =
|
||||
items.reduce((sum, i) => sum + Math.min(1, Math.max(0, i.confidence)), 0) / items.length * 100;
|
||||
(items.reduce((sum, i) => sum + Math.min(1, Math.max(0, i.confidence)), 0) / items.length) *
|
||||
100;
|
||||
|
||||
// 4. Poster som borde vara slut (0–100, 100 = inga låga kvantiteter)
|
||||
const depletionScore =
|
||||
@@ -189,15 +190,13 @@ export function householdTrustScore(
|
||||
|
||||
// 5. Korrigeringsfrekvens (0–100, 100 = inga korrigeringar)
|
||||
const correctionRatio =
|
||||
input.transactionCount30d > 0
|
||||
? input.correctionCount30d / input.transactionCount30d
|
||||
: 0;
|
||||
input.transactionCount30d > 0 ? input.correctionCount30d / input.transactionCount30d : 0;
|
||||
const correctionScore = Math.max(0, 100 - correctionRatio * 200);
|
||||
|
||||
const score = Math.round(
|
||||
verifiedScore * 0.25 +
|
||||
ageScore * 0.25 +
|
||||
confidenceScore * 0.20 +
|
||||
confidenceScore * 0.2 +
|
||||
depletionScore * 0.15 +
|
||||
correctionScore * 0.15,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user