fix(bot): restrict setup admin bootstrap

This commit is contained in:
2026-03-09 06:35:23 +04:00
parent d5872ede57
commit b23208af26
11 changed files with 117 additions and 7 deletions

View File

@@ -595,6 +595,22 @@ export function createDbHouseholdConfigurationRepository(databaseUrl: string): {
return row ? toHouseholdMemberRecord(row) : null
},
async listHouseholdMembers(householdId) {
const rows = await db
.select({
id: schema.members.id,
householdId: schema.members.householdId,
telegramUserId: schema.members.telegramUserId,
displayName: schema.members.displayName,
isAdmin: schema.members.isAdmin
})
.from(schema.members)
.where(eq(schema.members.householdId, householdId))
.orderBy(schema.members.displayName, schema.members.telegramUserId)
return rows.map(toHouseholdMemberRecord)
},
async listHouseholdMembersByTelegramUserId(telegramUserId) {
const rows = await db
.select({