Skip to content

Conversation

@Rabi94
Copy link
Collaborator

@Rabi94 Rabi94 commented Dec 23, 2025

This PR introduces V1 Referrals as a first-class, standalone domain, implemented end-to-end across the backend and frontend. The work establishes referrals as independent from cases while remaining fully aligned with the existing event-sourced architecture and frontend data patterns.

Backend

  • A new event-sourced V1 Referrals aggregate was introduced, including referral state, events, commands, and resource wiring.
  • Referrals are persisted and rehydrated exclusively from their event streams, ensuring auditability and consistency with existing aggregates.
  • Referrals were intentionally kept separate from CombinedFamilyInfo. While a referral may reference a family, it is not owned by a family in the same way cases are. This reduces coupling and supports global intake, pre-assignment.
  • A dedicated API endpoint was added to return all referrals (assigned and unassigned), allowing filtering to remain a frontend concern.
  • Full DI and startup wiring was completed so referral commands flow through the same atomic records pipeline as other aggregates.
  • The GeneratedClient was regenerated, producing typed referral DTOs, enums, and client methods required by the frontend.

Frontend

  • A proper Recoil-based referrals model was implemented, including a query for loading referrals and command callbacks for write operations.
  • ReferralDetailsPage to display the referral info
  • V1Referrals page a table to display a table of the referrals ReferralRow, ReferralsFilter etc
  • The Add New Referral drawer was fully wired to backend commands, supports referrals with unknown families, validates all required fields, and submits persisted data end-to-end.

Copy link
Collaborator

@PabloDinella PabloDinella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

The only changes I would make here for now are:

  1. Don't create a new controller for referrals. Referrals are part of the Records concept. Records is everything related to the data that an organization owns.
  2. Use react-hook-form for managing the form state and validation (maybe install zod for validation), that will help keeping the code more concise and consistent

@Rabi94 Rabi94 requested a review from PabloDinella January 8, 2026 18:06
@Rabi94 Rabi94 marked this pull request as ready for review January 17, 2026 19:49
@Rabi94 Rabi94 requested a review from LarsKemmann January 17, 2026 19:49
@Rabi94 Rabi94 requested a review from LarsKemmann January 23, 2026 15:50
@LarsKemmann LarsKemmann dismissed PabloDinella’s stale review January 27, 2026 15:50

I'm taking over reviewing this PR for Pablo.

@Rabi94 Rabi94 requested a review from LarsKemmann January 28, 2026 12:16
@Rabi94 Rabi94 requested a review from LarsKemmann February 2, 2026 18:19
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.

3 participants