feat(projects): reject task/phase create on cancelled project (PMS-399) #305
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-399-reject-children-on-cancelled-project"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The project module's child-create endpoints did not check the parent project's status, so a task or phase could be attached to a project whose
status = 'cancelled'. This adds a privateensure_project_openguard onProjectsServicethat reads the project status inside the caller's tenant-scoped transaction (missing row -> 404,cancelled-> 409) and calls it at the top ofcreate_taskandcreate_project_phasebefore the INSERT, so the status check and the insert share one transaction and the RLS GUC applies to both. Scope is strictly the create/attach paths: updates to existing children and project status transitions are left alone. A DB-backed integration test covers the 409 on a cancelled project for both task and phase, asserts no child row lands, checks the 404 on a missing project, and confirms an active project still accepts both children.#PMS-399
8deedce275bc71b9c578