feat(member): add household lifecycle states

This commit is contained in:
2026-03-11 13:44:38 +04:00
parent 015298281c
commit 773abf2531
32 changed files with 3671 additions and 38 deletions

View File

@@ -82,6 +82,15 @@ describe('createBotWebhookServer', () => {
}
})
},
miniAppUpdateMemberStatus: {
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: {} }), {
@@ -347,6 +356,22 @@ describe('createBotWebhookServer', () => {
})
})
test('accepts mini app member status update request', async () => {
const response = await server.fetch(
new Request('http://localhost/api/miniapp/admin/members/status', {
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', {