fonrey-data-model.xml

This commit is contained in:
2026-04-24 15:07:15 +08:00
parent 75b9e25e68
commit f7e0d2b400
2 changed files with 804 additions and 16 deletions

View File

@@ -0,0 +1,774 @@
<mxfile host="app.diagrams.net" modified="2026-04-24" agent="OpenCode" version="21.0.0">
<diagram name="Fonrey ER Diagram" id="fonrey-er-v1">
<mxGraphModel dx="1422" dy="762" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="3300" pageHeight="2340" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- ═══════════════════════════════════════════════════ -->
<!-- SWIM LANE BACKGROUNDS -->
<!-- ═══════════════════════════════════════════════════ -->
<!-- ORG / HR region -->
<mxCell id="region-org" value="ORG / HR" style="swimlane;startSize=30;fillColor=#0d3349;strokeColor=#22d3ee;fontColor=#22d3ee;fontSize=12;fontStyle=1;swimlaneLine=1;rounded=1;arcSize=3;" vertex="1" parent="1">
<mxGeometry x="40" y="60" width="340" height="760" as="geometry"/>
</mxCell>
<!-- REGION & COMPLEX region -->
<mxCell id="region-complex" value="REGION & COMPLEX" style="swimlane;startSize=30;fillColor=#063b2f;strokeColor=#34d399;fontColor=#34d399;fontSize=12;fontStyle=1;swimlaneLine=1;rounded=1;arcSize=3;" vertex="1" parent="1">
<mxGeometry x="420" y="60" width="820" height="1380" as="geometry"/>
</mxCell>
<!-- PROPERTY region -->
<mxCell id="region-property" value="PROPERTY" style="swimlane;startSize=30;fillColor=#2d1a5e;strokeColor=#a78bfa;fontColor=#a78bfa;fontSize=12;fontStyle=1;swimlaneLine=1;rounded=1;arcSize=3;" vertex="1" parent="1">
<mxGeometry x="1280" y="60" width="900" height="1700" as="geometry"/>
</mxCell>
<!-- CLIENT region -->
<mxCell id="region-client" value="CLIENT" style="swimlane;startSize=30;fillColor=#3d1f06;strokeColor=#fbbf24;fontColor=#fbbf24;fontSize=12;fontStyle=1;swimlaneLine=1;rounded=1;arcSize=3;" vertex="1" parent="1">
<mxGeometry x="2220" y="60" width="860" height="1380" as="geometry"/>
</mxCell>
<!-- ═══════════════════════════════════════════════════ -->
<!-- ORG MODULE -->
<!-- ═══════════════════════════════════════════════════ -->
<!-- org_units -->
<mxCell id="org-units" value="<b>org_units</b>
<hr/>
🔑 PK id: uuid
parent_id: uuid (FK → self)
type: varchar(20)
name: varchar(100)
path: varchar(500) [物化路径]
depth: smallint
sort_order: int
is_active: bool
created_at: timestamptz
deleted_at: timestamptz" style="text;html=1;strokeColor=#22d3ee;fillColor=#0d3349;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-org">
<mxGeometry x="30" y="60" width="280" height="185" as="geometry"/>
</mxCell>
<!-- staff -->
<mxCell id="staff" value="<b>staff</b>
<hr/>
🔑 PK id: uuid
FK org_unit_id → org_units
name: varchar(50)
phone_enc: text [AES-256-GCM]
phone_hash: varchar(64) [SHA-256]
id_no_enc: text [AES]
user_id: uuid [FK → auth_user]
entry_date: date
status: active/resigned/...
is_active: bool
created_at: timestamptz
deleted_at: timestamptz" style="text;html=1;strokeColor=#22d3ee;fillColor=#0d3349;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-org">
<mxGeometry x="30" y="310" width="280" height="215" as="geometry"/>
</mxCell>
<!-- ═══════════════════════════════════════════════════ -->
<!-- REGION & COMPLEX MODULE -->
<!-- ═══════════════════════════════════════════════════ -->
<!-- districts -->
<mxCell id="districts" value="<b>districts</b>
<hr/>
🔑 PK id: uuid
city: varchar(50)
name: varchar(50)
short_name: varchar(20)
sort_order: int
is_active: bool
created_at: timestamptz" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="30" y="60" width="280" height="150" as="geometry"/>
</mxCell>
<!-- business_areas -->
<mxCell id="business-areas" value="<b>business_areas</b>
<hr/>
🔑 PK id: uuid
🔗 FK district_id → districts
name: varchar(100)
latitude: numeric(10,7)
longitude: numeric(10,7)
sort_order: int
is_active: bool" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="30" y="310" width="280" height="155" as="geometry"/>
</mxCell>
<!-- schools -->
<mxCell id="schools" value="<b>schools</b>
<hr/>
🔑 PK id: uuid
🔗 FK district_id → districts
name: varchar(100)
type: primary/middle/high/k9/k12
nature: public/private/international
level: normal/key/top
is_active: bool" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="490" y="60" width="290" height="155" as="geometry"/>
</mxCell>
<!-- complexes -->
<mxCell id="complexes" value="<b>complexes</b>
<hr/>
🔑 PK id: uuid
🔗 FK district_id → districts
🔗 FK created_by → staff
name: varchar(200) [⚠ 不可直接修改]
address: varchar(500) [只读]
address_summary: varchar(100)
latitude: numeric(10,7)
longitude: numeric(10,7)
property_usage_types: varchar[]
building_structure: varchar(30)
building_type: slab/tower/slab_tower
land_use_years: varchar(30)
built_years: smallint[]
total_units: int
total_households: int
total_floor_area: numeric(12,2)
plot_area: numeric(12,2)
plot_ratio: numeric(5,2)
green_rate: numeric(5,2)
developer: varchar(200)
property_company: varchar(200)
property_fee: numeric(8,2)
property_phone: varchar(30)
parking_total: int
parking_underground: int
parking_ratio: varchar(20)
water_type: civil/commercial
electricity_type: civil/commercial
has_central_heating: bool
has_gas: bool
lock_building: bool
lock_room: bool
lock_info: bool
lock_standard_room: bool
search_vector: tsvector
remarks: text
is_active: bool
created_at: timestamptz
updated_at: timestamptz
deleted_at: timestamptz" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="30" y="570" width="340" height="570" as="geometry"/>
</mxCell>
<!-- complex_aliases -->
<mxCell id="complex-aliases" value="<b>complex_aliases</b>
<hr/>
🔑 PK id: uuid
🔗 FK complex_id → complexes
alias: varchar(200)
is_system: bool [系统别名只读]
created_at: timestamptz
🔗 FK created_by → staff" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="490" y="570" width="290" height="130" as="geometry"/>
</mxCell>
<!-- complex_business_areas (join) -->
<mxCell id="complex-biz-areas" value="<b>complex_business_areas</b> [N:M join]
<hr/>
🔗 FK complex_id → complexes
🔗 FK business_area_id → business_areas
is_primary: bool [UNIQUE where TRUE]" style="text;html=1;strokeColor=#34d399;fillColor=#0a2e22;strokeWidth=1;dashed=1;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#6ee7b7;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="30" y="490" width="370" height="70" as="geometry"/>
</mxCell>
<!-- complex_schools (join) -->
<mxCell id="complex-schools" value="<b>complex_schools</b> [N:M join]
<hr/>
🔗 FK complex_id → complexes
🔗 FK school_id → schools
zone_type: guaranteed/reference/lottery" style="text;html=1;strokeColor=#34d399;fillColor=#0a2e22;strokeWidth=1;dashed=1;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#6ee7b7;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="490" y="250" width="300" height="75" as="geometry"/>
</mxCell>
<!-- buildings -->
<mxCell id="buildings" value="<b>buildings</b>
<hr/>
🔑 PK id: uuid
🔗 FK complex_id → complexes
🔗 FK school_id → schools [楼栋级学区]
name: varchar(50)
is_standard: bool
property_usage_type: varchar(20)
built_year: smallint
total_floors: smallint
land_use_years: varchar(30)
has_elevator: bool
is_active: bool
created_at: timestamptz
🔗 FK created_by → staff" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="30" y="1000" width="310" height="225" as="geometry"/>
</mxCell>
<!-- room_units -->
<mxCell id="room-units" value="<b>room_units</b>
<hr/>
🔑 PK id: uuid
🔗 FK building_id → buildings
floor: smallint
floor_name: varchar(20)
room_no: varchar(30)
display_no: varchar(50)
is_standard: bool
is_active: bool
created_at: timestamptz
updated_at: timestamptz
UNIQUE(building_id, floor, room_no)" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="30" y="1260" width="310" height="200" as="geometry"/>
</mxCell>
<!-- complex_price_trends -->
<mxCell id="complex-price-trends" value="<b>complex_price_trends</b>
<hr/>
🔑 PK id: uuid
🔗 FK complex_id → complexes
record_month: date [存月份1日]
avg_sale_price: numeric(12,2)
avg_unit_price: numeric(10,2)
transaction_count: int
listing_count: int
created_at: timestamptz
UNIQUE(complex_id, record_month)" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="400" y="1000" width="380" height="185" as="geometry"/>
</mxCell>
<!-- metro_lines -->
<mxCell id="metro-lines" value="<b>metro_lines</b>
<hr/>
🔑 PK id: uuid
city: varchar(50)
name: varchar(50)
color: varchar(7) [HEX]
sort_order: int
is_active: bool" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="30" y="1520" width="260" height="130" as="geometry"/>
</mxCell>
<!-- metro_stations -->
<mxCell id="metro-stations" value="<b>metro_stations</b>
<hr/>
🔑 PK id: uuid
🔗 FK metro_line_id → metro_lines
name: varchar(50)
latitude: numeric(10,7)
longitude: numeric(10,7)
sort_order: int
is_active: bool" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="320" y="1520" width="280" height="150" as="geometry"/>
</mxCell>
<!-- complex_metro_stations (join) -->
<mxCell id="complex-metro-stations" value="<b>complex_metro_stations</b> [N:M join]
<hr/>
🔗 FK complex_id → complexes
🔗 FK station_id → metro_stations
distance_meters: int [步行距离]" style="text;html=1;strokeColor=#34d399;fillColor=#0a2e22;strokeWidth=1;dashed=1;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#6ee7b7;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="320" y="1700" width="320" height="70" as="geometry"/>
</mxCell>
<!-- complex_photos -->
<mxCell id="complex-photos" value="<b>complex_photos</b>
<hr/>
🔑 PK id: uuid
🔗 FK complex_id → complexes
category: complex/layout/vr/other
file_key: text [R2/S3]
thumbnail_key: text
file_name: varchar(255)
file_size: int
width, height: int
is_cover: bool [UNIQUE where TRUE]
sort_order: smallint
created_at: timestamptz
🔗 FK created_by → staff" style="text;html=1;strokeColor=#34d399;fillColor=#063b2f;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-complex">
<mxGeometry x="490" y="770" width="300" height="205" as="geometry"/>
</mxCell>
<!-- ═══════════════════════════════════════════════════ -->
<!-- PROPERTY MODULE -->
<!-- ═══════════════════════════════════════════════════ -->
<!-- properties -->
<mxCell id="properties" value="<b>properties</b>
<hr/>
🔑 PK id: uuid
🔗 FK complex_id → complexes
🔗 FK building_id → buildings
🔗 FK room_unit_id → room_units
🔗 FK agent_id → staff
listing_type: sale/rent/both
status: varchar(20)
sale_price: numeric(12,2) [万元]
rent_price: numeric(10,2) [元/月]
area: numeric(8,2) [m²]
floor: smallint
total_floors: smallint
bedroom: smallint
living_room: smallint
bathroom: smallint
orientation: varchar(30)
decoration: varchar(20)
has_elevator: bool
built_year: smallint
ownership_years: varchar(20)
is_exclusive: bool [独家委托]
completeness_score: int
search_vector: tsvector
source: varchar(30)
remarks: text
created_at: timestamptz
updated_at: timestamptz
deleted_at: timestamptz
🔗 FK created_by → staff
🔗 FK updated_by → staff
<i>[89,000+ rows · 复合索引 · 分区预留]</i>" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="30" y="60" width="380" height="560" as="geometry"/>
</mxCell>
<!-- property_contacts -->
<mxCell id="property-contacts" value="<b>property_contacts</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
name: varchar(50)
phone_enc: text [AES-256-GCM]
phone_hash: varchar(64) [SHA-256]
role: owner/agent/tenant
is_primary: bool
created_at: timestamptz
deleted_at: timestamptz" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="30" y="670" width="310" height="170" as="geometry"/>
</mxCell>
<!-- property_follow_logs -->
<mxCell id="property-follow-logs" value="<b>property_follow_logs</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
🔗 FK staff_id → staff
log_type: call/visit/price_change/note/...
content: text
phone_no_viewed: bool [敏感操作]
created_at: timestamptz
🔗 FK created_by → staff
⚠ NO DELETE — append-only audit log" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="470" y="60" width="380" height="185" as="geometry"/>
</mxCell>
<!-- listing_histories -->
<mxCell id="listing-histories" value="<b>listing_histories</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
listed_at: timestamptz
delisted_at: timestamptz
list_price: numeric(12,2)
reason: varchar(50)
created_at: timestamptz" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="470" y="300" width="310" height="155" as="geometry"/>
</mxCell>
<!-- property_photos -->
<mxCell id="property-photos" value="<b>property_photos</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
category: listing/vr/layout/other
file_key: text [R2/S3]
thumbnail_key: text
is_cover: bool
sort_order: smallint
width, height: int
file_size: int
created_at: timestamptz
🔗 FK created_by → staff" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="30" y="900" width="310" height="205" as="geometry"/>
</mxCell>
<!-- property_keys -->
<mxCell id="property-keys" value="<b>property_keys</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
🔗 FK holder_id → staff
key_no: varchar(50)
status: held/returned
taken_at: timestamptz
returned_at: timestamptz
notes: text" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="470" y="510" width="310" height="165" as="geometry"/>
</mxCell>
<!-- property_commissions -->
<mxCell id="property-commissions" value="<b>property_commissions</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
commission_type: exclusive/open
rate: numeric(5,4)
amount: numeric(12,2)
start_date: date
end_date: date
signed_at: timestamptz
document_key: text
created_at: timestamptz" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="470" y="740" width="330" height="185" as="geometry"/>
</mxCell>
<!-- property_inspections -->
<mxCell id="property-inspections" value="<b>property_inspections</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties
🔗 FK staff_id → staff
inspected_at: timestamptz
status: pending/done/cancelled
notes: text
attachments: jsonb
created_at: timestamptz" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="30" y="1160" width="320" height="165" as="geometry"/>
</mxCell>
<!-- property_marketing -->
<mxCell id="property-marketing" value="<b>property_marketing</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties [UNIQUE 1:1]
title: varchar(200)
highlights: text[]
description: text
tags: varchar[]
platforms: jsonb
published_at: timestamptz
updated_at: timestamptz" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="470" y="990" width="340" height="175" as="geometry"/>
</mxCell>
<!-- property_certificates -->
<mxCell id="property-certificates" value="<b>property_certificates</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties [UNIQUE 1:1]
cert_no: varchar(50)
owner_name: varchar(100)
ownership_type: varchar(30)
area_registered: numeric(8,2)
issue_date: date
document_key: text" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="30" y="1390" width="330" height="165" as="geometry"/>
</mxCell>
<!-- completeness_scores -->
<mxCell id="completeness-scores" value="<b>completeness_scores</b>
<hr/>
🔑 PK id: uuid
🔗 FK property_id → properties [UNIQUE 1:1]
score: int [0-100]
missing_fields: text[]
calculated_at: timestamptz
version: int" style="text;html=1;strokeColor=#a78bfa;fillColor=#2d1a5e;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-property">
<mxGeometry x="470" y="1230" width="310" height="135" as="geometry"/>
</mxCell>
<!-- ═══════════════════════════════════════════════════ -->
<!-- CLIENT MODULE -->
<!-- ═══════════════════════════════════════════════════ -->
<!-- clients -->
<mxCell id="clients" value="<b>clients</b>
<hr/>
🔑 PK id: uuid
🔗 FK agent_id → staff
client_type: private/public/closed
status: active/inactive/converted
name: varchar(50)
phone_enc: text [AES-256-GCM]
phone_hash: varchar(64) [SHA-256]
budget_min/max: numeric
activity_level: 1-5 [Celery每日计算]
is_protected: bool [防自动转公客]
transfer_to_public_type: auto/manual
last_follow_at: timestamptz
source: varchar(30)
remarks: text
created_at: timestamptz
deleted_at: timestamptz
🔗 FK created_by → staff
<i>[私客/公客/成交客 三态状态机]</i>" style="text;html=1;strokeColor=#fbbf24;fillColor=#3d1f06;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-client">
<mxGeometry x="30" y="60" width="370" height="360" as="geometry"/>
</mxCell>
<!-- client_requirements -->
<mxCell id="client-requirements" value="<b>client_requirements</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
req_type: second_hand/new/rent
district_ids: uuid[]
business_area_ids: uuid[]
price_min: numeric
price_max: numeric
area_min: numeric
area_max: numeric
bedrooms: int[]
school_ids: uuid[]
has_elevator: bool
is_active: bool
created_at: timestamptz" style="text;html=1;strokeColor=#fbbf24;fillColor=#3d1f06;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-client">
<mxGeometry x="30" y="480" width="350" height="260" as="geometry"/>
</mxCell>
<!-- client_follow_logs -->
<mxCell id="client-follow-logs" value="<b>client_follow_logs</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
🔗 FK staff_id → staff
log_type: call/visit/match/note/status_change
content: text
next_follow_date: date
created_at: timestamptz
🔗 FK created_by → staff
⚠ NO DELETE — append-only audit log" style="text;html=1;strokeColor=#fbbf24;fillColor=#3d1f06;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-client">
<mxGeometry x="430" y="60" width="380" height="200" as="geometry"/>
</mxCell>
<!-- client_viewings -->
<mxCell id="client-viewings" value="<b>client_viewings</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
🔗 FK property_id → properties
🔗 FK agent_id → staff
viewed_at: timestamptz
feedback: text
rating: smallint [1-5]
status: planned/done/cancelled
created_at: timestamptz" style="text;html=1;strokeColor=#fbbf24;fillColor=#3d1f06;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-client">
<mxGeometry x="430" y="310" width="360" height="195" as="geometry"/>
</mxCell>
<!-- client_property_matches -->
<mxCell id="client-matches" value="<b>client_property_matches</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
🔗 FK property_id → properties
🔗 FK agent_id → staff
match_type: system/manual
score: numeric(5,2)
status: pending/sent/viewed/dismissed
sent_at: timestamptz
viewed_at: timestamptz
created_at: timestamptz" style="text;html=1;strokeColor=#fbbf24;fillColor=#3d1f06;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-client">
<mxGeometry x="30" y="800" width="380" height="205" as="geometry"/>
</mxCell>
<!-- client_status_logs -->
<mxCell id="client-status-logs" value="<b>client_status_logs</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
from_status: varchar(20)
to_status: varchar(20)
transfer_type: auto/manual
reason: text
created_at: timestamptz
🔗 FK created_by → staff
⚠ NO DELETE — append-only audit log" style="text;html=1;strokeColor=#fbbf24;fillColor=#3d1f06;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-client">
<mxGeometry x="430" y="560" width="370" height="195" as="geometry"/>
</mxCell>
<!-- client_favorite_folders -->
<mxCell id="client-fav-folders" value="<b>client_favorite_folders</b>
<hr/>
🔑 PK id: uuid
🔗 FK client_id → clients
name: varchar(100)
sort_order: int
created_at: timestamptz" style="text;html=1;strokeColor=#fbbf24;fillColor=#3d1f06;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-client">
<mxGeometry x="30" y="1070" width="300" height="130" as="geometry"/>
</mxCell>
<!-- client_folder_items -->
<mxCell id="client-folder-items" value="<b>client_folder_items</b>
<hr/>
🔑 PK id: uuid
🔗 FK folder_id → client_favorite_folders
🔗 FK property_id → properties
sort_order: int
created_at: timestamptz" style="text;html=1;strokeColor=#fbbf24;fillColor=#3d1f06;align=left;verticalAlign=top;spacingLeft=8;spacingTop=4;overflow=hidden;rotatable=0;fontSize=11;fontFamily=monospace;fontColor=#e2e8f0;whiteSpace=pre;" vertex="1" parent="region-client">
<mxGeometry x="370" y="1070" width="320" height="130" as="geometry"/>
</mxCell>
<!-- ═══════════════════════════════════════════════════ -->
<!-- EDGES / RELATIONSHIPS -->
<!-- ═══════════════════════════════════════════════════ -->
<!-- OrgUnit self-ref -->
<mxCell id="e-org-self" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.3;entryDx=0;entryDy=0;strokeColor=#22d3ee;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="org-units" target="org-units" parent="region-org">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="340" y="153"/><mxPoint x="340" y="108"/></Array></mxGeometry>
</mxCell>
<mxCell id="e-org-self-lbl" value="自引用 parent_id" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#22d3ee;" vertex="1" connectable="0" parent="e-org-self"><mxGeometry x="0.1" relative="1" as="geometry"/></mxCell>
<!-- OrgUnit → Staff -->
<mxCell id="e-org-staff" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#22d3ee;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="org-units" target="staff" parent="region-org">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-org-staff-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#22d3ee;" vertex="1" connectable="0" parent="e-org-staff"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- District → BusinessArea -->
<mxCell id="e-dist-biz" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="districts" target="business-areas" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-dist-biz-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" vertex="1" connectable="0" parent="e-dist-biz"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- District → Schools -->
<mxCell id="e-dist-school" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="districts" target="schools" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-dist-school-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" vertex="1" connectable="0" parent="e-dist-school"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- District → Complexes -->
<mxCell id="e-dist-complex" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="districts" target="complexes" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-dist-complex-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" vertex="1" connectable="0" parent="e-dist-complex"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- BusinessArea ↔ Complexes via join -->
<mxCell id="e-biz-join" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" edge="1" source="business-areas" target="complex-biz-areas" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-join-complex" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" edge="1" source="complex-biz-areas" target="complexes" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- Schools ↔ Complexes via join -->
<mxCell id="e-school-join" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" edge="1" source="schools" target="complex-schools" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-school-join2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" edge="1" source="complex-schools" target="complexes" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- Complexes → complex_aliases -->
<mxCell id="e-complex-alias" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="complexes" target="complex-aliases" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-complex-alias-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" vertex="1" connectable="0" parent="e-complex-alias"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Complexes → complex_photos -->
<mxCell id="e-complex-photos" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="complexes" target="complex-photos" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-complex-photos-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" vertex="1" connectable="0" parent="e-complex-photos"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Complexes → complex_price_trends -->
<mxCell id="e-complex-trend" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="complexes" target="complex-price-trends" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-complex-trend-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" vertex="1" connectable="0" parent="e-complex-trend"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Complexes → Buildings -->
<mxCell id="e-complex-bldg" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="complexes" target="buildings" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-complex-bldg-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" vertex="1" connectable="0" parent="e-complex-bldg"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Buildings → RoomUnits -->
<mxCell id="e-bldg-room" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="buildings" target="room-units" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-bldg-room-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" vertex="1" connectable="0" parent="e-bldg-room"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- MetroLine → MetroStation -->
<mxCell id="e-metro-line-station" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="metro-lines" target="metro-stations" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-metro-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#34d399;" vertex="1" connectable="0" parent="e-metro-line-station"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- MetroStation ↔ Complexes via join -->
<mxCell id="e-metro-join1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" edge="1" source="metro-stations" target="complex-metro-stations" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-metro-join2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#34d399;dashed=1;endArrow=open;startArrow=open;fontSize=9;" edge="1" source="complex-metro-stations" target="complexes" parent="region-complex">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- Properties → PropertyContacts -->
<mxCell id="e-prop-contact" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="property-contacts" parent="region-property">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-contact-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-prop-contact"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → FollowLogs -->
<mxCell id="e-prop-follow" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="property-follow-logs" parent="region-property">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-follow-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-prop-follow"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → ListingHistories -->
<mxCell id="e-prop-listing" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="listing-histories" parent="region-property">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-listing-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-prop-listing"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → Photos -->
<mxCell id="e-prop-photos" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="property-photos" parent="region-property">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-photos-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-prop-photos"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → Keys -->
<mxCell id="e-prop-keys" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="property-keys" parent="region-property">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-keys-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-prop-keys"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → Commissions -->
<mxCell id="e-prop-comm" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="property-commissions" parent="region-property">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-comm-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-prop-comm"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → Inspections -->
<mxCell id="e-prop-insp" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="property-inspections" parent="region-property">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-insp-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-prop-insp"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → Marketing (1:1) -->
<mxCell id="e-prop-marketing" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERone;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="property-marketing" parent="region-property">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-marketing-lbl" value="1:1" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-prop-marketing"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → Certificates (1:1) -->
<mxCell id="e-prop-cert" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERone;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="property-certificates" parent="region-property">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-cert-lbl" value="1:1" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-prop-cert"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → Completeness (1:1) -->
<mxCell id="e-prop-score" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#a78bfa;endArrow=ERone;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="completeness-scores" parent="region-property">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-score-lbl" value="1:1" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-prop-score"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Clients → ClientRequirements -->
<mxCell id="e-client-req" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="clients" target="client-requirements" parent="region-client">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-client-req-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" vertex="1" connectable="0" parent="e-client-req"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Clients → FollowLogs -->
<mxCell id="e-client-follow" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="clients" target="client-follow-logs" parent="region-client">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-client-follow-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" vertex="1" connectable="0" parent="e-client-follow"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Clients → Viewings -->
<mxCell id="e-client-viewing" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="clients" target="client-viewings" parent="region-client">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-client-viewing-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" vertex="1" connectable="0" parent="e-client-viewing"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Clients → Matches -->
<mxCell id="e-client-match" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="clients" target="client-matches" parent="region-client">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-client-match-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" vertex="1" connectable="0" parent="e-client-match"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Clients → StatusLogs -->
<mxCell id="e-client-statuslog" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="clients" target="client-status-logs" parent="region-client">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-client-statuslog-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" vertex="1" connectable="0" parent="e-client-statuslog"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Clients → FavFolders -->
<mxCell id="e-client-fav" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="clients" target="client-fav-folders" parent="region-client">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-client-fav-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" vertex="1" connectable="0" parent="e-client-fav"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- FavFolders → FolderItems -->
<mxCell id="e-fav-items" style="edgeStyle=orthogonalEdgeStyle;rounded=0;strokeColor=#fbbf24;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="client-fav-folders" target="client-folder-items" parent="region-client">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-fav-items-lbl" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fbbf24;" vertex="1" connectable="0" parent="e-fav-items"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- ═══════════════════════════════════════════════════ -->
<!-- CROSS-REGION EDGES (parent=1) -->
<!-- ═══════════════════════════════════════════════════ -->
<!-- Complexes → Properties -->
<mxCell id="e-complex-prop" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#a78bfa;dashed=0;endArrow=ERmany;startArrow=ERone;fontSize=9;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" edge="1" source="complexes" target="properties" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-complex-prop-lbl" value="1:N complex_id" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-complex-prop"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Buildings → Properties -->
<mxCell id="e-bldg-prop" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#a78bfa;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="buildings" target="properties" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-bldg-prop-lbl" value="1:N building_id" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-bldg-prop"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- RoomUnits → Properties -->
<mxCell id="e-room-prop" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#a78bfa;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="room-units" target="properties" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-room-prop-lbl" value="1:N room_unit_id" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#a78bfa;" vertex="1" connectable="0" parent="e-room-prop"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Staff → Properties (agent_id) -->
<mxCell id="e-staff-prop" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#22d3ee;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="staff" target="properties" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-staff-prop-lbl" value="agent_id" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#22d3ee;" vertex="1" connectable="0" parent="e-staff-prop"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Staff → Clients (agent_id) -->
<mxCell id="e-staff-client" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#22d3ee;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="staff" target="clients" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-staff-client-lbl" value="agent_id" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#22d3ee;" vertex="1" connectable="0" parent="e-staff-client"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → Viewings (cross-region) -->
<mxCell id="e-prop-viewing" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#fb923c;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="client-viewings" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-viewing-lbl" value="property_id" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fb923c;" vertex="1" connectable="0" parent="e-prop-viewing"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → Matches (cross-region) -->
<mxCell id="e-prop-match" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#fb923c;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="client-matches" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-match-lbl" value="property_id" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fb923c;" vertex="1" connectable="0" parent="e-prop-match"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- Properties → FolderItems (cross-region) -->
<mxCell id="e-prop-folder" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;strokeColor=#fb923c;dashed=1;endArrow=ERmany;startArrow=ERone;fontSize=9;" edge="1" source="properties" target="client-folder-items" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="e-prop-folder-lbl" value="property_id" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;fontSize=9;fontColor=#fb923c;" vertex="1" connectable="0" parent="e-prop-folder"><mxGeometry relative="1" as="geometry"/></mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@@ -13,23 +13,14 @@
- DATA_MODEL文档(Draft): `Project/fonrey/DATA_MODEL/DATA_MODEL.md`
- 项目PRD 文档(Draft):
- 房源管理PRD: `Project/fonrey/PRD/房源管理/房源管理模块PRD.md`
- 楼盘管理PRD: `Project/fonrey/PRD/房源管理/楼盘管理模块PRD`
- 楼盘管理PRD: `Project/fonrey/PRD/房源管理/楼盘管理模块PRD.md`
- 客源管理PRD: `Project/fonrey/PRD/客源管理/客源管理模块PRD.md`
- 权限管理PRD:
- 权限管理样本数据:`Project/fonrey/PRD/权限管理/房源-二手租赁.md`
- 组织人事管理PRD:
- 文档根目录是:`~/Workspace/nexus`
- 你是一名资深的后端架构师,请你参考读取 `raw/Agent/agency-agents/engineering/engineering-backend-architect.md` 并用该文档提及的架构师方面的技能和方法论帮设计系统
- 在做技术选型时,我分析了页面的组件并记录在 `Project/fonrey/UI&UX/组件清单.md`
-
- 具体项目PRD文档`Project/fonrey/PRD/*.md`
- 请根据TECH_STAK文档要求 `Project/fonrey/TECH_STACK/TECH_STACK 文档要求`帮我设计TECH_STACK文档 输出到`Project/fonrey/TECH_STACK/`目录下
- 权限管理PRD: `Project/fonrey/PRD/权限管理/权限管理模块PRD.md`
- 权限管理样本数据:`Project/fonrey/PRD/权限管理/首页.md`
- 权限管理样本数据:`Project/fonrey/PRD/权限管理/房源-二手租赁.md`
- 权限管理样本数据:`Project/fonrey/PRD/权限管理/客源.md`
- 权限管理样本数据:`Project/fonrey/PRD/权限管理/小区.md`
- 组织人事管理PRD: `Project/fonrey/PRD/组织人事管理/组织人事管理模块PRD.md`
## PRD需求文档生成提示词
@@ -44,6 +35,29 @@
- 组织人事管理PRD: `Project/fonrey/PRD/组织人事管理/组织人事管理模块PRD.md`
- 现在请你继续分析权限管理 并写入`Project/fonrey/PRD/权限管理/权限管理模块PRD.md`
## DATA_MODEL设计文档生成提示词
- 文档根目录是:`~/Workspace/nexus`
- 你是一名资深的系统架构师,现在我要你根据我提供的产品截图和信息帮我分析产品功能需求并写成需求文档
- 请你参考读取`Project/fonrey/prompt/engineering-backend-architect.md` 并用该文档提及架构师专业技能帮我进行项目设计
- 我的项目是开发一套房产经纪管理系统(Fonrey), 项目概览和技术栈包含在TECH_STACK 文档(Draft)`Project/fonrey/TECH_STACK/TECH_STACK.md`
- 现阶段已经完成需求分析如下,你可以参考这些文档了解项目具体的需求和模型
- 项目PRD 文档(Draft):
- 房源管理PRD: `Project/fonrey/PRD/房源管理/房源管理模块PRD.md`
- 楼盘管理PRD: `Project/fonrey/PRD/房源管理/楼盘管理模块PRD.md`
- 客源管理PRD: `Project/fonrey/PRD/客源管理/客源管理模块PRD.md`
- 权限管理PRD: `Project/fonrey/PRD/权限管理/权限管理模块PRD.md`
- 权限管理样本数据:`Project/fonrey/PRD/权限管理/首页.md`
- 权限管理样本数据:`Project/fonrey/PRD/权限管理/房源-二手租赁.md`
- 权限管理样本数据:`Project/fonrey/PRD/权限管理/客源.md`
- 权限管理样本数据:`Project/fonrey/PRD/权限管理/小区.md`
- 组织人事管理PRD: `Project/fonrey/PRD/组织人事管理/组织人事管理模块PRD.md`
- 现在请你根据以上内容完善DATA_MODEL设计文档`Project/fonrey/DATA_MODEL/DATA_MODEL.md`
- 主要完善方向:
- 数据模型初步设计数据模型如需要可创建新的markdown文件来描述单个模型 比如: `DATA_MODEL_PROPERTY.md` `DATA_MODEL_CLIENT.md`
- ER diagram 描述数据模型之间的关联关系(可以输出drawio的图形用不同颜色区分模型)
- 权限管理需要进一步讨论和设计,无需在此文档里做过多的描述
## 权限管理截图
- 权限管理
- 权限管理-人员列表:`Project/fonrey/screenshots/权限管理/权限管理-人员列表.png`