feat: add admin promotion broadcast system and psql health check
- Add `/push` command for admins to broadcast messages to all users with approve/decline confirmation flow (handlers/ads.py) - Add common handler for undefined commands and delete callback - Add `UserRepository.get_users()` to fetch all users - Add `UserService.send_promotion_to_users()` with error logging - Add promotion confirmation keyboard and FSM state - Add PostgreSQL availability check in startup.sh before migrations - Add new text constants for promotion flow
This commit is contained in:
@@ -6,6 +6,12 @@ from schemas.users import NewUserDTO
|
||||
|
||||
|
||||
class UserRepository:
|
||||
async def get_users(self, session: AsyncSession) -> list[User]:
|
||||
stmt = select(User)
|
||||
res = await session.execute(stmt)
|
||||
|
||||
return list(res.scalars().all())
|
||||
|
||||
async def get_user_by_id(self, session: AsyncSession, user_id: int) -> User | None:
|
||||
stmt = select(User).where(User.id == user_id)
|
||||
result = await session.execute(stmt)
|
||||
|
||||
Reference in New Issue
Block a user