This repository was archived by the owner on Sep 3, 2025. It is now read-only.
feat(case): adds stable status to cases#6074
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds full support for a new “Stable” status on cases by extending the database schema, back-end logic, front-end UI, cost calculations, and notifications.
- Database & Models: Introduces
stable_attimestamp across SQL models, Pydantic schemas, and Alembic migration - Cost Logic & Tests: Updates cost calculation to halt at
stable_at, and addstest_case_cost_stops_at_stable_time - UI & Messaging: Integrates Stable status into selectors, filters, exports, dashboards, and reminder flows
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/dispatch/database/revisions/tenant/versions/*.py | Adds stable_at column migration |
| src/dispatch/case_cost/service.py | Enhances time-cutoff logic in cost service |
| src/dispatch/static/dispatch/src/dashboard/case/CaseOverview.vue | Displays total stable cases on dashboard |
| src/dispatch/static/dispatch/src/case/CaseStatusSelectGroup.vue | Inserts “Stable” option in status selector |
| src/dispatch/case/flows.py | Implements new create & transition flows for Stable |
| tests/case_cost/test_case_cost_service.py | Adds test to verify cost stops at stable_at |
Comments suppressed due to low confidence (2)
src/dispatch/case/flows.py:353
- In the escalation creation flow, the case is marked as Stable before the escalation transition. This ordering is likely incorrect—Stable should not be set during an escalate flow. Please remove or relocate this call.
case_stable_status_flow(case=case, db_session=db_session)
src/dispatch/static/dispatch/src/case/DetailsTab.vue:138
- [nitpick] The added Stable date picker appears to close the
<v-row>/<v-col>wrappers prematurely, which can break the layout of subsequent fields. Please verify and correct the nesting of those tags.
</v-row>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: David Whittaker <84562015+whitdog47@users.noreply.github.com>
ghost
approved these changes
Jun 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive support for the "Stable" status to cases, mirroring the existing functionality for incidents. This includes database schema changes, backend logic updates, frontend UI improvements, and cost calculation modifications.
Key Changes
Database & Backend
stable_attimestamp column to thecasetableCaseandCaseReadMinimalmodels to includestable_atfieldget_all_by_statusto include stable cases and addedget_all_last_x_hours_by_statusfor stable casesstable_attime, similar to incident cost behaviorFrontend UI
CaseStatusSelectGroup.vueto include "Stable" status with proper ordering and visual indicatorsstable_attimestamp display in case details tabstable_atfieldCost Calculation Logic
calculate_cases_response_costto include stable cases and stop cost updates afterstable_atget_participant_role_time_secondsto:stable_atfor stable casesstable_attimestampTesting
test_case_cost_stops_at_stable_timeto verify stable case cost behaviorScreenshots