📋 UC02: Nurse Account
Use Case Uc02 Nurse Account Creation
USE CASE NAME: Caregiver (Nurse) Account Creation
PRIMARY ACTOR: Nurse (healthcare professional)
Business Objective
Allow a nurse to register on CareDeal to view care requests
from patients in their activity area and offer their services.
Preconditions
- The user has installed the CareDeal application
- The user has a valid mobile phone number
- The user has a valid INAMI number (Belgian healthcare professional ID)
- The user has an identity document (ID card or passport)
- The user does not already have an account with this phone number
NOMINAL SCENARIO (Happy Path)
1
Caregiver Role Selection
- The user launches the application
- The user selects "Caregiver" (or "I'm a caregiver")
2
Provider Type Selection
- The screen asks if the user is an individual or organization
- The user selects "Nurse" (individual)
3
INAMI Number Entry
- The screen requests the INAMI number
- The user enters their 11-digit INAMI number
- The system validates the number format
4
Profile Creation
- The profile creation screen displays
- The user enters:
- First name (required)
- Last name (required)
- Email (required, valid format)
- Accepted languages (at least one)
5
Activity Area Definition
- The area selection screen displays
- The user enters or selects their work address
- The system geolocates the address
- The initial activity radius is 3 km (free plan)
6
Identity Document Upload
- The screen requests ID card photos
- The user takes a photo or selects:
- The front of the ID card (required)
- The back of the ID card (required)
7
Phone Number Verification
- The phone verification screen displays
- The user enters their phone number (+32 by default)
- The system verifies the number is not already in use
- The system sends an SMS with a 6-digit code
8
SMS Code Confirmation
- The user receives the SMS
- The user enters the 6-digit code
- The system verifies the code with Firebase Auth
9
Validation and Account Creation
- The system creates the Firebase Auth account
- The system creates the Caregiver entity with:
- uuid: unique identifier
- name: "LastName FirstName"
- inamiNumber: INAMI number
- number: phone number
- email: email address
- languagesAcceptedISO: selected languages
- geolocation: GPS coordinates
- workingAddress: text address
- rangeOfActivity: 3 (km - free plan)
- imageIDRectoUrl: front URL
- imageIDVersoUrl: back URL
- status: "pendingVerification"
- credits: 0
- The system also creates the associated User entity
10
Welcome Screen
- The registration completion screen displays
- A message indicates the account is pending verification
- The nurse can access the application but cannot yet
view requests (status = pendingVerification)
ALTERNATIVE SCENARIOS / ERRORS
A1: Invalid INAMI number (Step 3)
- The number is not 11 digits
- Message: "INAMI number must contain exactly 11 digits"
- The user must correct the number
A2: Invalid email (Step 4)
- The email format is not valid
- Message: "Please enter a valid email address"
- The user must correct the email
A3: No language selected (Step 4)
- The user has not selected any language
- Message: "Please select at least one language"
- The user must select a language
A4: Address not found (Step 5)
- The entered address cannot be geolocated
- Message: "Address not found. Please try again."
- The user must correct the address
A5: Missing document (Step 6)
- The user has not provided both sides of the document
- Message: "Please provide both sides of the document"
- The user must complete the photos
A6: Phone number already used (Step 7)
- An account already exists with this number
- Message: "An account already exists with this number"
- Link to login offered
A7: Incorrect or expired SMS code (Step 8)
- See similar scenarios in UC01
On success:
- A Firebase Auth account is created
- A Caregiver entity is created with status "pendingVerification"
- A User entity is created with userRole = "caregiver"
- Documents are stored in Firebase Storage
- The nurse is authenticated but their account is pending validation
Account status:
- The account is created with StatusCaregiver.pendingVerification status
- The care-support team validates the account to change to "active"
- Validation delay: 24 to 48 hours (business days)
- While status is "pendingVerification", the nurse cannot:
- View care requests
- Contact patients
- Subscribe to a paid plan
Possible caregiver states (StatusCaregiver):
- pendingVerification: pending admin validation
- active: validated account, can practice
- inactive: temporarily deactivated account
- rejected: account refused by admin
- suspended: suspended account
Screen files:
- lib/modules/caregiver/presentation/screens/user_type_screen.dart
- lib/modules/caregiver/presentation/screens/inami_number_screen.dart
- lib/modules/caregiver/presentation/screens/caregiver_profile_creation_screen.dart
- lib/modules/caregiver/presentation/screens/area_of_activity_screen.dart
- lib/modules/caregiver/presentation/screens/upload_official_document_screen.dart
- lib/modules/caregiver/presentation/screens/phone_number_verification_screen.dart
- lib/modules/caregiver/presentation/screens/confirm_phone_number_verification_screen.dart
- lib/modules/caregiver/presentation/screens/end_form_screen.dart
Controllers:
- lib/modules/caregiver/presentation/controllers/registration_form_controller.dart
- lib/modules/caregiver/presentation/controllers/form_validation_controller.dart
- lib/modules/caregiver/presentation/controllers/document_upload_controller.dart
- lib/modules/caregiver/presentation/controllers/form_navigation_state.dart
Use Cases:
- lib/modules/caregiver/domain/usecases/create_caregiver_usecase.dart
- lib/modules/user/domain/usecases/create_user.dart
Entities:
- lib/modules/caregiver/domain/entities/caregiver_entity.dart
- lib/core/domain/entities/status_caregiver.dart
- lib/core/domain/entities/user_type.dart
Registration steps (RegistrationStep):
- userType
- inamiNumber
- profileCreation
- areaOfActivity
- documents
- phoneVerification
- confirmPhoneVerification
- welcome