feat(finance): add settlement currency and cycle fx rates

This commit is contained in:
2026-03-10 16:46:59 +04:00
parent 4c0508f618
commit fb85219409
38 changed files with 3546 additions and 114 deletions

View File

@@ -36,6 +36,7 @@ export interface MiniAppAdminService {
updateSettings(input: {
householdId: string
actorIsAdmin: boolean
settlementCurrency?: string
rentAmountMajor?: string
rentCurrency?: string
rentDueDay: number
@@ -176,6 +177,9 @@ export function createMiniAppAdminService(
let rentAmountMinor: bigint | null | undefined
let rentCurrency: CurrencyCode | undefined
const settlementCurrency = input.settlementCurrency
? parseCurrency(input.settlementCurrency)
: undefined
if (input.rentAmountMajor && input.rentAmountMajor.trim().length > 0) {
rentCurrency = parseCurrency(input.rentCurrency ?? 'USD')
@@ -187,6 +191,11 @@ export function createMiniAppAdminService(
const settings = await repository.updateHouseholdBillingSettings({
householdId: input.householdId,
...(settlementCurrency
? {
settlementCurrency
}
: {}),
...(rentAmountMinor !== undefined
? {
rentAmountMinor