MMI2 Schedule System
Mission Brief
Web system for importing monthly work schedules from Excel and providing a personal calendar for each employee.
Unofficial project for Mini Maritsa Iztok 2 (MMI / Maritsa East 2).
Core Logic
From the Excel file, the system extracts for each employee:
- Work number
- Full name
- Permanent team (A, B, C or D)
- Daily schedule for every day of the month
Employees enter their work number and see only their own monthly schedule.
## Confirmed Legend
| Excel | Meaning | API type |
| 1 | Day shift | day |
| 2 | Night shift | night |
| О or 0| Leave / Vacation | leave |
| Б | Sick leave | sick_leave |
| Empty cell| Scheduled rest day | rest |
All other values are stored as unknown, while the original code is kept in raw_code.
Key Features
- FastAPI backend
- SQLAlchemy database
- Alembic versioned database migrations
- First-run web installer at /install
- SQLite or PostgreSQL configuration via the installer
- DB-backed admin accounts with roles: owner, admin, moderator
- Exactly one owner account; only the owner can manage other admin accounts
- scrypt password hashing
- .xlsx Import via OpenPyXL
- Recognition of the real MMI2 Excel format (multiple blocks on one sheet)
- Extraction of work number, name, and team (A/B/C/D)
- Monthly records for all calendar days
- Re-import updates existing records
- Atomic import of the schedule + ImportHistory in a single DB transaction
- Detection of duplicate employees and conflicting days
- Login via work number
- JWT access token
- Responsive personal calendar
- Automatic approximate 2-on-2 fallback when official schedule is missing
- Month navigation
- Monthly statistics (day shifts, night shifts, leave, sick leave, rest days)
- Separate /admin interface with admin authentication
- Excel file preview before saving to the database
- Automatic detection of year/month when the Excel file contains a reliable signal
- Manual fallback for year/month when automatic detection is not confident
- History of successful imports
- SHA-256 fingerprint of every imported file (the Excel file itself is not stored)
- REST API ready for a future native Android app
- Dockerfile and Docker Compose
- Unit tests with synthetic data
- GitHub Actions CI that runs migrations and tests automatically
Key Features
- Only the dev can create and manage admin/moderator accounts
- The dev account cannot be demoted or deactivated through the supported UI/API flow
Admin:
- Preview/import of Excel schedules
- Manual corrections
- Editing of employee metadata
- Import history and audit history
- No management of administrative accounts
Moderator:
- Preview/import of Excel schedules
- Searching employees and loading months
- Editing daily schedule entries
- Cannot edit employee name or permanent team
- No account management, import history, or audit history