mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 22:34:03 +00:00
feat(bot): add household admin approval flow
This commit is contained in:
@@ -8,6 +8,8 @@ import type {
|
||||
export interface HouseholdSetupService {
|
||||
setupGroupChat(input: {
|
||||
actorIsAdmin: boolean
|
||||
actorTelegramUserId?: string
|
||||
actorDisplayName?: string
|
||||
telegramChatId: string
|
||||
telegramChatType: string
|
||||
title?: string
|
||||
@@ -83,6 +85,15 @@ export function createHouseholdSetupService(
|
||||
: {})
|
||||
})
|
||||
|
||||
if (registered.status === 'created' && input.actorTelegramUserId && input.actorDisplayName) {
|
||||
await repository.ensureHouseholdMember({
|
||||
householdId: registered.household.householdId,
|
||||
telegramUserId: input.actorTelegramUserId,
|
||||
displayName: input.actorDisplayName,
|
||||
isAdmin: true
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
status: registered.status,
|
||||
household: registered.household
|
||||
|
||||
Reference in New Issue
Block a user