Use Case Document - RentZen MVP - Section 3
 Share
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

 
$
%
123
 
 
 
 
 
 
 
 
 
ABCDEFGHIJKLMNOPQRSTUVWXY
1
0
2
To-Do
1. Start by reviewing Use Case Diagram Tasks
2. Then review the Schema diagram and consider each table. The need for additional tasks may become apparent.
3
4
ActionActorsPrimary EntitySQL EXAMPLECommentsTeam
5
loginPeoplelandlords, renterspeopleselect people_id from people
where username = 'ajones@email.com'
and password='ajones123' and role_id = 102
username is an email address
6
addPersonlandlords, renterspeopleinsert into people (username, password, role_id) values ('tommy@test.com','test123',101)Mimimal account creation. Add other features by updating a profile. This step should return the people_id that was created. That's important!
7
profileUpdateRenterrenterspeopleUPDATE people SET income = 75000 , credit_rating = 420, firstname = 'Thomas', lastname = 'Test', email = 'tommy@test.com', phone='2155551212' WHERE people_id = ?You need to know the people_id of the person you are updating. This step either succeeds or fails.
8
profileUpdateLandlordlandlordspeopleUPDATE people SET firstname = 'Sondra', lastname = 'Smith', email = 'sondra@test.com', phone='2155551313' WHERE people_id = ?Just like a renter, but without credit score or income. This action either succeeds or fails.
9
getPersonlandlords, renterspeopleselect * from people where people_id = ?Given an people_id retreive all there is to know about a person record. This action returns an array of data.
10
getStatespropertyselect state_name, state_id from state order by state_name
11
getPropertyTypesrenterspropertySELECT * FROM `property_type` order by typename
12
getPropertyStatusCodespropertySELECT `propstat_id`,`propertystat` FROM `property_status`
13
getFeaturespropertySELECT `feature_id`,`feature_name`,`description` FROM `feature`
14
getRentalAppStatusCodesrental_applicationsSELECT `app_status_id`,`app_status_name` FROM `rental_app_status`
15
getPeopleRolespeopleSELECT `role_id`,`role` FROM `people_role`
16
getPropertiesrentersproperty
SELECT * FROM property WHERE CITY like 'Philadelphia' AND RENTAL_FEE< 999999 AND PROPSTAT_ID = 403
This is for renters. Be sure to only list properties that are listed (i.e. available)
17
getCitiesrenterspropertySELECT distinct city FROM property order by cityGet a distinct list of cities that have been entered into the system
18
getZipsrenterspropertySELECT distinct zip FROM property order by zipGet a distinct list of zip codes that have been entered into the system
19
getLandlordPropertieslandlordspropertySELECT * FROM `people`, `landlord_property`, `property`, `property_status`
WHERE people.people_id = landlord_property.landlord_id
AND landlord_property.property_id = property.property_id
AND property.propstat_id = property_status.propstat_id
AND people.people_id = 903 ORDER BY property.property_id DESC
List all the properties for a given landlord id
20
addPropertylandlordspropertyINSERT INTO property (street, city, zip, beds, baths, sqft, income_requirement, credit_requirement, rental_fee, description) VALUES ('Jill Road', 'Rose', 19090, 2, 1, 9, 30000, 450, 300, 'great house') SELECT property_id FROM property WHERE street = 'Jill Road';Insert into the property table. Leave latitude, longitude, picture_url blank. This action will need to return the property id that was added.301
21
editPropertylandlordspropertyUPDATE property SET property_id='value-1' , street='value-2', city='value-3', state_id ='value-4', zip='value-5', beds ='value-6', baths ='value-7', sqft ='value-8', type_id ='value-9', propstat_id ='value-10', income_requirement ='value-11', credit_requirement ='value-12', rental_fee ='value-13', description ='value-14' WHERE property_id= ?Given a property id, update all the fields in the property table excluding latitude, longitude, and picture_url302
22
markPropertyListedlandlordspropertyUPDATE `property_status` SET `propertystat` = 'listed' WHERE `propstat_id`= ?
"Listing" a property means you are making it available to rent. Given a property id, update the property status accordingly.303
23
getPropertylandlords, renterspropertySELECT * FROM property WHERE property_id = ?Given a property id, get all the data available in the property record.304
24
markPropertyVacantlandlordspropertyupdate property set propstat_id= 401 where property_id= [what is given] Given a property id, update the property status accordingly.305
25
markPropertyOccupiedlandlordspropertyUPDATE property SET propstat_id = 402 WHERE property_id = ? Given a property id, update the property status accordingly.306
26
getPropertyFeatureslandlords, renterspropertySELECT features FROM propertyGet all the features asscociated with a property307
27
addPropertyFeatureslandlordspropertyINSERT INTO property_feature (propertyfeature_id, feature_id, property_id)
VALUES (3235, 201, 325);
Add a property feature to an existing property308
28
addApprentersrental_applicationsINSERT INTO rental_application (renter_id, property_id, last_status_id, move_in_date, move_out_date)
VALUES (901, 308, 4, 2018-5-17, 2019-5-17);
Add a rental application. 309
29
getRentalApps landlordsrental_applicationsSELECT * FROM rental_application WHERE last_status_id = 1;For a given landlord, return all applications which are "submitted"310
30
getRentalAppsRenterrentersrental_applicationsSELECT * FROM rental_application WHERE renter_id = "?";Get all applications submitted by me.311
31
getRentalApplandlords, rentersrental_applicationsselect *
from rental_application, property, people
where rental_application.renter_id = people.people_id AND
rental_application.property_id = property.property_id
AND rental_application.rental_application_id = ?
Get all the information about a rental app. Be sure to include the property and the renter making the request.
32
changeRentalAppStatuslandlordsrental_applicationsUPDATE rental_application SET last_status_id = ? where rental_application_id = ?Given a rental application id and a status code, change the rental application status.
33
addRenterProperyRecordlandlordsrenter_propertyinsert into renter_property (landlord_id, property_id) values (?,?)Create a new relationship between renter and property.
34
deleteRenterPropertylandordsrenter_propertydelete from renter_property where renterproperty_id = ?Remove a relationship between renter and property
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Loading...