feat(miniapp): refine UI and add utility bill management

- Fix collapsible padding and button spacing
- Add subtotal to balance card
- Add utility bill management for admins
- Fix lints and type checks across the monorepo
- Implement rejectPendingHouseholdMember in repository and service
This commit is contained in:
2026-03-13 05:52:34 +04:00
parent 25c4928ca9
commit 94a5904f54
58 changed files with 5400 additions and 7006 deletions

View File

@@ -345,6 +345,32 @@ export async function approveMiniAppPendingMember(
}
}
export async function rejectMiniAppPendingMember(
initData: string,
pendingTelegramUserId: string
): Promise<void> {
const response = await fetch(`${apiBaseUrl()}/api/miniapp/admin/reject-member`, {
method: 'POST',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
initData,
pendingTelegramUserId
})
})
const payload = (await response.json()) as {
ok: boolean
authorized?: boolean
error?: string
}
if (!response.ok || !payload.authorized) {
throw new Error(payload.error ?? 'Failed to reject member')
}
}
export async function updateMiniAppLocalePreference(
initData: string,
locale: 'en' | 'ru',
@@ -920,6 +946,39 @@ export async function deleteMiniAppUtilityBill(
return payload.cycleState
}
export async function addMiniAppPurchase(
initData: string,
input: {
description: string
amountMajor: string
currency: 'USD' | 'GEL'
split?: {
mode: 'equal' | 'custom_amounts'
participants: readonly {
memberId: string
included?: boolean
shareAmountMajor?: string
}[]
}
}
): Promise<void> {
const response = await fetch(`${apiBaseUrl()}/api/miniapp/admin/purchases/add`, {
method: 'POST',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
initData,
...input
})
})
const payload = (await response.json()) as { ok: boolean; authorized?: boolean; error?: string }
if (!response.ok || !payload.authorized) {
throw new Error(payload.error ?? 'Failed to add purchase')
}
}
export async function updateMiniAppPurchase(
initData: string,
input: {