- Added a new command `/import_duty_schedule` for importing duty schedules via JSON, restricted to admin users. - Introduced a two-step import process: specifying handover time and uploading a JSON file. - Updated the database schema to allow `telegram_user_id` to be nullable for user creation by full name. - Implemented repository functions for user management, including `get_or_create_user_by_full_name` and `delete_duties_in_range`. - Enhanced README documentation with details on the new import command and JSON format requirements. - Added comprehensive tests for the duty schedule parser and integration tests for the import functionality.
15 lines
560 B
Python
15 lines
560 B
Python
"""Expose a single register_handlers(app) that registers all handlers."""
|
|
|
|
from telegram.ext import Application
|
|
|
|
from . import commands, errors, import_duty_schedule
|
|
|
|
|
|
def register_handlers(app: Application) -> None:
|
|
app.add_handler(commands.start_handler)
|
|
app.add_handler(commands.help_handler)
|
|
app.add_handler(import_duty_schedule.import_duty_schedule_handler)
|
|
app.add_handler(import_duty_schedule.handover_time_handler)
|
|
app.add_handler(import_duty_schedule.duty_schedule_document_handler)
|
|
app.add_error_handler(errors.error_handler)
|