Repository navigation
User Stories
User Story
As a visitor, I want to register as a patient by providing my personal, identification, contact, health, and account information so that I can securely access SaludVital's patient services.
- The
first_namesfield must be required. - The field must accept text with a maximum length of 50 characters.
- The system must reject empty values and values containing only whitespace.
- The system must reject values exceeding 50 characters.
- The
last_namesfield must be required. - The field must accept text with a maximum length of 50 characters.
- The system must reject empty values and values containing only whitespace.
- The system must reject values exceeding 50 characters.
- The
phone_numberfield must be required. - The field must accept a phone number with a maximum length of 15 characters.
- The system must validate the phone number against the supported phone-number format.
- The same phone number must be allowed in multiple patient accounts.
- The system must reject values exceeding 15 characters or values that do not comply with the supported format.
- The
date_of_birthfield must be required. - The field must use a date input control.
- The system must accept only valid calendar dates.
- The system must reject dates later than the current date.
- The
document_typefield must be required. - The field must use a single-selection dropdown.
- The dropdown must offer only the following options:
-
CC— Cédula de Ciudadanía. -
CE— Cédula de Extranjería.
-
- The system must reject document types outside the supported options.
- The
document_numberfield must be required. - The field must accept a maximum of 15 characters.
- The corresponding database field must use
VARCHAR(15). - The system must reject empty values, values containing only whitespace, and values exceeding 15 characters.
- The document number must comply with the validation rules for the selected document type.
- The combination of document type and document number must not already belong to another patient account.
- The
departmentfield must be required. - The field must use a single-selection dropdown populated with supported departments.
- The system must reject values that do not correspond to valid department options.
- The
municipalityfield must be required. - The field must use a single-selection dropdown populated with municipalities belonging to the selected department.
- The municipality dropdown must remain disabled or unavailable until a department is selected.
- When the user selects a department, the system must display only the municipalities associated with that department.
- When the department changes, the system must clear any previously selected municipality that is no longer valid.
- The system must validate the department-municipality relationship on the server before creating the account.
- The
addressfield must be optional. - The field must accept text with a maximum length of 150 characters.
- The corresponding database field must support a maximum length of 150 characters, using
VARCHAR(150)where appropriate. - The system must reject values exceeding 150 characters.
- Leaving the field empty must not prevent registration.
- The
blood_typefield must be optional. - The field must use a single-selection dropdown.
- The dropdown must offer the eight standard blood types: A+, A-, B+, B-, AB+, AB-, O+, and O-.
- The system must reject unsupported blood-type values.
- Leaving the field empty must not prevent registration.
- The
allergiesfield must be optional. - The field must allow the patient to enter free-form text.
- The field must accept a maximum of 255 characters.
- The corresponding database field must support a maximum length of 255 characters, using
VARCHAR(255)where appropriate. - The system must reject values exceeding 255 characters.
- Leaving the field empty must not prevent registration.
- The
existing_conditionsfield must be optional. - The field must allow the patient to enter free-form text describing existing medical conditions.
- The field must accept a maximum of 255 characters.
- The corresponding database field must support a maximum length of 255 characters, using
VARCHAR(255)where appropriate. - The system must reject values exceeding 255 characters.
- Leaving the field empty must not prevent registration.
- The
emailfield must be required. - The field must accept a maximum of 100 characters.
- The corresponding database field must support a maximum length of 100 characters.
- The system must validate the email address format.
- The system must reject email addresses exceeding 100 characters.
- An email address already associated with an account must not be accepted for a new registration.
- The
passwordfield must be required. - The password must contain at least 10 characters.
- The password must contain at least one uppercase letter.
- The password must contain at least three lowercase letters.
- The password must contain at least one numeric digit.
- The password must contain at least one special character.
- The system must reject passwords that fail any of these requirements.
- The system must provide clear feedback about the password requirements.
- The password must never be stored as plain text.
- The
confirm_passwordfield must be required. - The confirmation field must enforce the same password requirements as the
passwordfield. - The
confirm_passwordvalue must match thepasswordvalue exactly. - The system must reject registration when the values do not match.
- The system must not store the confirmation password as a separate credential.
- The form must clearly distinguish required fields from optional fields.
- The system must validate submitted values on both the client and server sides.
- Client-side validation must not replace server-side validation.
- The system must display clear and specific validation messages for missing, invalid, or oversized values.
- If validation fails, the system must not create the patient account.
- The system should preserve valid form values when displaying validation errors, except for password fields when security requires clearing them.
- The system must create the patient account only after all required fields and applicable validation rules pass.
- Optional fields left empty must be stored consistently according to the database design.
- After successful registration, the system must display a confirmation message and provide a clear next step for signing in.
- The system must protect personal and health information against unauthorized access.
- The system must enforce document and email uniqueness rules at the database level where supported, preventing duplicate accounts during concurrent registration attempts.
User Story
As a registered Patient, Doctor, or Administrator, I want to log in securely so that I can access the features authorized for my role.
Acceptance Criteria
- The system must provide a login form for registered users.
- The user must provide the required credentials to submit the form.
- The system must validate the credentials against the registered account.
- If the credentials are incorrect, the system must deny access and display a generic error message that does not reveal whether the account or password was incorrect.
- The system must not establish an authenticated session when authentication fails.
- When authentication succeeds, the system must establish an authenticated session using the application's approved authentication mechanism.
- The system must identify the authenticated user's assigned role.
- After successful login, the system must redirect the user to the dashboard corresponding to their role: Patient, Doctor, or Administrator.
- The system must not allow the user to choose a role in the login form to gain permissions they have not been assigned.
- The system must initialize the inactivity timeout policy when the authenticated session begins.
- The system must not expose passwords, authentication secrets, or sensitive token values in error messages or application logs.
User Story
As a registered user who has forgotten my password, I want to recover access to my account so that I can sign in again securely.
Acceptance Criteria
- The login page must provide an option to initiate password recovery.
- The system must allow the user to submit the account identifier required by the recovery process.
- The system must display a generic confirmation that does not disclose whether an account exists for the submitted identifier.
- The system must use a secure, time-limited recovery mechanism to authorize a password change.
- Recovery credentials must be unique, unpredictable, and invalidated after use or expiration.
- The system must reject expired, invalid, or previously used recovery credentials.
- The new password must satisfy the application's password requirements.
- The system must request confirmation of the new password and reject the change if the values do not match.
- The system must store the new password securely and must never store it as plain text.
- The system must confirm when the password has been changed successfully.
- The system must not change the password when any required validation fails.
- After recovery, the user must authenticate using the new password.
- The system must handle recovery failures without revealing sensitive account information.
User Story
As an authenticated Patient, Doctor, or Administrator, I want to log out securely or have my session close automatically after inactivity so that my account and personal information remain protected.
Acceptance Criteria
- The system must provide an explicit logout option to authenticated users.
- When the user selects logout, the system must end the authenticated session according to the application's session-management policy.
- The system must clear the client's authentication state and remove locally stored authentication credentials where applicable.
- After logout, the system must redirect the user to the login page or another designated public page.
- The system must prevent access to protected pages and resources after logout unless the user authenticates again.
- The system must automatically log out the user after 3 consecutive minutes (180 seconds) without qualifying activity.
- The inactivity timeout must apply equally to Patients, Doctors, and Administrators.
- Qualifying user activity must reset the inactivity timer according to the defined session policy.
- Background polling, automatic refreshes, and other system-generated requests must not count as user activity unless explicitly defined by the session policy.
- When the inactivity limit is reached, the system must clear the client's authentication state and redirect the user to the login page.
- A user must not be able to regain access to protected resources simply by navigating backward in the browser after logout or session expiration.
- Logout and automatic expiration must not expose authentication credentials or sensitive personal information.
- The system must provide a clear message when the session expires due to inactivity.
User Story
As an authenticated user, I want the system to enforce permissions according to my assigned role so that I can access only the features and information authorized for me.
Acceptance Criteria
- The system must recognize the roles Patient, Doctor, and Administrator.
- Each protected feature must require authentication before access is granted.
- The system must verify the user's permissions on the server for every protected operation.
- Patients must not access doctor-only or administrator-only operations unless explicitly authorized by a separate permission.
- Doctors must not access administrator-only operations unless explicitly authorized by a separate permission.
- Administrators must access only the operations permitted by the administrator role and the application's authorization rules.
- Hiding a menu item or button in the interface must not be considered sufficient authorization.
- If an authenticated user attempts an unauthorized operation, the system must deny the request without exposing protected data.
- The system must return or display an appropriate unauthorized or forbidden response according to whether authentication or permission is missing.
- Changing client-side values, URLs, or submitted role information must not grant additional permissions.
- The system must apply the same authorization rules to browser requests and direct requests to protected endpoints.
User Story
As a user of SaludVital, I want the system to validate my authentication session continuously so that expired, invalid, or inactive sessions cannot be used to access protected resources.
Acceptance Criteria
- The system must validate authentication credentials or tokens before granting access to protected server resources.
- The system must reject expired, invalid, malformed, or incorrectly signed authentication tokens.
- The system must enforce the 3-minute inactivity limit for Patients, Doctors, and Administrators.
- The inactivity policy must be enforced consistently by the client and the server; client-side timers alone must not be sufficient.
- Qualifying user activity must update the session's last-activity state through the approved session-management mechanism.
- The system must ensure that automatic requests or background activity do not unintentionally keep an inactive session alive.
- When 3 minutes of inactivity have elapsed, the server must reject further protected requests from that session.
- The authentication mechanism must enforce expiration in a way that remains consistent with the inactivity policy, including any required token renewal or server-side session tracking.
- After expiration, the client must clear its authentication state and redirect the user to the login page.
- Requests made with an expired or invalid session must not return protected data or perform protected actions.
- A user must authenticate again before accessing protected resources after session expiration.
- The system must not trust client-provided role, expiration, or last-activity values without appropriate server-side validation.
- Authentication failures must be handled without exposing token contents, secrets, or sensitive implementation details.
- The system must preserve consistent authentication behavior across the Patient, Doctor, and Administrator areas.
User Story
As an authenticated Patient, I want to access my patient dashboard so that I can use the services available to my account.
Acceptance Criteria
- After successful login, a Patient must be redirected to the patient dashboard.
- The dashboard must be accessible only to authenticated users with the Patient role.
- The system must display the patient-facing interface and the features authorized for that role.
- The dashboard must not expose another patient's private information.
- If a Patient attempts to access a doctor-only or administrator-only resource, the system must deny access.
- If the Patient's session is logged out or expires, the system must deny further access to protected dashboard resources.
- After session expiration, the system must redirect the Patient to the login page.
- The dashboard must display an appropriate error or feedback message when required information cannot be loaded.
- Reloading or directly opening a protected dashboard URL must not bypass authentication or authorization.
User Story
As an authenticated Doctor, I want to access my doctor dashboard so that I can use the clinical and appointment-management features authorized for my account.
Acceptance Criteria
- After successful login, a Doctor must be redirected to the doctor dashboard.
- The dashboard must be accessible only to authenticated users with the Doctor role.
- The system must display the doctor-facing interface and the features authorized for that role.
- The Doctor must access only patient and appointment information permitted by the application's authorization rules.
- The Doctor must not access administrator-only resources unless explicitly authorized.
- If a Doctor attempts to access a protected resource without the required permission, the system must deny access.
- If the Doctor's session is logged out or expires, the system must deny further access to protected dashboard resources.
- After session expiration, the system must redirect the Doctor to the login page.
- The dashboard must display appropriate feedback when required information cannot be loaded.
- Reloading or directly opening a protected dashboard URL must not bypass authentication or authorization.
User Story
As an authenticated Administrator, I want to access the administrator dashboard so that I can manage the system using the permissions assigned to my role.
Acceptance Criteria
- After successful login, an Administrator must be redirected to the administrator dashboard.
- The dashboard must be accessible only to authenticated users with the Administrator role.
- The system must display the administrative features authorized for that role.
- The system must validate administrator permissions on the server before performing protected operations.
- Patients and Doctors must not access administrator-only resources.
- Modifying client-side data or directly entering an administrator URL must not grant administrator permissions.
- If the Administrator's session is logged out or expires, the system must deny further access to protected dashboard resources.
- After session expiration, the system must redirect the Administrator to the login page.
- The dashboard must display appropriate feedback when required information cannot be loaded.
- Reloading or directly opening a protected dashboard URL must not bypass authentication or authorization.
- Administrative actions must be performed only when the authenticated user has the required permissions.