Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict review period status transitions #2426

Merged
merged 3 commits into from
May 23, 2024

Conversation

timyates
Copy link
Collaborator

Prior to updating a ReviewPeriod, we now validate that the ReviewStatus follows the following rules:

  • State can remain the same
  • PLANNING can progress to AWAITING_APROVAL
  • AWAITING_APPROVAL can progress to OPEN
  • OPEN can progress to CLOSED
  • CLOSED can progress to OPEN (for when a case is re-opened)
  • UNKNOWN can progress to PLANNING (UNKNOWN was used for period where isOpen was NULL prior to migration)

All other state changes will cause a BAD_REQUEST response with an appropriate message

Prior to updating a ReviewPeriod, we now validate that the ReviewStatus follows the following rules:

- State can remain the same
- `PLANNING` can progress to `AWAITING_APROVAL`
- `AWAITING_APPROVAL` can progress to `OPEN`
- `OPEN` can progress to `CLOSED`
- `CLOSED` can progress to `OPEN` (for when a case is re-opened)
- `UNKNOWN` can progress to `PLANNING` (`UNKNOWN` was used for period where isOpen was NULL prior to migration)

All other state changes will cause a `BAD_REQUEST` response with an appropriate message
@timyates timyates added enhancement New feature or request server labels May 22, 2024
@timyates timyates self-assigned this May 22, 2024
@timyates timyates linked an issue May 22, 2024 that may be closed by this pull request
2 tasks
Copy link
Collaborator

@ZacharyKlein ZacharyKlein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tagging @mkimberlin to validate that the state transitions are all correct.

@ZacharyKlein ZacharyKlein merged commit 247fa84 into develop May 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restrict review period state transitions
3 participants