mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 13:54:02 +00:00
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:
@@ -110,6 +110,19 @@ export interface MiniAppAdminService {
|
||||
reason: 'not_admin' | 'pending_not_found'
|
||||
}
|
||||
>
|
||||
rejectPendingMember(input: {
|
||||
householdId: string
|
||||
actorIsAdmin: boolean
|
||||
pendingTelegramUserId: string
|
||||
}): Promise<
|
||||
| {
|
||||
status: 'rejected_member'
|
||||
}
|
||||
| {
|
||||
status: 'rejected'
|
||||
reason: 'not_admin' | 'pending_not_found'
|
||||
}
|
||||
>
|
||||
promoteMemberToAdmin(input: {
|
||||
householdId: string
|
||||
actorIsAdmin: boolean
|
||||
@@ -536,6 +549,31 @@ export function createMiniAppAdminService(
|
||||
}
|
||||
},
|
||||
|
||||
async rejectPendingMember(input) {
|
||||
if (!input.actorIsAdmin) {
|
||||
return {
|
||||
status: 'rejected',
|
||||
reason: 'not_admin'
|
||||
}
|
||||
}
|
||||
|
||||
const success = await repository.rejectPendingHouseholdMember({
|
||||
householdId: input.householdId,
|
||||
telegramUserId: input.pendingTelegramUserId
|
||||
})
|
||||
|
||||
if (!success) {
|
||||
return {
|
||||
status: 'rejected',
|
||||
reason: 'pending_not_found'
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
status: 'rejected_member'
|
||||
}
|
||||
},
|
||||
|
||||
async promoteMemberToAdmin(input) {
|
||||
if (!input.actorIsAdmin) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user