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

@@ -73,6 +73,15 @@ describe('createBotWebhookServer', () => {
}
})
},
miniAppUpdateMemberRentWeight: {
handler: async () =>
new Response(JSON.stringify({ ok: true, authorized: true, member: {} }), {
status: 200,
headers: {
'content-type': 'application/json; charset=utf-8'
}
})
},
miniAppBillingCycle: {
handler: async () =>
new Response(JSON.stringify({ ok: true, authorized: true, cycleState: {} }), {
@@ -304,6 +313,22 @@ describe('createBotWebhookServer', () => {
})
})
test('accepts mini app rent weight update request', async () => {
const response = await server.fetch(
new Request('http://localhost/api/miniapp/admin/members/rent-weight', {
method: 'POST',
body: JSON.stringify({ initData: 'payload' })
})
)
expect(response.status).toBe(200)
expect(await response.json()).toEqual({
ok: true,
authorized: true,
member: {}
})
})
test('accepts mini app billing cycle request', async () => {
const response = await server.fetch(
new Request('http://localhost/api/miniapp/admin/billing-cycle', {