feat(supervisor): phase 7e — call-type and distribution reports (server-side XLSX) - #12
Open
Madhav2402 wants to merge 2 commits into
Open
feat(supervisor): phase 7e — call-type and distribution reports (server-side XLSX)#12Madhav2402 wants to merge 2 commits into
Madhav2402 wants to merge 2 commits into
Conversation
… XLSX downloads (7e)
…, faithful quirks
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📋 Description
crmReports/*and downloads the server-produced XLSX blob. The old app had five near-identical report components; this PR ships one call-type component + one config-drivenDistributionReportComponentcovering all four distributions, with every payload byte-faithful. Stacked on feat(supervisor): phase 7d — outbound allocation and reallocation suite (generic, grievance, everwell) #11 — please review/merge feat(supervisor): phase 7b — activity console shell, telephony iframes, supervisor entry route #9 → feat(outbound): phase 7c — outbound worklist hub, dial hand-offs and outbound call loop #10 → feat(supervisor): phase 7d — outbound allocation and reallocation suite (generic, grievance, everwell) #11 first; this PR's diff is the phase-7e commits.✅ Type of Change
What's in this PR
ReportsApiService+ shared helpersdownloadReport(path, body): Observable<Blob>(responseType: 'blob'). The oldReportsServicebypassed its interceptors with a construction-time token (a stale-token bug); ours goes through the normal chain — the response interceptor passes non-envelope bodies (blobs) through untouched.getCallTypes()postscall/getCallTypesV1with the report's plain body (no campaign flags — the report flavor).maxReportDay()(yesterday, native[max]),clampReportEnd(start)(oldendDateChangecap),reportDatesValidator(), andsaveBlob().Call Type Report (case 9)
crmReports/getAllReportsByDate, filenameCall_Type_Report..999Z(unlike the distribution reports) — kept.Distribution reports (cases 15–18, one config component)
REPORTSconfig maps each kind →{title, path, fileName, options, dimension}: age (getAllByAgeGroup, hardcoded buckets,All→nulls+"All"), gender (getAllByGender), language (getCountsByPreferredLanguage), sexual-orientation (getAllBySexualOrientation).dayBoundary(localDate(v.startDate), 'start'|'end')), state=stateName, undefined keys dropped, 500 → "No data found".Date policy (byte-faithful to old
maxStartDate/endDateChange)[max]).Review fixes included in this PR (from the high-effort code review)
zValueChangefires before the CVA writes the FormControl — every cascading handler now reads the emitted$eventvalue instead ofform.controls.X.value(was reading the previous selection: first pick loaded nothing, second pick loaded the prior selection's children). Same root-cause fix landed on the allocation selects in feat(supervisor): phase 7d — outbound allocation and reallocation suite (generic, grievance, everwell) #11 and the call-flow selects in feat(outbound): phase 7c — outbound worklist hub, dial hand-offs and outbound call loop #10.spanDays > 30so a start exactly 31 days before yesterday no longer produces a 32-day window.[max]now tightened to start+30 after a cap (was left at yesterday, letting a manual re-pick exceed the window).[max]doesn't feed reactive-form validity (unlike the old md2-datepicker) — addedreportDatesValidatorso a typed out-of-range date disables Download.ngOnInit(old caller-age-report hardcoded them) — the report is usable even ifgetRegistrationDataV1fails.getCallSubTypeleft it in the payload).getDistrictserrors alerted witherr.errorMessage(oldGetDistricts), no longer silently swallowed.saveBlobdefersrevokeObjectURL(FileSaver parity, avoids aborting the download); duplicated date/clamp logic pulled into shared helpers;callTypeGroupsis a signal + computed (zoneless guardrail).Verification (live,
1097Supervisor)getAllByAgeGroup200 → valid PK-magic .xlsx); payloads byte-faithful across all five report pages with real master data.ng buildclean, tsc clean, GPL header check passing.