Implement multi-tenant permission management module

- Added Pydantic schemas for permission-related requests and responses in `schemas.py`.
- Created seed data for various permissions and roles in `seed.py`.
- Developed a `PermissionService` class in `service.py` to handle permission logic, including user role assignments and direct permission grants.
- Implemented unit tests for permission functionalities in `test_permissions.py`, covering role assignments, permission checks, and expiration handling.
- Seeded trailer types data in `trailer_types/seed.py`.
This commit is contained in:
2026-01-14 15:55:44 -06:00
parent 4079a0cc0f
commit fca122759c
13 changed files with 2547 additions and 19 deletions

View File

@@ -0,0 +1,45 @@
seed = [
("20", "20 ft Sea container open top"),
("2B", "20 ft Sea container - closed top"),
("40", "40 ft Sea container - open top"),
("4B", "40 ft Sea container - closed top"),
("BI", "Beverage rack trailer"),
("CB", "Gooseneck trailer"),
("CH", "Chassis"),
("CL", "Other lenght Sea container - closed top"),
("CU", "Other length Sea container - open top"),
("CZ", "Refrigerated Container"),
("DD", "Double Drop Trailer"),
("DT", "Drop Back Trailer"),
("FR", "Flat rack trailer"),
("FT", "Flatbed/platform trailer"),
("HC", "Hopper Trailer (covered)"),
("HE", "Horse trailer"),
("HO", "Hopper Trailer (open)"),
("HP", "Hopper Trailer (covered Pneumatic Discharged)"),
("L1", "Tank trailer (liquids) not heated/not insulated"),
("L2", "Tank trailer (liquids) heated/not insulated"),
("L3", "Tank trailer (liquids) not heated/insulated"),
("L4", "Tank trailer (liquids) heated/insulate"),
("LP", "Logging, pipe or pole trailer"),
("LT", "Livestock trailer"),
("NC", "No Equipment"),
("OE", "Other"),
("RD", "Fixed Rack, Double Drop Trailer"),
("RG", "Gondola closed"),
("RO", "Gondola open"),
("RS", "Fixed Rack, Single Drop Trailer"),
("SD", "Single Drop Trailer"),
("T1", "Tank trailer (gas) not heated/ not insulated"),
("T2", "Tank trailer (gas) heated/not insulated"),
("T3", "Tank trailer (gas) not heated/insulated"),
("T4", "Tank trailer (gas) heated/insulate"),
("T5", "Tank trailer (chemicals) not heated/not insulated"),
("T6", "Tank trailer (chemicals) heated/not insulated"),
("T7", "Tank trailer (chemicals) not heated/insulated"),
("T8", "Tank trailer (chemicals) heated/insulate"),
("TC", "Auto car/trailer"),
("TK", "Tank trailer (food grade liquids)"),
("TL", "Semi-truck trailer"),
("TW", "Controlled temperature trailer"),
]