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:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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, };
|
||||
|
||||
@@ -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, };
|
||||
|
||||
Reference in New Issue
Block a user