Houseman OS
Tables (48)
audit_logs
- id — bigint — Primary key — NOT NULL
- occurred_at — timestamp — NOT NULL
- actor — text
- action — text — NOT NULL
- detail — jsonb
bank_accounts
- bank_account_id — bigint — Primary key — NOT NULL
- owner_party_id — bigint — Foreign key → parties.party_id
- bank_name — text — NOT NULL
- account_no — text — NOT NULL
- holder — text
- active — boolean — NOT NULL
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
- alias — text
bank_transactions
- bank_transaction_id — bigint — Primary key — NOT NULL
- bank_account_id — bigint — Foreign key → bank_accounts.bank_account_id — NOT NULL
- occurred_at — timestamptz — NOT NULL
- direction — txn_direction — NOT NULL — deposit/withdrawal (입금·출금)
- amount — numeric(12,2) — NOT NULL
- counterparty — text
- category — text
- memo — text
- synced_at — timestamptz
- created_at — timestamptz — NOT NULL
- method — payment_method_type — auto_debit/bank_transfer/card/cash (자동이체·계좌입금·카드·현금) — 수납 줄 표시. 은행 동기화가 판별 못 하면 NULL
brokers
- broker_id — bigint — Primary key — NOT NULL
- party_id — bigint — Foreign key → parties.party_id — NOT NULL
- license_no — text
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
building_attachments
- building_attachment_id — bigint — Primary key — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id — NOT NULL
- doc_type — building_doc_type — NOT NULL
- file_name — text — NOT NULL
- storage_path — text — NOT NULL
- mime_type — text
- size_bytes — bigint
- uploaded_at — timestamptz — NOT NULL
- created_at — timestamptz — NOT NULL
building_managers
- building_manager_id — bigint — Primary key — NOT NULL
- role — building_manager_role — NOT NULL
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id — NOT NULL
- user_id — bigint — Foreign key → users.user_id — NOT NULL
buildings
- building_id — bigint — Primary key — NOT NULL
- name — text — NOT NULL
- name_short — text — NOT NULL
- road_address — text — NOT NULL
- jibun_address — text
- approval_date — date
- total_area_m2 — numeric(12,2)
- has_elevator — boolean — NOT NULL
- rooftop_access — text
- cctv_access — text
- parking_total — integer
- parking_current — integer
- has_parking_barrier — boolean — NOT NULL
- entrance_password_enc — bytea
- electric_room_password_enc — bytea
- parking_barrier_password_enc — bytea
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
collection_routings
- collection_routing_id — bigint — Primary key — NOT NULL
- money_kind — money_kind_type — NOT NULL — rent/maintenance/utility/electricity_gas/deposit — 수납용(임차인→우리). 지급은 settlement_payout_accounts
- room_id — bigint — Foreign key → rooms.room_id
- building_id — bigint — Foreign key → buildings.building_id
- bank_account_id — bigint — Foreign key → bank_accounts.bank_account_id — NOT NULL
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
commissions
- commission_id — bigint — Primary key — NOT NULL
- lease_id — bigint — Foreign key → leases.lease_id — NOT NULL
- broker_id — bigint — Foreign key → brokers.broker_id — NOT NULL
- amount — numeric(12,2) — NOT NULL
- status — commission_status_type — NOT NULL
- paid_at — timestamptz
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
contracts
- contract_id — bigint — Primary key — NOT NULL
- lease_id — bigint — Foreign key → leases.lease_id — NOT NULL
- signed_date — date — NOT NULL
- start_date — date — NOT NULL
- end_date — date
- effective_date — date — NOT NULL
- deposit — numeric(12,2)
- rent — numeric(12,2)
- maintenance_fee — numeric(12,2)
- cleaning_fee — numeric(12,2)
- broker_name — text
- broker_phone — text
- document_path — text
- created_at — timestamptz — NOT NULL
delinquencies
- delinquency_id — bigint — Primary key — NOT NULL
- lease_id — bigint — Foreign key → leases.lease_id — NOT NULL
- action — text
- note — text
- acted_at — timestamptz — NOT NULL
- actor_user_id — bigint — Foreign key → users.user_id
- created_at — timestamptz — NOT NULL
expenses
- expense_id — bigint — Primary key — NOT NULL
- title — text — NOT NULL
- category — expense_category_type — NOT NULL
- source — expense_source_type — NOT NULL
- payee_name — text — NOT NULL
- payee_bank — text
- payee_account_no — text
- amount — numeric(12,2) — NOT NULL
- status — expense_status_type — NOT NULL
- memo — text
- paid_date — date
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id
- room_id — bigint — Foreign key → rooms.room_id
- settlement_run_id — bigint — Foreign key → settlement_runs.settlement_run_id
- service_request_id — bigint — Foreign key → service_requests.service_request_id
- move_out_id — bigint — Foreign key → move_outs.move_out_id
- author_user_id — bigint — Foreign key → users.user_id
- paid_by_user_id — bigint — Foreign key → users.user_id
- owner_billable — boolean — NOT NULL — 건물주 청구 대상 — 정산 공제 프리필 원천
invoice_lines
- invoice_line_id — bigint — Primary key — NOT NULL
- invoice_id — bigint — Foreign key → invoices.invoice_id — NOT NULL
- item_type — invoice_item_type — NOT NULL
- amount — numeric(12,2) — NOT NULL
- meter_reading_id — bigint — Foreign key → meter_readings.meter_reading_id
- created_at — timestamptz — NOT NULL
- bank_account_id — bigint — Foreign key → bank_accounts.bank_account_id
invoices
- invoice_id — bigint — Primary key — NOT NULL
- lease_id — bigint — Foreign key → leases.lease_id — NOT NULL
- period — date — NOT NULL — 청구월 — 항상 월초 date
- status — invoice_status_type — NOT NULL
- due_date — date
- issued_at — timestamptz
- confirmed_at — timestamptz
- sent_at — timestamptz
- paid_at — timestamptz
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
late_fee_policies
- late_fee_policy_id — bigint — Primary key — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id
- grace_days — integer
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
- room_id — bigint — Foreign key → rooms.room_id
- method — late_fee_method_type — NOT NULL
- rate_percent — numeric(5,2) — 이율 %(method=annual_rate·monthly_rate)
- fixed_amount — numeric(12,2) — 고정액(method=daily_fixed·monthly_fixed)
leads
- lead_id — bigint — Primary key — NOT NULL
- broker_id — bigint — Foreign key → brokers.broker_id — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id
- room_id — bigint — Foreign key → rooms.room_id
- signal — lead_signal_type — NOT NULL
- note — text
- created_at — timestamptz — NOT NULL
leases
- lease_id — bigint — Primary key — NOT NULL
- room_id — bigint — Foreign key → rooms.room_id — NOT NULL
- tenant_party_id — bigint — Foreign key → parties.party_id
- lifecycle_status — lifecycle_status_type — NOT NULL
- replaces_lease_id — bigint — Foreign key → leases.lease_id
- start_date — date
- end_date — date
- first_move_in_date — date
- deposit — numeric(12,2)
- rent — numeric(12,2)
- rent_payment_type — payment_type
- maintenance_fee — numeric(12,2)
- maintenance_payment_type — payment_type
- cleaning_fee — numeric(12,2)
- payment_due_day — integer
- parking_status — parking_status_type
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
- parking_fee — numeric(12,2)
- car_plate_no — text
- broker_name — text
- broker_phone — text
- broker_fee — numeric(12,2)
management_contract_owners
- management_contract_owner_id — bigint — Primary key — NOT NULL
- management_contract_id — bigint — Foreign key → management_contracts.management_contract_id — NOT NULL
- owner_party_id — bigint — Foreign key → parties.party_id — NOT NULL
- ratio — numeric(5,2)
- cap_amount — numeric(12,2)
- priority — integer
- created_at — timestamptz — NOT NULL
management_contracts
- management_contract_id — bigint — Primary key — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id — NOT NULL
- owner_party_id — bigint — Foreign key → parties.party_id — NOT NULL
- service_type — service_type_enum — NOT NULL
- fee_method — fee_method_type
- fee_rate — numeric(5,2)
- fixed_fee — numeric(12,2)
- vat_charged — boolean — NOT NULL
- settle_days — smallint[]
- settle_form — settle_form_type
- started_date — date
- ended_date — date
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
- settle_type — settle_type_enum — NOT NULL
- payout_method — payout_method_type
meter_readings
- meter_reading_id — bigint — Primary key — NOT NULL
- meter_source_id — bigint — Foreign key → meter_sources.meter_source_id — NOT NULL
- period — date — NOT NULL — 청구월 — 항상 월초 date (2026-07-31: text 'YYYY-MM' → date)
- reading_value — numeric(12,2)
- usage_amount — numeric(12,2)
- charge_amount — numeric(12,2)
- period_start — date
- period_end — date
- source — reading_source — NOT NULL
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
meter_sources
- meter_source_id — bigint — Primary key — NOT NULL
- room_id — bigint — Foreign key → rooms.room_id — NOT NULL
- utility — utility_type — NOT NULL
- billing_method — billing_method_type — NOT NULL
- supplier — text
- customer_no — text
- fixed_amount — numeric(12,2)
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
move_ins
- move_in_id — bigint — Primary key — NOT NULL
- lease_id — bigint — Foreign key → leases.lease_id — NOT NULL
- checked_at — timestamptz
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
move_out_deductions
- move_out_deduction_id — bigint — Primary key — NOT NULL
- deduction_type — move_out_deduction_type — NOT NULL
- amount — numeric(12,2) — NOT NULL
- memo — text
- created_at — timestamptz — NOT NULL
- move_out_id — bigint — Foreign key → move_outs.move_out_id — NOT NULL
move_outs
- move_out_id — bigint — Primary key — NOT NULL
- lease_id — bigint — Foreign key → leases.lease_id — NOT NULL
- notified_date — date
- scheduled_date — date — NOT NULL
- actual_date — date
- move_out_type — move_out_type_enum
- checked_at — timestamptz
- cleaned_at — timestamptz
- settled_at — timestamptz
- settlement_sent_at — timestamptz
- refund_amount — numeric(12,2)
- refunded_at — timestamptz
- cancelled_at — timestamptz
- cancel_reason — text
- self_link_token — text
- token_expires_at — timestamptz
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
move_photos
- move_photo_id — bigint — Primary key — NOT NULL
- move_in_id — bigint — Foreign key → move_ins.move_in_id
- move_out_id — bigint — Foreign key → move_outs.move_out_id
- area — text
- storage_path — text — NOT NULL
- uploaded_at — timestamptz — NOT NULL
notices
- notice_id — bigint — Primary key — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id — NOT NULL
- title — text — NOT NULL
- body — text
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
notification_messages
- notification_message_id — bigint — Primary key — NOT NULL
- notification_template_id — bigint — Foreign key → notification_templates.notification_template_id
- channel — noti_channel — NOT NULL
- to_party_id — bigint — Foreign key → parties.party_id
- to_phone — text
- payload — jsonb
- status — noti_status — NOT NULL
- queued_at — timestamptz — NOT NULL
- sent_at — timestamptz
- fail_reason — text
- ref_type — text
- ref_id — bigint
- created_at — timestamptz — NOT NULL
notification_templates
- notification_template_id — bigint — Primary key — NOT NULL
- code — text — NOT NULL
- channel — noti_channel — NOT NULL
- title — text
- body — text — NOT NULL
- active — boolean — NOT NULL
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
owner_shares
- owner_share_id — bigint — Primary key — NOT NULL
- settlement_run_id — bigint — Foreign key → settlement_runs.settlement_run_id — NOT NULL
- owner_party_id — bigint — Foreign key → parties.party_id — NOT NULL
- ratio — numeric(5,2)
- cap_amount — numeric(12,2)
- priority — integer
- allocated_amount — numeric(12,2)
- carried_over — numeric(12,2)
- created_at — timestamptz — NOT NULL
parties
- party_id — bigint — Primary key — NOT NULL
- kind — party_kind — NOT NULL
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
- name — text — NOT NULL
- phone — text
- address — text
- biz_no — text
party_contact_history
- party_contact_history_id — bigint — Primary key — NOT NULL
- party_id — bigint — Foreign key → parties.party_id — NOT NULL
- phone — text — NOT NULL
- changed_at — timestamptz — NOT NULL
- changed_by_user_id — bigint — Foreign key → users.user_id
payer_aliases
- payer_alias_id — bigint — Primary key — NOT NULL
- alias_name — text — NOT NULL
- tenant_party_id — bigint — Foreign key → parties.party_id — NOT NULL
- created_at — timestamptz — NOT NULL
payment_matches
- payment_match_id — bigint — Primary key — NOT NULL
- bank_transaction_id — bigint — Foreign key → bank_transactions.bank_transaction_id — NOT NULL
- invoice_id — bigint — Foreign key → invoices.invoice_id — NOT NULL
- source — match_source — NOT NULL
- confidence — numeric(5,2)
- amount — numeric(12,2)
- confirmed_at — timestamptz
- created_at — timestamptz — NOT NULL
persons
- party_id — bigint — Foreign key → parties.party_id — NOT NULL
- rrn_enc — bytea
- birth_date — date
poll_options
- poll_option_id — bigint — Primary key — NOT NULL
- poll_id — bigint — Foreign key → polls.poll_id — NOT NULL
- label — text — NOT NULL
poll_votes
- poll_vote_id — bigint — Primary key — NOT NULL
- poll_id — bigint — Foreign key → polls.poll_id — NOT NULL
- poll_option_id — bigint — Foreign key → poll_options.poll_option_id — NOT NULL
- voter_party_id — bigint — Foreign key → parties.party_id — NOT NULL
- created_at — timestamptz — NOT NULL
polls
- poll_id — bigint — Primary key — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id — NOT NULL
- title — text — NOT NULL
- status — poll_status_type — NOT NULL
- closes_at — timestamptz
- created_at — timestamptz — NOT NULL
room_listings
- room_listing_id — bigint — Primary key — NOT NULL
- room_id — bigint — Foreign key → rooms.room_id — NOT NULL
- rental_kind — rental_kind_type
- listing_status — listing_status_type — NOT NULL
- listed_at — timestamptz
- sort_order — integer
- asking_deposit — numeric(12,2)
- asking_rent — numeric(12,2)
- asking_rent_discounted — numeric(12,2)
- asking_maintenance_fee — numeric(12,2)
- asking_cleaning_fee — numeric(12,2)
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
room_notes
- room_note_id — bigint — Primary key — NOT NULL
- room_id — bigint — Foreign key → rooms.room_id — NOT NULL
- content — text — NOT NULL
- author_user_id — bigint — Foreign key → users.user_id
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
rooms
- room_id — bigint — Primary key — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id — NOT NULL
- room_no — text — NOT NULL
- area_exclusive_m2 — numeric(8,2)
- area_supply_m2 — numeric(8,2)
- structure — room_structure
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
service_request_logs
- service_request_log_id — bigint — Primary key — NOT NULL
- body — text — NOT NULL
- created_at — timestamptz — NOT NULL
- service_request_id — bigint — Foreign key → service_requests.service_request_id — NOT NULL
- author_user_id — bigint — Foreign key → users.user_id
service_request_photos
- service_request_photo_id — bigint — Primary key — NOT NULL
- photo_type — sr_photo_type — NOT NULL
- storage_path — text — NOT NULL
- uploaded_at — timestamptz — NOT NULL
- service_request_id — bigint — Foreign key → service_requests.service_request_id — NOT NULL
- service_request_log_id — bigint — Foreign key → service_request_logs.service_request_log_id
service_requests
- service_request_id — bigint — Primary key — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id — NOT NULL
- room_id — bigint — Foreign key → rooms.room_id
- title — text — NOT NULL
- description — text
- category — text
- status — sr_status_type — NOT NULL
- charge_type — charge_type_enum
- cost_amount — numeric(12,2)
- owner_burden — boolean — NOT NULL — 건물주 부담 여부(판정) — expenses.owner_billable(청구 대상)과 다른 개념
- receipt_path — text
- assignee_user_id — bigint — Foreign key → users.user_id
- completed_at — timestamptz
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
- reporter_user_id — bigint — Foreign key → users.user_id
- importance — importance_type
- tenant_name — text
- tenant_phone — text
- deadline — date
settlement_deductions
- settlement_deduction_id — bigint — Primary key — NOT NULL
- settlement_run_id — bigint — Foreign key → settlement_runs.settlement_run_id — NOT NULL
- type — text
- amount — numeric(12,2) — NOT NULL
- occurred_date — date
- room_id — bigint — Foreign key → rooms.room_id
- description — text
- source — settlement_deduction_source — expense/manual/service_request — 지출 원장 프리필 / 수동 추가 / 건물주부담 A·S
- created_at — timestamptz — NOT NULL
- expense_id — bigint — Foreign key → expenses.expense_id — 원천 지출(한 지출은 한 번만 공제 — UNIQUE)
settlement_payout_accounts
- settlement_payout_account_id — bigint — Primary key — NOT NULL
- ratio — numeric(5,2)
- cap_amount — numeric(12,2)
- priority — integer
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
- management_contract_id — bigint — Foreign key → management_contracts.management_contract_id — NOT NULL
- owner_party_id — bigint — Foreign key → parties.party_id
- bank_account_id — bigint — Foreign key → bank_accounts.bank_account_id — NOT NULL
settlement_runs
- settlement_run_id — bigint — Primary key — NOT NULL
- building_id — bigint — Foreign key → buildings.building_id — NOT NULL
- management_contract_id — bigint — Foreign key → management_contracts.management_contract_id
- period — date — NOT NULL — 정산월(격자 grouping) — 항상 월초 date. 앵커는 settle_date
- status — settlement_status_type — NOT NULL
- version — integer — NOT NULL
- frozen_at — timestamptz
- snapshot — jsonb
- sent_at — timestamptz
- dedup_hash — text
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
- settle_date — date — NOT NULL
- income_total — numeric(12,2)
- fee_amount — numeric(12,2)
- vat_amount — numeric(12,2)
- deduction_total — numeric(12,2)
- net_amount — numeric(12,2)
- note — text
users
- user_id — bigint — Primary key — NOT NULL
- email — text — NOT NULL
- password_hash — text — NOT NULL
- name — text — NOT NULL
- phone — text
- role — user_role — NOT NULL
- active — boolean — NOT NULL
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL
vehicles
- vehicle_id — bigint — Primary key — NOT NULL
- room_id — bigint — Foreign key → rooms.room_id — NOT NULL
- plate_no — text — NOT NULL
- model — text
- active — boolean — NOT NULL
- created_at — timestamptz — NOT NULL
- updated_at — timestamptz — NOT NULL