feat(reports): cari, birikim, alışveriş, birim fiyat ve fire rapor servisleri

- mağaza adı eşleşmesi ve aylık birim fiyat özeti (saf, birim testli)
- tamamlanan listelerin plan/gerçekleşen özeti, mağaza bazlı harcama
- ürün tipi fiyat geçmişi yükleyicisi; fire oranı ve tahmini maliyet; testler

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-07 00:53:02 +03:00
parent d9a22551e1
commit 8623c5a02e
7 changed files with 920 additions and 4 deletions
+3 -3
View File
@@ -28,9 +28,9 @@ import { categoryBreakdown, savingsRate, sharePct, type CategoryBreakdown } from
const DAY_MS = 86_400_000;
const ORPHAN = "__none__";
type Base = { ctx: Ctx; s: Settings; today: string; currentMonth: string };
export type Base = { ctx: Ctx; s: Settings; today: string; currentMonth: string };
async function base(userId: string, householdId: string): Promise<Base | null> {
export async function base(userId: string, householdId: string): Promise<Base | null> {
const ctx = await loadContext(userId, householdId, "viewer");
if (!ctx) return null;
const s = await settingsOf(ctx.m.householdId);
@@ -61,7 +61,7 @@ export type MonthInfo = {
currentMonth: string;
};
const monthInfo = (b: Base, month: string): MonthInfo => ({
export const monthInfo = (b: Base, month: string): MonthInfo => ({
month,
...budgetPeriod(month, b.s.startDay),
current: month === b.currentMonth,