| | 1 | = Use-case 0010 Implementation - Browse Properties |
| | 2 | |
| | 3 | '''Initiating actor:''' Client |
| | 4 | |
| | 5 | '''Other actors:''' None |
| | 6 | |
| | 7 | '''Description: ''' |
| | 8 | |
| | 9 | A client browses apartment units by first selecting a building, then viewing its floors, and finally exploring individual units. They can view details, images, and pricing information for each unit. |
| | 10 | |
| | 11 | == Scenario |
| | 12 | |
| | 13 | === Step 1 |
| | 14 | |
| | 15 | '''User action:''' Client accesses the property listing page. |
| | 16 | |
| | 17 | '''Screenshot:''' [[Image(0010-1.png)]] |
| | 18 | |
| | 19 | '''System action: ''' System displays all buildings. |
| | 20 | |
| | 21 | '''Query: ''' |
| | 22 | {{{ |
| | 23 | SET search_path TO project; |
| | 24 | |
| | 25 | SELECT |
| | 26 | building_id, |
| | 27 | name, |
| | 28 | address, |
| | 29 | description |
| | 30 | FROM building |
| | 31 | ORDER BY name; |
| | 32 | }}} |
| | 33 | |
| | 34 | '''Screenshot: ''' [[Image(0010-2.png)]] |
| | 35 | |
| | 36 | === Step 2 |
| | 37 | |
| | 38 | '''User action:''' Client clicks on "Golden Tower" building. |
| | 39 | |
| | 40 | '''Screenshot:''' [[Image(0010-3.png)]] |
| | 41 | |
| | 42 | '''System action:''' System displays the building details and all its floors. |
| | 43 | |
| | 44 | '''Query:''' |
| | 45 | {{{ |
| | 46 | SET search_path TO project; |
| | 47 | |
| | 48 | SELECT |
| | 49 | b.building_id, |
| | 50 | b.name AS building_name, |
| | 51 | b. address, |
| | 52 | b.description, |
| | 53 | a. full_name AS architect_name, |
| | 54 | f.floor_id, |
| | 55 | f.floor_number, |
| | 56 | f.layout_image |
| | 57 | FROM building b |
| | 58 | LEFT JOIN designs d ON b.building_id = d.building_id |
| | 59 | LEFT JOIN architect a ON d.architect_id = a.architect_id |
| | 60 | JOIN floor f ON b.building_id = f.building_id |
| | 61 | WHERE b.name = 'Golden Tower' |
| | 62 | ORDER BY f.floor_number; |
| | 63 | }}} |
| | 64 | |
| | 65 | '''Screenshot: ''' [[Image(0010-4.png)]] |
| | 66 | |
| | 67 | === Step 3 |
| | 68 | |
| | 69 | '''User action:''' Client clicks on "Floor 2". |
| | 70 | |
| | 71 | '''Screenshot:''' [[Image(0010-5.png)]] |
| | 72 | |
| | 73 | '''System action:''' System displays all units on Floor 2. |
| | 74 | |
| | 75 | '''Query:''' |
| | 76 | {{{ |
| | 77 | SET search_path TO project; |
| | 78 | |
| | 79 | SELECT |
| | 80 | u.unit_id, |
| | 81 | u.unit_number, |
| | 82 | u.room_number, |
| | 83 | u.floor_area, |
| | 84 | u.price, |
| | 85 | u.status, |
| | 86 | u.image |
| | 87 | FROM unit u |
| | 88 | WHERE u.floor_id = ( |
| | 89 | SELECT floor_id |
| | 90 | FROM floor |
| | 91 | WHERE building_id = (SELECT building_id FROM building WHERE name = 'Golden Tower') |
| | 92 | AND floor_number = 2 |
| | 93 | ) |
| | 94 | ORDER BY u.unit_number; |
| | 95 | }}} |
| | 96 | |
| | 97 | '''Screenshot:''' [[Image(0010-6.png)]] |
| | 98 | |
| | 99 | === Step 4 |
| | 100 | |
| | 101 | '''User action:''' Client clicks on "Unit 201" to view full details. |
| | 102 | |
| | 103 | '''Screenshot:''' [[Image(0010-7.png)]] |
| | 104 | |
| | 105 | '''System action:''' System displays complete unit information. |
| | 106 | |
| | 107 | '''Query:''' |
| | 108 | {{{ |
| | 109 | SET search_path TO project; |
| | 110 | |
| | 111 | SELECT |
| | 112 | u. unit_id, |
| | 113 | u. unit_number, |
| | 114 | u. room_number, |
| | 115 | u. floor_area, |
| | 116 | u. price, |
| | 117 | u.status, |
| | 118 | u.image, |
| | 119 | u.floorplan, |
| | 120 | u.vector_image, |
| | 121 | f.floor_id, |
| | 122 | f.floor_number, |
| | 123 | b.building_id, |
| | 124 | b.name AS building_name |
| | 125 | FROM unit u |
| | 126 | JOIN floor f ON u.floor_id = f. floor_id |
| | 127 | JOIN building b ON f.building_id = b. building_id |
| | 128 | WHERE u.unit_number = '201' |
| | 129 | AND f.floor_number = 2 |
| | 130 | AND b.name = 'Golden Tower'; |
| | 131 | }}} |