Skip to content

feat(supervisor): phase 7d — outbound allocation and reallocation suite (generic, grievance, everwell) - #11

Open
Madhav2402 wants to merge 3 commits into
feat/phase7c-outbound-worklistfrom
feat/phase7d-allocation
Open

feat(supervisor): phase 7d — outbound allocation and reallocation suite (generic, grievance, everwell)#11
Madhav2402 wants to merge 3 commits into
feat/phase7c-outbound-worklistfrom
feat/phase7d-allocation

Conversation

@Madhav2402

Copy link
Copy Markdown
Contributor

📋 Description


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

What's in this PR

AllocationApiService (flavor-driven, bodies byte-faithful)

  • Generic: call/outboundCallCount / outboundCallList (is1097:true) / outboundAllocation {roleID, userID[], allocateNo, outboundCallRequests} / resetOutboundCall {outboundCallReqIDs}
  • Grievance: unallocatedGrievanceCount, allocatedGrievanceRecordsCount, allocateGrievances/reallocateGrievances {startDate, endDate, providerServiceMapId, language, fromUserId, roleID, touserID[], allocateNo}, moveToBin {…, noOfCalls, is1097}
  • Everwell: everwellCall/* with the providerServiceMapId/agentId casing, bin by {eapiIds}
  • dayBoundary() reproduces the old timezone-shifted day-window strings (T00:00:00.000Z / T23:59:59.000Z / T23:59:59.999Z); localDate() parses picker values as local midnight (the old md2 pickers produced local Dates)

One shared AllocateRecordsComponent (replaces the old app's three clones)

  • Role → agents (multi-select, language-filtered like the old allocation fetch; the excluded source agent filtered by name in reallocation) → even split across agents → flavor-specific allocate POST
  • Flavor-faithful quirks kept: grievance resets an out-of-range allocateNo to 0 (old validate); generic clears below 1 / clamps to the pool; everwell has no upper clamp before an agent is selected (the old everwell read its count off the response envelope, leaving it undefined) but clamps to the per-agent share after selection; grievance prefills on ROLE change; generic/grievance error alerts show the bare HTTP status, everwell shows the error message (old handlers)
  • The grievance allocate posts the raw picker date instants (old onCreate payload), not the count-query boundaries

Allocation parent (cases 12 / 29 / 26)

  • Default window today → today+7 with the old boundary strings; date + language filters; per-language count table; Allocate per non-All row (disabled at 0)
  • Post-allocation refresh refetches without the language filter (old child emitted no language)

Reallocation parent (cases 13 / 30 / 27)

  • Role → agent → per-language counts; Reallocate (child with the source agent excluded) + Move to Bin (grievance bins directly with noOfCalls; generic/everwell fetch the agent's records then reset by outboundCallReqIDs/eapiIds)
  • No date filters — the old pickers were display:none dead UI on every flavor and never posted
  • The old reallocation agents fetch carried no language filter (asymmetric vs allocation) — kept

Declared deviations (frontend-only)

  1. Deselecting all agents resets allocateNo to the full pool (the old grievance branch); the old generic/everwell divided by zero there (allocateNo = Infinity) — not replicated (the form is unsubmittable without agents either way)
  2. localDate()/local default dates fix UTC/local day-shift artifacts the old local-Date pickers never had (rendering + query-window correctness for non-IST timezones; identical strings in IST)

Verification (live against UAT, 1097Supervisor)

  • All six menu pages mount; count payloads byte-exact for all three flavors (incl. the default-window strings and everwell casing)
  • Reallocation chain with real data: role → agents → per-language counts; All-only rows correctly hide actions
  • Child with real fetches: language-filtered agents (2 of 4 matched Hindi), record-list payload in the old child's exact date format
  • Flavor clamp rules re-verified in-browser post-review: grievance 500→0 / 0→0 with prefill-on-role; generic 500→20 / 0→clear; everwell 500 unclamped pre-selection
  • ng build clean, tsc clean, GPL header check passing

ℹ️ Additional Information

  • The Allocate / Move-to-Bin buttons were deliberately NOT exercised against UAT (they would assign or unassign real worklist records); the allocate payloads are code-verified against the old sources, and a live write test is planned with disposable test data / the mentor demo.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 22ea5c12-854c-427d-ad8b-a85d8e26dd95

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant