-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Context: Creating a new clinic involves creating the Clinic record AND the first Admin user. This must happen in a single database transaction to prevent orphaned data.
Location: apps/api/src/modules/clinics/onboarding.controller.ts
Requirements:
- Create
POST /clinics/register. - Accept payload: Clinic Name, Admin Email, Admin Password.
- Use a Mongoose Transaction (Session) to insert the Clinic, retrieve its
_id, and insert the User with roleCLINIC_ADMINtied to thatclinicId.
Acceptance Criteria:
- If user creation fails, the clinic creation rolls back (database transaction works).
- Registration returns a valid JWT to auto-login the new admin.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels