Target/Scenario/Run/Campaign repositories repeated the same __init__/list_all/get/create/delete skeleton (~120 lines). Extract a generic BaseRepository[M, DB]: subclasses declare the table + ordering column and implement instance-method _to_db/_from_db converters (so Scenario's _from_db can reach self.session for model bindings). Bespoke paths (Scenario create/delete, all update) stay per-subclass. Adds test_repository.py locking the CRUD + JSON round-trip contract. |
||
|---|---|---|
| .. | ||
| integration | ||
| unit | ||
| __init__.py | ||
| conftest.py | ||