feat(scheduler): Clinical Scheduler audit trail + inline per-week history#236
feat(scheduler): Clinical Scheduler audit trail + inline per-week history#236rlorenzo wants to merge 4 commits into
Conversation
Bundle ReportChanges will increase total bundle size by 29.97kB (1.42%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: viper-frontend-esmAssets Changed:
Files in
Files in
Files in
Files in
Files in
Files in
Files in
Files in
|
d936116 to
3bc2ddf
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. |
📝 WalkthroughWalkthroughAdds an end-to-end Clinical Scheduler audit trail with backend APIs, filtered audit UI, per-week history dialogs, permission-gated navigation, and transactional schedule audit writes. Also extracts reusable audit-change rendering in the Effort module. ChangesClinical Scheduler Audit Trail
Audit Consistency
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 12
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@VueApp/src/ClinicalScheduler/components/WeekHistoryButton.vue`:
- Around line 97-114: Refactor loadHistory in WeekHistoryButton.vue to satisfy
the quality gate by breaking the logic into small helpers instead of keeping the
fetch selection and result/error handling inline. Extract one helper to choose
the correct AuditLogService call based on props.viewMode and another to
normalize successful and failed responses/errors into entries.value and
error.value. Keep loadHistory focused on toggling isLoading and orchestrating
these helpers so the method stays simple and readable.
In `@VueApp/src/ClinicalScheduler/pages/AuditLogPage.vue`:
- Around line 54-60: The AuditLogPage.vue filters expansion item is using an
inline desktop visibility style, which violates the Vue styling rules in this
repo. Update the q-expansion-item in AuditLogPage to remove the :header-style
binding and use Quasar utility classes or separate mobile/desktop filter header
containers instead, keeping the same behavior while avoiding inline styles.
- Around line 570-578: The clearFilters function in AuditLogPage.vue does not
fully reset the page because currentYear is left unchanged, so the year-scoped
data and term list remain filtered. Update clearFilters to also reset
currentYear and reuse the same refresh path as onYearChange() so the
year-specific term list and audit log state are restored consistently when
clearing filters.
- Around line 484-510: loadAuditTrail() in AuditLogPage.vue is too complex and
needs to be split up to pass the Fallow gate. Extract the
AuditLogService.getAuditLog filter construction into a helper and move the
success/error response handling into a separate helper so loadAuditTrail() stays
a simple linear fetch flow. Keep the existing behavior intact while reducing the
branching inside loadAuditTrail(), and use the current symbols like currentYear,
selectedTermCode, selectedRotationId, selectedArea, selectedModifier,
selectedPerson, fromDate, toDate, and AuditLogService.getAuditLog to organize
the refactor.
- Around line 484-515: `loadAuditTrail()` can resolve out of order and overwrite
newer filter results in `AuditLogPage.vue`. Add a request guard in
`loadAuditTrail` (for example, a monotonically increasing request id or
cancellation token) so only the latest invocation is allowed to set
`entries.value`, `error.value`, and `isLoading.value`. Make sure the debounced
loader and any other callers still invoke `loadAuditTrail`, but stale responses
are ignored before committing state.
In `@VueApp/src/Effort/components/AuditChangeDetail.vue`:
- Line 3: Remove the narration comments from AuditChangeDetail’s template
branches; they just restate the conditional rendering and add noise. Update the
Vue template around the inline reference-value and changed-value sections by
deleting the explanatory comments, while keeping the existing branch logic and
structure in place.
In `@VueApp/src/Effort/pages/AuditList.vue`:
- Around line 152-167: The search input in AuditList.vue currently relies only
on placeholder text, so it loses its visible name after typing. Update the
q-input used for filter.searchText to include a persistent label while keeping
the existing placeholder as hint text, using the existing search field markup
and v-model binding to locate it.
In `@web/Areas/ClinicalScheduler/Controllers/ScheduleAuditController.cs`:
- Around line 141-187: The week-history endpoints in ScheduleAuditController
return List<AuditLogEntryDto> even though
ScheduleAuditService.BuildEnrichedAuditQuery(...) does not populate required
fields such as WeekNum and Term. Update the projection used by
GetRotationWeekHistory and GetClinicianWeekHistory to fully populate
AuditLogEntryDto, or switch those actions to a narrower DTO that only includes
the fields actually returned. Ensure the response contract matches the frontend
AuditLogEntry expectations.
- Around line 15-18: The ScheduleAuditController route is using a hardcoded
nonstandard path, so update the route attribute on ScheduleAuditController to
follow the repo’s controller-based API convention. Replace the current fixed
audit route with the standard absolute /api/{area}/{controller} pattern so the
controller resolves through its name instead of a custom endpoint.
- Around line 31-41: The XML documentation for ScheduleAuditController’s
GetAuditLogAsync contract is misleading about the person filter. Update the
<param name="person"> comment so it clearly states this parameter is a MothraID
exact match, not a substring search on display name. Keep the docs aligned with
the behavior in IScheduleAuditService.GetAuditLogAsync and
ScheduleAuditService.GetAuditLogAsync, and adjust any related wording in the
controller summary if needed.
In `@web/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs`:
- Around line 388-401: The week-history projection in ScheduleAuditService’s
audit query is returning AuditLogEntryDto without setting WeekNum, TermCode, or
Term, which leaves those members at default values and makes the shared DTO
inconsistent across endpoints. Update the select new AuditLogEntryDto in the
GetRotationWeekAuditAsync/GetClinicianWeekAuditAsync query to populate those
fields from the available week-related data, or introduce a separate DTO for
week history and use it there instead of reusing AuditLogEntryDto.
- Around line 237-240: Replace the filtered catch in ScheduleAuditService with
explicit typed handlers so each failure type is handled separately. Update the
exception handling around the audit retrieval logic in the relevant service
method to use distinct catch blocks for DbUpdateException, SqlException, and
InvalidOperationException instead of a single `catch (Exception) when (...)`,
and keep the existing logging/throw behavior in each branch using the same
logger message pattern and the method context around `gradYear`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a18a5a59-93d9-4808-80e7-38949f8f10db
📒 Files selected for processing (24)
VueApp/src/ClinicalScheduler/__tests__/audit-log-page-access.test.tsVueApp/src/ClinicalScheduler/components/ScheduleLegend.vueVueApp/src/ClinicalScheduler/components/ScheduleView.vueVueApp/src/ClinicalScheduler/components/SchedulerNavigation.vueVueApp/src/ClinicalScheduler/components/WeekCell.vueVueApp/src/ClinicalScheduler/components/WeekHistoryButton.vueVueApp/src/ClinicalScheduler/components/WeekHistoryContent.vueVueApp/src/ClinicalScheduler/constants/permission-messages.tsVueApp/src/ClinicalScheduler/pages/AuditLogPage.vueVueApp/src/ClinicalScheduler/pages/ClinicianScheduleView.vueVueApp/src/ClinicalScheduler/pages/RotationScheduleView.vueVueApp/src/ClinicalScheduler/router/routes.tsVueApp/src/ClinicalScheduler/services/audit-log-service.tsVueApp/src/ClinicalScheduler/types/audit-types.tsVueApp/src/ClinicalScheduler/utils/audit-actions.tsVueApp/src/Effort/components/AuditChangeDetail.vueVueApp/src/Effort/pages/AuditList.vueweb/Areas/ClinicalScheduler/Controllers/ScheduleAuditController.csweb/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditLogEntryDto.csweb/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditModifierDto.csweb/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditTermDto.csweb/Areas/ClinicalScheduler/Services/ClinicalSchedulerNavMenu.csweb/Areas/ClinicalScheduler/Services/IScheduleAuditService.csweb/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs
3bc2ddf to
b8e1cd4
Compare
There was a problem hiding this comment.
Pull request overview
Surfaces and productizes existing Clinical Scheduler audit data by adding a manager-gated audit-log API + UI (full page and inline per-week history), replacing the legacy ColdFusion “Schedule Changes Audit log”.
Changes:
- Added new Clinical Scheduler audit endpoints (
/api/clinicalscheduler/audit/*) and service methods returning enriched, filterable audit DTOs. - Added new Vue Audit Trail page + routing/navigation, plus inline per-week history popover/dialog for managers.
- Refactored Effort audit list change-detail rendering into a shared
AuditChangeDetailcomponent and adjusted filter UX defaults.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| web/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs | Adds enriched audit-log query methods (filters, term mapping, per-week history projections). |
| web/Areas/ClinicalScheduler/Services/IScheduleAuditService.cs | Extends the service contract to include audit-log, term, modifier/person, and per-week history methods. |
| web/Areas/ClinicalScheduler/Services/ClinicalSchedulerNavMenu.cs | Adds “Audit Trail” nav item for users with Manage permission. |
| web/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditTermDto.cs | New DTO for term filter options scoped to grad year. |
| web/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditModifierDto.cs | New DTO for “Modified By” / “Person” filter options. |
| web/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditLogEntryDto.cs | New enriched audit row DTO used by page + inline week history. |
| web/Areas/ClinicalScheduler/Controllers/ScheduleAuditController.cs | New API controller exposing audit-log/filter endpoints and per-week history endpoints (Manage-gated). |
| VueApp/src/Effort/pages/AuditList.vue | Improves filter defaults/UX and uses shared change-detail component. |
| VueApp/src/Effort/components/AuditChangeDetail.vue | New shared renderer for change-detail old/new values. |
| VueApp/src/ClinicalScheduler/utils/audit-actions.ts | Shared mapping from schedule-audit action → Quasar color. |
| VueApp/src/ClinicalScheduler/types/audit-types.ts | New TS types for schedule audit rows and filter option DTOs. |
| VueApp/src/ClinicalScheduler/services/audit-log-service.ts | New frontend service for Clinical Scheduler audit endpoints. |
| VueApp/src/ClinicalScheduler/router/routes.ts | Adds route for the new Audit Trail page. |
| VueApp/src/ClinicalScheduler/pages/RotationScheduleView.vue | Plumbs “can view history” + context info into the schedule grid. |
| VueApp/src/ClinicalScheduler/pages/ClinicianScheduleView.vue | Plumbs “can view history” + context info into the schedule grid. |
| VueApp/src/ClinicalScheduler/pages/AuditLogPage.vue | New Audit Trail page with responsive results display and filter controls. |
| VueApp/src/ClinicalScheduler/constants/permission-messages.ts | Adds access-denied messaging for the new audit trail feature. |
| VueApp/src/ClinicalScheduler/composables/use-audit-entries.ts | Shared loader/state composable for audit entries (page + inline history). |
| VueApp/src/ClinicalScheduler/components/WeekHistoryContent.vue | New reusable content component for per-week audit history UI. |
| VueApp/src/ClinicalScheduler/components/WeekHistoryButton.vue | New trigger button that shows per-week history (popover on desktop, dialog on mobile). |
| VueApp/src/ClinicalScheduler/components/WeekCell.vue | Adds per-week history icon and prevents cell actions when tapping embedded controls. |
| VueApp/src/ClinicalScheduler/components/ScheduleView.vue | Plumbs history props through to week cells and legend; minor export cleanup + mobile layout tweak. |
| VueApp/src/ClinicalScheduler/components/SchedulerNavigation.vue | Adds “Audit Trail” tab for managers. |
| VueApp/src/ClinicalScheduler/components/ScheduleLegend.vue | Adds manager-only legend row describing the history icon. |
| VueApp/src/ClinicalScheduler/tests/audit-log-page-access.test.ts | Adds access-control tests for the audit-log page behavior. |
4f6cd6d to
15d53b4
Compare
|
@bsedwards Should be on TEST now. Adds audit trail inline on the weeks display as well as a dedicated page |
|
@rlorenzo FYI I was playing with the schedule on test for year 2027, and the history button on the schedule views doesn't seem to load anything |
026e8f9 to
aaff6b9
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
cb736e5 to
2d8d4ec
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@VueApp/src/ClinicalScheduler/components/WeekCell.vue`:
- Around line 282-294: Update originatesOnControl to inspect
event.composedPath() so text-node targets inside buttons, links, inputs, and
other controls are detected reliably. Check the full path for the existing
control selectors and preserve the current false result when no event or
matching control is present; keep handleClick’s scheduling guard unchanged.
In `@VueApp/src/ClinicalScheduler/components/WeekHistoryBody.vue`:
- Around line 63-80: Update the week-history paging flow so retained entries are
not rendered under the newly selected week: either show the loading skeleton for
the entire paging interval or clear entries before updating the active week.
Ensure the existing list rendering in WeekHistoryBody and the corresponding
state/update logic preserve correct records for the selected week.
In `@VueApp/src/ClinicalScheduler/components/WeekHistoryContent.vue`:
- Around line 90-106: Update the viewport styling to remove the inline :style
height binding and define height: v-bind(bodyHeight) in the component’s scoped
stylesheet. In the progress bar markup, replace size="2px" with size="0.125rem",
preserving the existing showProgress behavior and styling.
In `@VueApp/src/ClinicalScheduler/composables/use-audit-entries.ts`:
- Around line 41-62: Update the audit-loading flow in the composable so failed
responses and caught errors clear entries.value before setting the error,
preventing prior results from remaining visible. Update reset() to invalidate
the active request by advancing latestRequestId, then clear entries.value and
error.value so pending requests cannot repopulate stale results.
In `@VueApp/src/ClinicalScheduler/pages/AuditLogPage.vue`:
- Around line 323-355: Update loadFilterOptions and loadTermOptions to surface
unsuccessful rotation, modifier, person, and term responses instead of silently
ignoring them, and ensure rejected service requests are propagated or reported
with actionable error details. In initialize, catch failures from the
fire-and-forget loading flow before the finally block sets ready, preserving
successful option population while preventing unhandled initialization errors.
- Around line 350-361: Update loadTermOptions to capture the requested
currentYear value before calling AuditLogService.getTerms, then commit
termOptions only if that response still matches the latest requested year.
Ensure rapid onYearChange calls cannot apply an older response over the options
for the current year.
In `@web/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs`:
- Around line 307-315: Update the affected-person query in ScheduleAuditService
to exclude both null and empty MothraId values before constructing
AuditModifierDto results. Preserve the existing left join and display-name
fallback for valid identifiers, matching the modifier query’s filtering
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 27e54390-fcef-4e24-b101-a9a4e6121de4
📒 Files selected for processing (35)
VueApp/src/ClinicalScheduler/__tests__/audit-log-page-access.test.tsVueApp/src/ClinicalScheduler/__tests__/audit-log-results-table.test.tsVueApp/src/ClinicalScheduler/__tests__/week-history-content.test.tsVueApp/src/ClinicalScheduler/components/AuditLogResultsTable.vueVueApp/src/ClinicalScheduler/components/ScheduleLegend.vueVueApp/src/ClinicalScheduler/components/ScheduleView.vueVueApp/src/ClinicalScheduler/components/SchedulerNavigation.vueVueApp/src/ClinicalScheduler/components/WeekCell.vueVueApp/src/ClinicalScheduler/components/WeekHistoryBody.vueVueApp/src/ClinicalScheduler/components/WeekHistoryButton.vueVueApp/src/ClinicalScheduler/components/WeekHistoryContent.vueVueApp/src/ClinicalScheduler/components/WeekHistoryDialog.vueVueApp/src/ClinicalScheduler/composables/use-audit-entries.tsVueApp/src/ClinicalScheduler/constants/permission-messages.tsVueApp/src/ClinicalScheduler/pages/AuditLogPage.vueVueApp/src/ClinicalScheduler/pages/ClinicianScheduleView.vueVueApp/src/ClinicalScheduler/pages/RotationScheduleView.vueVueApp/src/ClinicalScheduler/router/routes.tsVueApp/src/ClinicalScheduler/services/audit-log-service.tsVueApp/src/ClinicalScheduler/types/audit-types.tsVueApp/src/ClinicalScheduler/utils/audit-actions.tsVueApp/src/Effort/__tests__/audit-change-detail.test.tsVueApp/src/Effort/components/AuditChangeDetail.vueVueApp/src/Effort/pages/AuditList.vuetest/ClinicalScheduler/ScheduleAuditServiceTest.cstest/ClinicalScheduler/ScheduleEditServiceRollbackTest.cstest/ClinicalScheduler/ScheduleEditServiceTest.csweb/Areas/ClinicalScheduler/Controllers/ScheduleAuditController.csweb/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditLogEntryDto.csweb/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditModifierDto.csweb/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditTermDto.csweb/Areas/ClinicalScheduler/Services/ClinicalSchedulerNavMenu.csweb/Areas/ClinicalScheduler/Services/IScheduleAuditService.csweb/Areas/ClinicalScheduler/Services/ScheduleAuditService.csweb/Areas/ClinicalScheduler/Services/ScheduleEditService.cs
2d8d4ec to
72ca312
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
VueApp/src/ClinicalScheduler/components/ScheduleView.vue (1)
70-76: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse the same history gate for the legend and week buttons.
show-historyusescanViewHistory, while the buttons usecanShowHistory. With a missing context, the legend advertises a control that is not rendered.Proposed fix
- :show-history="canViewHistory" + :show-history="canShowHistory"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@VueApp/src/ClinicalScheduler/components/ScheduleView.vue` around lines 70 - 76, Update the ScheduleLegend `show-history` binding to use the same `canShowHistory` gate as the week buttons, ensuring the legend does not advertise history when the required context is unavailable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@VueApp/src/ClinicalScheduler/__tests__/audit-log-results-table.test.ts`:
- Around line 44-54: Update the test in
VueApp/src/ClinicalScheduler/__tests__/audit-log-results-table.test.ts:44-54 to
assert the actual QTable body-row count in addition to the existing content
assertions. Update the test in
VueApp/src/ClinicalScheduler/__tests__/week-history-content.test.ts:90-96 to
assert both the week number and formatted date, preserving the existing expected
values.
In `@VueApp/src/ClinicalScheduler/components/WeekHistoryBody.vue`:
- Around line 28-48: Replace the custom error-state markup in
WeekHistoryBody.vue with the shared StatusBanner component configured with
type="error". Preserve the displayed error message and wire the existing Retry
action to emit the same retry event.
In `@VueApp/src/ClinicalScheduler/components/WeekHistoryContent.vue`:
- Around line 165-168: Replace all remaining pixel-based sizing in the listed
WeekHistory components with rem units: in
VueApp/src/ClinicalScheduler/components/WeekHistoryContent.vue lines 165-168
convert the measured offsetHeight to root-relative rem, lines 232-244 use
0.0625rem for the header border, and lines 271-276 use -0.0625rem for progress
positioning; in VueApp/src/ClinicalScheduler/components/WeekHistoryBody.vue
lines 12-16 convert skeleton width and height to rem and lines 153-156 use
0.0625rem for the item border.
In `@web/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs`:
- Around line 235-238: Update the affected logging statements in the audit
retrieval and related methods to sanitize every request-derived value before
logging: pass gradYear through SanitizeYear(), rotationId and weekId through the
appropriate LogSanitizer method, and retain sanitization for mothraId. Apply the
same treatment at the referenced logging sites while preserving their existing
messages and behavior.
---
Outside diff comments:
In `@VueApp/src/ClinicalScheduler/components/ScheduleView.vue`:
- Around line 70-76: Update the ScheduleLegend `show-history` binding to use the
same `canShowHistory` gate as the week buttons, ensuring the legend does not
advertise history when the required context is unavailable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1f71d788-f711-4123-a264-2b4638ecbadf
📒 Files selected for processing (32)
VueApp/src/ClinicalScheduler/__tests__/audit-log-page-access.test.tsVueApp/src/ClinicalScheduler/__tests__/audit-log-results-table.test.tsVueApp/src/ClinicalScheduler/__tests__/week-history-content.test.tsVueApp/src/ClinicalScheduler/components/AuditLogResultsTable.vueVueApp/src/ClinicalScheduler/components/ScheduleLegend.vueVueApp/src/ClinicalScheduler/components/ScheduleView.vueVueApp/src/ClinicalScheduler/components/SchedulerNavigation.vueVueApp/src/ClinicalScheduler/components/WeekCell.vueVueApp/src/ClinicalScheduler/components/WeekHistoryBody.vueVueApp/src/ClinicalScheduler/components/WeekHistoryButton.vueVueApp/src/ClinicalScheduler/components/WeekHistoryContent.vueVueApp/src/ClinicalScheduler/components/WeekHistoryDialog.vueVueApp/src/ClinicalScheduler/composables/use-audit-entries.tsVueApp/src/ClinicalScheduler/constants/permission-messages.tsVueApp/src/ClinicalScheduler/pages/AuditLogPage.vueVueApp/src/ClinicalScheduler/pages/ClinicianScheduleView.vueVueApp/src/ClinicalScheduler/pages/RotationScheduleView.vueVueApp/src/ClinicalScheduler/router/routes.tsVueApp/src/ClinicalScheduler/services/audit-log-service.tsVueApp/src/ClinicalScheduler/types/audit-types.tsVueApp/src/ClinicalScheduler/utils/audit-actions.tsVueApp/src/Effort/__tests__/audit-change-detail.test.tsVueApp/src/Effort/components/AuditChangeDetail.vueVueApp/src/Effort/pages/AuditList.vuetest/ClinicalScheduler/ScheduleAuditServiceTest.csweb/Areas/ClinicalScheduler/Controllers/ScheduleAuditController.csweb/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditLogEntryDto.csweb/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditModifierDto.csweb/Areas/ClinicalScheduler/Models/DTOs/Responses/AuditTermDto.csweb/Areas/ClinicalScheduler/Services/ClinicalSchedulerNavMenu.csweb/Areas/ClinicalScheduler/Services/IScheduleAuditService.csweb/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs
72ca312 to
6d22f53
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Persist schedule-change audit entries inside the same transaction as the edit, so audit rows commit or roll back atomically with the schedule.
Add a manager-gated audit trail page for the clinical scheduler, backed by a paged query API over schedule-change history. - filterable, paged results table of changes by term and modifier - REST endpoints and DTOs for querying audit history - navigation entry and route gated by the manage permission
Surface schedule-change history directly in the grid: each week cell opens a modal showing that week's audit entries, with week-to-week paging and a legend icon for managers.
Match the Effort audit list's filters and change-detail presentation to the clinical scheduler audit trail for a consistent experience.
6d22f53 to
c9ec4a7
Compare
|
@bsedwards I synced the audit data from prod, so the 2027 entries are now showing up. Also saw log entries for student schedules were showing up. That's filtered now. I also made the week audit history a modal instead of a pop-up for better ux and added forward and backward buttons. |
Summary
Replaces the legacy ColdFusion "Schedule Changes Audit log" by surfacing the
ScheduleAuditdata VIPER already records. Everything is gated on the legacy page's permission,SVMSecure.ClnSched.Manage; no new permission.ScheduleAudit(grad year, term, rotation, area, modified by, person, date range) with colored action badges and a responsive layout (full table / stacked / cards) matching the Effort audit trail.AuditChangeDetailcomponent.Audit writes are now fail-closed
Audit entries used to be written after the schedule transaction committed, inside a try/catch that reduced failures to a log warning, so a schedule change could commit with no trail. Now:
ScheduleEditServiceRollbackTest) asserts the schedule mutation actually rolls back.Notes