How ftmehoseini/rastattbot works
Rasta Admin Bot is a Persian-language organizational administration bot. Employees and administrators interact through the bot: attendance actions and reports, leave requests and two-step decisions, and meal ordering and menu administration are handled by application services, with results delivered as messages or Excel files. Scheduled reminders and food broadcasts form a separate worker-driven path. The graph preserves the documented product areas and central policy, access-control, and audit responsibilities. Some handler and service wiring is unsampled, so uncertain links are omitted or marked unverified.
Main entry points: attendance_service.py Attendance service · food_service.py Food service · handlers Bot handlers · leave_service.py Leave service
Components 28
Bot interface
- Bot runtime
app/presentation/bot/main.py - Bot handlers
app/presentation/bot/handlers
Application workflows
- Attendance service
app/application/services/attendance_service.py - Leave service
app/application/services/leave_service.py - Food service
app/application/services/food_service.py - User service
app/application/services/user_service.py - Approval service
app/application/services/approval_service.py - Reminder use cases
app/application/use_cases/reminders.py - Food broadcast
app/application/use_cases/food_broadcast.py
Business rules
- Attendance calculations
app/domain/attendance/calculation.py - Approval engine
app/domain/approvals/engine.py - User and roles
app/domain/users/models.py - Food records
app/domain/food/models.py - Audit records
app/domain/audit/models.py
Persistence and delivery
- Attendance repository
app/infrastructure/repositories/attendance.py - Food repository
app/infrastructure/repositories/food.py - User repository
app/infrastructure/repositories/users.py - Audit repository
app/infrastructure/repositories/audit.py - Background jobs
app/infrastructure/tasks/jobs.py - Messenger transport
app/infrastructure/integrations/messenger.py - Excel reports
app/infrastructure/excel/reports.py - Menu import
app/infrastructure/excel/menu_parser.py
Shared services
- Organization policy
app/core/config/policy.py - Access control
app/core/security/rbac.py - Local time service
app/core/utils/clock.py - Jalali dates
app/core/utils/jalali.py
Other components
- Employee
- Administrator
Connections 35
- Employee → Bot runtime: starts interaction
README.md - Administrator → Bot runtime: uses admin flows
README.md - Bot runtime → Bot handlers: dispatches updates
app/presentation/bot/main.py - Bot runtime → Messenger transport: creates transport
app/presentation/bot/main.py - Bot handlers → Attendance service: invokes
- Bot handlers → Leave service: invokes
- Bot handlers → Food service: invokes
- Bot handlers → User service: invokes
app/presentation/bot/handlers/admin.py - Bot handlers → Excel reports: exports reports
app/presentation/bot/handlers/admin.py - Attendance service → Attendance repository: reads and writes
app/application/services/attendance_service.py - Attendance service → Attendance calculations: calculates
app/application/services/attendance_service.py - Attendance service → Organization policy: uses rules
app/application/services/attendance_service.py - Attendance service → Local time service: gets local time
app/application/services/attendance_service.py - Leave service → Approval service: delegates decisions
app/application/services/leave_service.py - Leave service → Attendance service: checks attendance
app/application/services/leave_service.py - Leave service → Approval engine: uses workflow rules
app/application/services/leave_service.py - Leave service → Organization policy: uses rules
app/application/services/leave_service.py - Approval service → Approval engine: evaluates decisions
app/application/services/approval_service.py - Food service → Food repository: reads and writes
app/application/services/food_service.py - Food service → Menu import: parses menu files
app/application/services/food_service.py - Food service → User repository: looks up users
app/application/services/food_service.py - User service → User repository: reads and writes
app/application/services/user_service.py - User service → Access control: checks permissions
app/application/services/user_service.py - Attendance service → Access control: checks permissions
app/application/services/attendance_service.py - Food service → Access control: checks permissions
app/application/services/food_service.py - User service → Audit repository: records changes
app/application/services/user_service.py - Food service → Audit repository: records actions
app/application/services/food_service.py - Background jobs → Reminder use cases: runs use case
app/infrastructure/tasks/jobs.py - Background jobs → Food broadcast: runs use case
app/infrastructure/tasks/jobs.py - Background jobs → Messenger transport: sends notifications
app/infrastructure/tasks/jobs.py - Reminder use cases → Employee: sends reminders
- Food broadcast → Employee: announces menu
- Messenger transport → Employee: delivers messages
README.md - Attendance service → Jalali dates: formats dates
app/application/services/attendance_service.py - Food service → Jalali dates: formats dates
app/application/services/food_service.py