= Domify
== Релациско мапирање
=== Ознаки
Примарните клучеви се означени со bold и underline '''__PK__'''
Надворешните клучеви се означени со '''FK*''' за кои во заграда '''()''' е напишана табелата која ја референцираат.
Задолжителните атрибути се '''болдирани.'''
=== Табели
1. User ('''__id__, first_name, last_name, email, password_hash, date_of_birth, rating, address_id*(Address)''', bio)
2. Property ('''__id__, title, description, created_at, owner_id*(User), property_type_id* (Property_Type), address_id *(Address)''')
3. Property_Type ('''__id__, name''')
4. Property_Image ('''__id__, image, property_id*(Property)''')
5. Unit ('''__id__, unit_number, floor, bedrooms, bathrooms, area_sq_m, rent_amount, property_id* (Property)''')
6. Listing ('''__id__, title, available_from, available_to, status, '''description''', unit_id* (Unit)''')
7. Lease ('''__id__, start_date, end_date, rent_amount, deposit_amount, listing_id* (Listing), tenant_id* (Tenant_Profile), landlord_id* (Landlord_Profile)''')
8. Payment ('''__id__, amount, status, payment_date, lease_id* (Lease), payment_method_id* (Payment_Method)''')
9. Payment_Method ('''__id__, name''')
10. Tenant_Profile ('''__id*__(User)''')
11. Landlord_Profile ('''__id*__(User), managed_properties_count, is_agent''')
12. Service_Request ('''__id__, decription, request_date, status, lease_id*(Lease), service_category_id * (Service_Category)''')
13. Service_Category ('''__id__, name''')
14. Maintenance_Log ('''__id__, description, maintenance_date, service_request_id * (Service_Request)''')
15. Inspection ('''__id__, inspection_date, notes, lease_id*(Lease), landlord_id*(Landlord_Profile)''')
16. Document ('''__id__, file_type, file_url, uploaded_at, user_id * (User), lease_id* (Lease)''')
17. Address ('''__id__, street, municipality, city, number, country''')
18. Message ('''__id__, sent_at, content, from_user_id*(User), to_user_id*(User), lease_id*(Lease)''')
19. Unit_Image ('''__id__, image, unit_id*(Unit)''')
20. Interested ('''__listing_id*, tenant_profile_id__*''')
=== DDL скрипта за бришење на табелите и креирање на табелите
[[html(kreiranje_na_tabeli.sql)]]
=== DML скрипта за полнење на табелите со податоци
[[html(vnesuvanje_podatoci.sql)]]
== Релациски дијаграм
[[Image(domify - diag.png)]]
== Историјат