wiki:UseCase03Implementation

Version 2 (modified by 181201, 7 days ago) ( diff )

--

Use-case 0003 Implementation - Add a Pet

Initiating actor: Pet Owner

Other actors: None

Description: A pet owner wants to add a new animal to their profile so they can request services for it. The system provides available pet categories for them to choose from, and then saves the new pet profile into the database.

Scenario:

  1. Pet Owner opens the "My Pets" page and clicks "Add new pet".

Hibernate: 
    select
        p1_0.pet_id,
        p1_0.age,
        p1_0.description,
        p1_0.name,
        p1_0.owner_id,
        p1_0.pettype_id,
        p1_0.photo,
        p1_0.special_needs 
    from
        project.pets p1_0 
    left join
        project.pet_owners o1_0 
            on o1_0.user_id=p1_0.owner_id 
    where
        o1_0.user_id=?
Hibernate: 
    select
        po1_0.user_id,
        po1_1.email,
        po1_1.first_name,
        po1_1.last_name,
        po1_1.password,
        po1_1.username 
    from
        project.pet_owners po1_0 
    join
        project.users po1_1 
            on po1_0.user_id=po1_1.user_id 
    where
        po1_0.user_id=?
Hibernate: 
    select
        pt1_0.pettype_id,
        pt1_0.needs_outdoor_walk,
        pt1_0.species 
    from
        project.pet_types pt1_0 
    where
        pt1_0.pettype_id=?
Hibernate: 
    select
        pt1_0.pettype_id,
        pt1_0.needs_outdoor_walk,
        pt1_0.species 
    from
        project.pet_types pt1_0 
    where
        pt1_0.pettype_id=?

  1. System fetches all available pet species so the user can select one from a dropdown menu:
  2. Owner selects "Dog", fills in the pet's name, age, and needs, and submits the form.

  1. System creates the pet record in the database, linking it to the owner
Hibernate: 
    select
        po1_0.user_id,
        po1_1.email,
        po1_1.first_name,
        po1_1.last_name,
        po1_1.password,
        po1_1.username 
    from
        project.pet_owners po1_0 
    join
        project.users po1_1 
            on po1_0.user_id=po1_1.user_id 
    where
        po1_0.user_id=?
Hibernate: 
    select
        pt1_0.pettype_id,
        pt1_0.needs_outdoor_walk,
        pt1_0.species 
    from
        project.pet_types pt1_0 
    where
        pt1_0.pettype_id=?
Hibernate: 
    insert 
    into
        project.pets
        (age, description, name, owner_id, pettype_id, photo, special_needs, pet_id) 
    values
        (?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: 
    select
        p1_0.pet_id,
        p1_0.age,
        p1_0.description,
        p1_0.name,
        p1_0.owner_id,
        p1_0.pettype_id,
        p1_0.photo,
        p1_0.special_needs 
    from
        project.pets p1_0 
    left join
        project.pet_owners o1_0 
            on o1_0.user_id=p1_0.owner_id 
    where
        o1_0.user_id=?
Hibernate: 
    select
        po1_0.user_id,
        po1_1.email,
        po1_1.first_name,
        po1_1.last_name,
        po1_1.password,
        po1_1.username 
    from
        project.pet_owners po1_0 
    join
        project.users po1_1 
            on po1_0.user_id=po1_1.user_id 
    where
        po1_0.user_id=?
Hibernate: 
    select
        pt1_0.pettype_id,
        pt1_0.needs_outdoor_walk,
        pt1_0.species 
    from
        project.pet_types pt1_0 
    where
        pt1_0.pettype_id=?
Hibernate: 
    select
        pt1_0.pettype_id,
        pt1_0.needs_outdoor_walk,
        pt1_0.species 
    from
        project.pet_types pt1_0 
    where
        pt1_0.pettype_id=?
Hibernate: 
    select
        pt1_0.pettype_id,
        pt1_0.needs_outdoor_walk,
        pt1_0.species 
    from
        project.pet_types pt1_0 
    where
        pt1_0.pettype_id=?

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.