Changes between Initial Version and Version 1 of UseCase0003


Ignore:
Timestamp:
01/07/26 22:33:32 (2 days ago)
Author:
213257
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase0003

    v1 v1  
     1== Use-case 0003 - Create Unit Listing ==
     2
     3'''Initiating actor:''' Admin
     4
     5'''Other actors:''' None
     6
     7'''Description:'''
     8
     9The admin adds new apartment units to the system after a floor has been created.  This includes entering all unit details such as unit number, room count, area, price, and uploading images. The unit becomes available for agents to show to clients.
     10
     11'''Scenario:'''
     12
     131. Admin logs in and navigates to building management.
     14
     152. System displays all buildings managed by this admin:
     16{{{
     17SELECT building_id, name, address, description
     18FROM building
     19WHERE admin_id = (SELECT admin_id FROM admin WHERE name = 'Nikola')
     20ORDER BY name;
     21}}}
     22
     233. Admin selects a building e.g. "Golden Tower" building.
     24
     254. System shows all floors in the selected building:
     26{{{
     27SELECT floor_id, floor_number, layout_image
     28FROM floor
     29WHERE building_id = (SELECT building_id FROM building WHERE name = 'Golden Tower')
     30ORDER BY floor_number;
     31}}}
     32
     335. Admin selects some floor e.g. Floor 1 and clicks to add a new unit within that floor.
     34
     356. System displays a form with fields: unit number, room number, floor area, price, status, images. In which the admin enters desired values
     36
     378. Admin submits the form.
     38
     399. System validates the data:
     40{{{
     41SELECT COUNT(*)
     42FROM unit
     43WHERE floor_id = (
     44    SELECT floor_id FROM floor
     45    WHERE building_id = (SELECT building_id FROM building WHERE name = 'Golden Tower')
     46    AND floor_number = 1
     47)
     48AND unit_number = '104';
     49}}}
     50
     5110. System inserts the new unit:
     52{{{
     53INSERT INTO unit(unit_number, room_number, floor_area, status, price, image, floorplan, vector_image, floor_id, admin_id)
     54VALUES (
     55    '104',
     56    2,
     57    82.50,
     58    'Available',
     59    95000.00,
     60    'unit_104.jpg',
     61    'plan_104.pdf',
     62    'vector_104.svg',
     63    (SELECT floor_id FROM floor
     64     WHERE building_id = (SELECT building_id FROM building WHERE name = 'Golden Tower')
     65     AND floor_number = 1),
     66    (SELECT admin_id FROM admin WHERE name = 'Nikola')
     67);
     68}}}
     69
     7011. System confirms successful creation and displays the unit details.