feat(miniapp): add member rent weight controls

This commit is contained in:
2026-03-10 02:48:12 +04:00
parent 6a04b9d7f5
commit 4b4f7d46e5
10 changed files with 377 additions and 1 deletions

View File

@@ -56,6 +56,12 @@ export interface BotWebhookServerOptions {
handler: (request: Request) => Promise<Response>
}
| undefined
miniAppUpdateMemberRentWeight?:
| {
path?: string
handler: (request: Request) => Promise<Response>
}
| undefined
miniAppBillingCycle?:
| {
path?: string
@@ -136,6 +142,8 @@ export function createBotWebhookServer(options: BotWebhookServerOptions): {
options.miniAppUpsertUtilityCategory?.path ?? '/api/miniapp/admin/utility-categories/upsert'
const miniAppPromoteMemberPath =
options.miniAppPromoteMember?.path ?? '/api/miniapp/admin/members/promote'
const miniAppUpdateMemberRentWeightPath =
options.miniAppUpdateMemberRentWeight?.path ?? '/api/miniapp/admin/members/rent-weight'
const miniAppBillingCyclePath =
options.miniAppBillingCycle?.path ?? '/api/miniapp/admin/billing-cycle'
const miniAppOpenCyclePath =
@@ -198,6 +206,13 @@ export function createBotWebhookServer(options: BotWebhookServerOptions): {
return await options.miniAppPromoteMember.handler(request)
}
if (
options.miniAppUpdateMemberRentWeight &&
url.pathname === miniAppUpdateMemberRentWeightPath
) {
return await options.miniAppUpdateMemberRentWeight.handler(request)
}
if (options.miniAppBillingCycle && url.pathname === miniAppBillingCyclePath) {
return await options.miniAppBillingCycle.handler(request)
}