Refactor to manager-centric model, add team calendar for all users

Key changes:
- Removed office-centric model (deleted offices.py, office-rules)
- Renamed to team-rules, managers are part of their own team
- Team calendar visible to all (read-only for employees)
- Admins can have a manager assigned
This commit is contained in:
Stefano Manfredi
2025-12-02 13:30:04 +00:00
parent 2ad8ba3424
commit 7168fa4b72
30 changed files with 1016 additions and 910 deletions

View File

@@ -18,7 +18,6 @@ A manager-centric parking spot management application with fair assignment algor
│ ├── routes/ # API endpoints
│ │ ├── auth.py # Authentication + holidays
│ │ ├── users.py # User management
│ │ ├── offices.py # Office CRUD
│ │ ├── managers.py # Manager rules (closing days, guarantees)
│ │ ├── presence.py # Presence marking
│ │ └── parking.py # Parking assignments
@@ -116,8 +115,8 @@ Group mapping (follows lldap naming convention):
| Role | Permissions |
|------|-------------|
| **admin** | Full access, manage users/offices |
| **manager** | Manage assigned offices, set rules |
| **admin** | Full access, manage users and managers |
| **manager** | Manage their team, set parking rules |
| **employee** | Mark own presence, view calendar |
## API Endpoints
@@ -137,12 +136,6 @@ Group mapping (follows lldap naming convention):
- `GET /api/users/me/profile` - Own profile
- `PUT /api/users/me/settings` - Own settings
### Offices
- `GET /api/offices` - List offices
- `POST /api/offices` - Create office (admin)
- `PUT /api/offices/{id}` - Update office (admin)
- `DELETE /api/offices/{id}` - Delete office (admin)
### Managers
- `GET /api/managers` - List managers
- `GET /api/managers/{id}` - Manager details
@@ -169,7 +162,7 @@ Group mapping (follows lldap naming convention):
Parking spots are assigned based on a fairness ratio:
```
ratio = parking_days / office_days
ratio = parking_days / presence_days
```
Users with the lowest ratio get priority. Guaranteed users are always assigned first.