feat(borç): aylık planda bu ayın borcu, borç ödemesi etiketi, taksit önerisi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -159,6 +159,24 @@ export function useSetTargets() {
|
||||
})
|
||||
}
|
||||
|
||||
export function useSetOpeningDebt(periodId: string) {
|
||||
const invalidate = useInvalidateDebt()
|
||||
return useMutation({
|
||||
mutationFn: (amount: number | null) =>
|
||||
api.put<void>(`/periods/${periodId}/opening-debt`, { amount }),
|
||||
onSuccess: invalidate,
|
||||
})
|
||||
}
|
||||
|
||||
/** Plan kalemlerinde "Taksit(ler)" adlı sabit gider (büyük/küçük harf ve Türkçe harf duyarsız) */
|
||||
export function findInstallmentItem<T extends { kind: string; name: string }>(
|
||||
items: readonly T[],
|
||||
): T | undefined {
|
||||
return items.find(
|
||||
(i) => i.kind === 'expense' && /^taks[iı]t(ler|lar)?$/.test(i.name.trim().toLocaleLowerCase('tr')),
|
||||
)
|
||||
}
|
||||
|
||||
export function useDebtImport() {
|
||||
const invalidate = useInvalidateDebt()
|
||||
return useMutation({
|
||||
|
||||
Reference in New Issue
Block a user