| | 1 | Use-case 0001 - User Registration |
| | 2 | |
| | 3 | Initiating actor: |
| | 4 | Guest (Unauthenticated visitor) |
| | 5 | |
| | 6 | Other actors: |
| | 7 | None |
| | 8 | |
| | 9 | Description: |
| | 10 | The guest creates a new account in the system by providing personal information (name, email, phone, gender, birthday). The system validates that the email is unique and saves the user in the database. |
| | 11 | |
| | 12 | Scenario: |
| | 13 | |
| | 14 | User opens the registration page. |
| | 15 | |
| | 16 | System displays the registration form with fields: first name, last name, email, phone number, gender, birthday. |
| | 17 | |
| | 18 | User fills the form and submits. |
| | 19 | |
| | 20 | System validates that the email is not already used. |
| | 21 | |
| | 22 | {{{ |
| | 23 | SET search_path TO project; |
| | 24 | |
| | 25 | SELECT user_id |
| | 26 | FROM "user" |
| | 27 | WHERE email = :email; |
| | 28 | }}} |
| | 29 | |
| | 30 | If the email is unique, the system creates a new account. |
| | 31 | |
| | 32 | {{{ |
| | 33 | SET search_path TO project; |
| | 34 | |
| | 35 | INSERT INTO "user"(first_name, last_name, email, phone_number, gender, birthday) |
| | 36 | VALUES (:first_name, :last_name, :email, :phone_number, :gender, :birthday) |
| | 37 | RETURNING user_id; |
| | 38 | }}} |
| | 39 | |
| | 40 | System confirms successful registration and shows the login page. |