mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 15:54:03 +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:
@@ -32,6 +32,12 @@ export interface BotWebhookServerOptions {
|
||||
handler: (request: Request) => Promise<Response>
|
||||
}
|
||||
| undefined
|
||||
miniAppRejectMember?:
|
||||
| {
|
||||
path?: string
|
||||
handler: (request: Request) => Promise<Response>
|
||||
}
|
||||
| undefined
|
||||
miniAppSettings?:
|
||||
| {
|
||||
path?: string
|
||||
@@ -128,6 +134,12 @@ export interface BotWebhookServerOptions {
|
||||
handler: (request: Request) => Promise<Response>
|
||||
}
|
||||
| undefined
|
||||
miniAppAddPurchase?:
|
||||
| {
|
||||
path?: string
|
||||
handler: (request: Request) => Promise<Response>
|
||||
}
|
||||
| undefined
|
||||
miniAppUpdatePurchase?:
|
||||
| {
|
||||
path?: string
|
||||
@@ -201,6 +213,8 @@ export function createBotWebhookServer(options: BotWebhookServerOptions): {
|
||||
options.miniAppPendingMembers?.path ?? '/api/miniapp/admin/pending-members'
|
||||
const miniAppApproveMemberPath =
|
||||
options.miniAppApproveMember?.path ?? '/api/miniapp/admin/approve-member'
|
||||
const miniAppRejectMemberPath =
|
||||
options.miniAppRejectMember?.path ?? '/api/miniapp/admin/reject-member'
|
||||
const miniAppSettingsPath = options.miniAppSettings?.path ?? '/api/miniapp/admin/settings'
|
||||
const miniAppUpdateSettingsPath =
|
||||
options.miniAppUpdateSettings?.path ?? '/api/miniapp/admin/settings/update'
|
||||
@@ -231,6 +245,8 @@ export function createBotWebhookServer(options: BotWebhookServerOptions): {
|
||||
options.miniAppUpdateUtilityBill?.path ?? '/api/miniapp/admin/utility-bills/update'
|
||||
const miniAppDeleteUtilityBillPath =
|
||||
options.miniAppDeleteUtilityBill?.path ?? '/api/miniapp/admin/utility-bills/delete'
|
||||
const miniAppAddPurchasePath =
|
||||
options.miniAppAddPurchase?.path ?? '/api/miniapp/admin/purchases/add'
|
||||
const miniAppUpdatePurchasePath =
|
||||
options.miniAppUpdatePurchase?.path ?? '/api/miniapp/admin/purchases/update'
|
||||
const miniAppDeletePurchasePath =
|
||||
@@ -274,6 +290,10 @@ export function createBotWebhookServer(options: BotWebhookServerOptions): {
|
||||
return await options.miniAppApproveMember.handler(request)
|
||||
}
|
||||
|
||||
if (options.miniAppRejectMember && url.pathname === miniAppRejectMemberPath) {
|
||||
return await options.miniAppRejectMember.handler(request)
|
||||
}
|
||||
|
||||
if (options.miniAppSettings && url.pathname === miniAppSettingsPath) {
|
||||
return await options.miniAppSettings.handler(request)
|
||||
}
|
||||
@@ -350,6 +370,10 @@ export function createBotWebhookServer(options: BotWebhookServerOptions): {
|
||||
return await options.miniAppDeleteUtilityBill.handler(request)
|
||||
}
|
||||
|
||||
if (options.miniAppAddPurchase && url.pathname === miniAppAddPurchasePath) {
|
||||
return await options.miniAppAddPurchase.handler(request)
|
||||
}
|
||||
|
||||
if (options.miniAppUpdatePurchase && url.pathname === miniAppUpdatePurchasePath) {
|
||||
return await options.miniAppUpdatePurchase.handler(request)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user