Changes between Initial Version and Version 1 of UseCase02


Ignore:
Timestamp:
05/08/26 02:55:10 (5 hours ago)
Author:
181201
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase02

    v1 v1  
     1== Use-case 0002 - Sign up
     2'''Initiating actor:''' Guest
     3
     4'''Other actors:''' None
     5
     6'''Description:'''
     7A 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.
     8
     9'''Scenario:'''
     10 1. Guest clicks on the "Sign up" button.
     11 2. Guest fills out their personal details and selects the "I am a Pet Owner" role.
     12 3. Guest submits the form.
     13 4. System creates the new user account and links it to the Pet Owner subtype table:
     14{{{
     15#!sql
     16BEGIN;
     17
     18WITH new_user AS (
     19    INSERT INTO users (username, first_name, last_name, password, email)
     20    VALUES (
     21        'owner_nov',
     22        'Mona',
     23        'Monevska',
     24        '$2a$10$hashed_pw_mona',
     25        'mona@email.com'
     26    )
     27    RETURNING user_id
     28)
     29INSERT INTO pet_owners (user_id)
     30SELECT user_id FROM new_user;
     31
     32COMMIT;
     33}}}
     34 5. System redirects the new user to the home page.