feat(defter): özet ve bütçeye gerçekleşen harcama eklendi (backend)

- Dönem özeti: spent_total ve remaining (harcanabilir − harcanan)
- Bütçe görünümü: grup ve hafta bazında spent
- Değerler saklanmaz, kayıtlardan anlık toplanır; silinenler sayılmaz

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 11:12:51 +03:00
parent 2003b8fad7
commit 7143613ab2
11 changed files with 241 additions and 10 deletions
+2
View File
@@ -57,10 +57,12 @@ const week = (start: string, amount: number, is_manual = false) => ({
days: 7,
amount,
is_manual,
spent: 0,
})
const budget: GroupBudget[] = (['needs', 'wants', 'culture', 'unexpected'] as const).map((g) => ({
group: g,
monthly: g === 'needs' ? 1_000_000 : 0,
spent: 0,
weekly_over: false,
weeks:
g === 'needs'
+4
View File
@@ -3,6 +3,10 @@ import type { Group } from "./Group";
import type { WeekBudget } from "./WeekBudget";
export type GroupBudget = { group: Group, monthly: number,
/**
* Dönem boyunca gerçekleşen harcama
*/
spent: number,
/**
* Elle girilen haftaların toplamı aylık tutarı aşıyor
*/
+9 -1
View File
@@ -20,4 +20,12 @@ budget_total: number,
/**
* harcanabilir − dağıtılan (negatifse fazla dağıtılmış)
*/
unallocated: number, };
unallocated: number,
/**
* Dönemde gerçekleşen harcama
*/
spent_total: number,
/**
* Kalan harcanabilir: harcanabilir − gerçekleşen (negatifse aşılmış)
*/
remaining: number, };
+5 -1
View File
@@ -4,4 +4,8 @@ export type WeekBudget = { index: number, start_date: string, last_date: string,
/**
* Elle girildi (otomatik değil)
*/
is_manual: boolean, };
is_manual: boolean,
/**
* Bu haftada gerçekleşen harcama
*/
spent: number, };