wiki:UseCase02

Version 1 (modified by 181201, 4 hours ago) ( diff )

--

Use-case 0002 - Sign up

Initiating actor: Guest

Other actors: None

Description: A new guest wants to use the platform to find a sitter or offer services. They must register an account first. The system creates the main user record and links it to the specific role table (in this example Pet Owner) using a secure transaction.

Scenario:

  1. Guest clicks on the "Sign up" button.
  2. Guest fills out their personal details and selects the "I am a Pet Owner" role.
  3. Guest submits the form.
  4. System creates the new user account and links it to the Pet Owner subtype table:
    BEGIN;
    
    WITH new_user AS (
        INSERT INTO users (username, first_name, last_name, password, email) 
        VALUES (
            'owner_nov', 
            'Mona', 
            'Monevska', 
            '$2a$10$hashed_pw_mona', 
            'mona@email.com'
        )
        RETURNING user_id
    )
    INSERT INTO pet_owners (user_id)
    SELECT user_id FROM new_user;
    
    COMMIT;
    
  5. System redirects the new user to the home page.
Note: See TracWiki for help on using the wiki.