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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user