CMS-1848: Add team approval CSV columns - #702
Conversation
There was a problem hiding this comment.
Pull request overview
Updates season approval determination to better reflect reservation-system coverage (including mixed ParkArea feature coverage) and historical gate removals, and extends the CSV export to show team-approval status per season/date row.
Changes:
- Refactors reservation-system checks into a new
getSeasonReservationCoveragehelper and makes approval-resolution helpers async to support historical checks. - Adds
hasGateRemoved(seasonId)to detect any priorhasGate: true -> falsetransitions viaSeasonChangeLog. - Adds “Information Services team approved” and “Reservation Services team approved” columns to the CSV export, with “Yes” / blank / “N/A” formatting.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| backend/utils/seasonApprovalHelpers.js | Adds reservation coverage helper and historical gate-removal lookup; makes approval resolution async. |
| backend/routes/api/seasons.js | Awaits async approval resolution when saving seasons. |
| backend/routes/api/export.js | Adds CSV columns and formatting helpers for IS/RS approval status; loads gate values in changelogs for export logic. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Notes for testing, which I'll repost in the Jira ticket for QA: Verifying the logic in a generated CSV:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
backend/utils/seasonApprovalHelpers.js:38
- For ParkArea seasons,
anyNotInReservationSystemdoesn’t consider the ParkArea-levelinReservationSystem === falsewhen at least one feature istrue. In that mixed case,anyInReservationSystembecomes true and the current!anyInReservationSystemcheck becomes false, soanyNotInReservationSystemcan incorrectly be false even though the ParkArea itself is explicitly not in the reservation system. This can under-require IS approval for ParkArea seasons with mixed feature coverage.
const anyNotInReservationSystem =
!anyInReservationSystem ||
features.some((f) => f.inReservationSystem === false);
|
Added the "DO NOT MERGE" label for now, as this is for SP v2.6.0 Once it's approved, I will grab the bugfix parts and merge those into main, leaving the CSV stuff for later in Sept. |
6c08518 to
1042319
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
backend/routes/api/export.js:106
gateRemovedtreats a changelog as a “gate removed” whenever the old value istrueand the new value is anything other thantrue(includingnull/missing). However, SeasonChangeLogs can legitimately havegateDetailNewValue: nullwhen gateDetail isn’t supplied (e.g.,backend/utils/saveSeasonData.jssetsgateDetailNewValuetogateDetailToSave, which stays null when gateDetail isn’t included). This can incorrectly mark IS approval as required. To match the existinghasGateRemoved()semantics inbackend/utils/seasonApprovalHelpers.js(old=true AND new=false), only treat it as removal when the new value is explicitlyfalse.
const oldHasGate = changeLog.gateDetailOldValue?.hasGate === true;
const newHasGate = changeLog.gateDetailNewValue?.hasGate === true;
return oldHasGate && !newHasGate;
});
1042319 to
a139700
Compare
a139700 to
8d841b6
Compare
CMS-1848: Add IS/RS approval status to CSV export CMS-1848: Fix "gate removed" logic in season approval helpers CMS-1848: Include missing area.feature.inReservationSystem CMS-1848: Update Area-level "inReservationSystem" logic
8d841b6 to
bca87ec
Compare
ayumi-oxd
left a comment
There was a problem hiding this comment.
Looks good, I didn't know the relation with a gate and IS team 😅
Jira Ticket
CMS-1848
Description
This ticket adds two columns to the CSV export: "Information Services team approved" & "Reservation Services team approved".
If the date row's season is approved by that team, the column displays "Yes"
If the date row's season is not approved by the team, but the team's approval is required, it will be blank
If the date row's season is not approved by the team and the team's approval is not required, it displays "N/A"
I added some helper functions to help figure out if each team's approval is required for a given season.
While working on this and #692 we also noticed a gap in the existing logic that checks if
hasGatechanged from true to false. I moved that to #704 so the fix can be included in v2.5.0I also updated the logic for the "In BC Parks Reservation system" column to also check the inReservationSystem flag on all the area features, to be consistent with the logic for
getSeasonReservationCoverage. UX confirmed this just now 👍