- Backend: new canonical Proposal model + /proposals router - Backward-compat shims for old Propose imports and /proposes API - Tests updated to use /proposals, legacy compat tests added - Impact checklist: docs/BE-PR-001-rename-impact.md - TASKLIST.md: BE-PR-001 marked complete All 21 proposal tests pass.
32 lines
1.7 KiB
Markdown
32 lines
1.7 KiB
Markdown
# BE-PR-001: Propose → Proposal Rename Impact Checklist
|
|
|
|
## Summary
|
|
Unified all backend Python-level naming from `Propose` to `Proposal`. DB table and column names kept unchanged for backward compatibility (no migration needed).
|
|
|
|
## Files Changed
|
|
|
|
### New Files
|
|
- `app/models/proposal.py` — Canonical model: `Proposal`, `ProposalStatus`
|
|
- `app/api/routers/proposals.py` — Canonical router at `/projects/{id}/proposals`
|
|
|
|
### Modified Files
|
|
- `app/models/propose.py` — Now a backward-compat shim re-exporting from `proposal.py`
|
|
- `app/api/routers/proposes.py` — Now a backward-compat shim delegating to `proposals.py` (legacy `/proposes` URL still works)
|
|
- `app/schemas/schemas.py` — Renamed: `ProposalStatusEnum`, `ProposalBase`, `ProposalCreate`, `ProposalUpdate`, `ProposalResponse` (old names kept as aliases)
|
|
- `app/main.py` — Registers both `proposals_router` (canonical) and `proposes_router` (legacy compat)
|
|
- `app/init_wizard.py` — Updated comments to say "Proposal" (permission names `propose.*` kept for DB compat)
|
|
- `tests/test_propose.py` — Updated all tests to use `/proposals` URL; added legacy endpoint compat tests
|
|
|
|
## What Was Kept for Backward Compatibility
|
|
| Item | Kept As-Is | Reason |
|
|
|------|-----------|--------|
|
|
| DB table name | `proposes` | Avoid DB migration |
|
|
| DB column | `propose_code` | Avoid DB migration |
|
|
| Permission names | `propose.accept`, `propose.reject`, `propose.reopen` | Already stored in DB |
|
|
| Legacy API path | `/projects/{id}/proposes/*` | Client compat |
|
|
| Python aliases | `Propose`, `ProposeStatus`, `ProposeCreate`, etc. | Import compat |
|
|
|
|
## API Endpoints
|
|
- **Canonical:** `/projects/{project_id}/proposals` (new)
|
|
- **Legacy:** `/projects/{project_id}/proposes` (still works, delegates to canonical)
|