[Debt] Refactor tenant update route complexity #4

Closed
opened 2026-07-11 12:51:26 +02:00 by zemion · 1 comment
Owner

Xenon/Radon identify tenant update route complexity.

Classification: structural maintainability work.

Report evidence:

  • govoplan-tenancy/src/govoplan_tenancy/backend/api/v1/routes.py:496 update_tenant rank D.

Suggested next steps:

  • Extract tenant update validation and defaults handling from route code.
  • Add tests for update constraints and inherited defaults.
  • Keep tenant API response compatibility stable.

Baseline report directory: audit-reports/govoplan-full-20260711-1238

<!-- codex-audit-full-2026-07-11:tenancy-complexity-baseline --> Xenon/Radon identify tenant update route complexity. Classification: **structural maintainability work**. Report evidence: - `govoplan-tenancy/src/govoplan_tenancy/backend/api/v1/routes.py:496 update_tenant` rank D. Suggested next steps: - Extract tenant update validation and defaults handling from route code. - Add tests for update constraints and inherited defaults. - Keep tenant API response compatibility stable. Baseline report directory: `audit-reports/govoplan-full-20260711-1238`
zemion added the
type
debt
priority
p3
status
ready
module/tenancy
codex/ready
labels 2026-07-11 12:51:26 +02:00
zemion added the
audit/complexity
audit/structural
source/security-audit
labels 2026-07-11 16:12:20 +02:00
Author
Owner

Codex State: done

Summary

  • Split tenant update route into permission, lookup, content normalization, governance override, and status-update helpers.
  • Added tests for content/status permission split, blank/default normalization, and current-tenant suspension guard.

Changed Files

  • src/govoplan_tenancy/backend/api/v1/routes.py
  • tests/test_tenant_lifecycle.py

Verification

  • PYTHONPATH=... /mnt/DATA/git/govoplan/.venv/bin/python -m unittest tests.test_tenant_lifecycle
## Codex State: done ### Summary - Split tenant update route into permission, lookup, content normalization, governance override, and status-update helpers. - Added tests for content/status permission split, blank/default normalization, and current-tenant suspension guard. ### Changed Files - `src/govoplan_tenancy/backend/api/v1/routes.py` - `tests/test_tenant_lifecycle.py` ### Verification - `PYTHONPATH=... /mnt/DATA/git/govoplan/.venv/bin/python -m unittest tests.test_tenant_lifecycle`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: add-ideas/govoplan-tenancy#4
No description provided.