Fix receptionist registration wizard — full rewrite of broken business logic
Problems fixed:
- MissingRulesException crash on step 4 (empty rules passed to validate())
- Guardian was never actually created as Person + Guardian record
- Guardian was never linked to participant via guardian_participant pivot
- Enrollment in program never happened (service didn't handle program_id)
- medical_notes was passed at wrong level (it's on people table, not participants)
- relation 'guardian' missing from validation (exists in DB CHECK constraint)
Now the wizard properly:
1. Creates guardian Person + Guardian record (or reuses existing)
2. Creates participant Person record with all fields (phone, national_id, medical_notes)
3. Creates Participant via ParticipantService with guardian linked
4. Attaches guardian via guardian_participant pivot
5. Enrolls in program via EnrollmentService (auto-finds/creates group)
6. Added participant phone + national_id fields to step 2
Co-Authored-By:
Claude Opus 4.6 <noreply@anthropic.com>
Showing
This diff is collapsed.
Please register or sign in to comment