Program status can be set to any value, no server side validation
- Dominant language
- Python
- Stars
- 451
- Forks
- 702
- Avg merge
- 22h 59m
- Merged PRs (30d)
- 91
Description
**Describe the bug**
`updateProgramStatus` mutation accepts any `ProgramStatusEnum` regardless of current status. An admin can jump `DRAFT → COMPLETED` or go `COMPLETED → PUBLISHED`. The frontend already restricts transitions in `EntityActions.tsx` but the server doesn't enforce it.
**To Reproduce**
1. Have a program in `DRAFT` status
2. Send this mutation (authenticated as program admin):
```graphql
mutation { updateProgramStatus(inputData: {key: "X", name: "Y", status: COMPLETED}) { status } }
```
3. Program is now `COMPLETED`. Never went through `PUBLISHED`.
**Expected behavior**
Server should validate transitions match the intended flow: `DRAFT → PUBLISHED → COMPLETED` (with unpublish allowed back to `DRAFT`).
**Are you going to work on fixing this?**
- [x] Yes
- [ ] No
**Additional context**
Frontend dropdown in `EntityActions.tsx:155-167` already encodes the correct transitions. The server just needs to enforce the same thing.
Contributor guide
Assessment
This issue has not been assessed yet.