selfbill

Tables (12)

bill_cycles

  • Key — VARCHAR(255) — Primary key — NOT NULL
  • building_id — uuid — NOT NULL
  • year — numeric — NOT NULL
  • month — numeric — NOT NULL
  • year_month — text
  • due_date — date
  • period_start — date
  • period_end — date
  • is_locked — boolean — NOT NULL
  • status — text — NOT NULL
  • total_amount — numeric
  • created_at — timestamptz
  • updated_at — timestamptz
  • first_sent_at — timestamptz

bill_item_templates

  • Key — VARCHAR(255) — Primary key — NOT NULL
  • building_id — uuid — NOT NULL
  • name — text — NOT NULL — 대표자 직접 설정
  • category — text
  • amount_type — text
  • default_amount — numeric
  • default_months — numeric
  • default_type — text — allocation_method 겹칠 수 있음을 주의(같지 않음)
  • default_target_unit_ids — uuid
  • created_at — timestamptz
  • updated_at — timestamptz

bill_items

  • Key — VARCHAR(255) — Primary key — NOT NULL
  • building_id — uuid — NOT NULL
  • bill_item_template_id — uuid — NOT NULL
  • bill_cycle_id — uuid — NOT NULL
  • name — text — NOT NULL
  • category — text
  • amount_total — numeric
  • allocation_method — text
  • type — text
  • target_unit_ids — uuid
  • unit_amounts — jsonb
  • created_at — timestamptz
  • updated_at — timestamptz

building_members

  • Key — uuid — Primary key — NOT NULL
  • building_id — uuid — NOT NULL
  • user_id — uuid — NOT NULL
  • unit_id — uuid — NOT NULL
  • user_email — text — NOT NULL
  • role — varchar(20) — NOT NULL
  • is_primary_representative — boolean
  • status — text
  • created_at — timestamptz — NOT NULL
  • updated_at — timestamptz — NOT NULL

buildings

  • Key — uuid — Primary key — NOT NULL
  • address — text — NOT NULL
  • address_detail — text — NOT NULL
  • planned_units_count — numeric — NOT NULL
  • building_units_count — numeric — NOT NULL
  • billing_method — text — NOT NULL
  • billing_period_type — text — NOT NULL
  • billing_period_start — numeric — NOT NULL
  • billing_period_end — numeric — NOT NULL
  • billing_due_day — numeric
  • late_fee_rate_percent — numeric
  • bank_name — text
  • bank_account — text
  • bank_holder — text
  • billing_monthly_fee_krw — numeric
  • selfbill_plan_confirmed_at — timestamptz — NOT NULL
  • selfbill_auto_bank_name — text — NOT NULL
  • selfbill_auto_bank_account — text — NOT NULL
  • selfbill_auto_bank_holder — text — NOT NULL
  • selfbill_auto_start_date — date — NOT NULL
  • setup_step — numeric
  • status — text
  • created_at — timestamptz
  • updated_at — timestamptz

invitations

  • Key — uuid — Primary key — NOT NULL
  • building_id — uuid — NOT NULL
  • unit_id — uuid — NOT NULL
  • tenant_name — text — NOT NULL
  • tenant_phone — text — NOT NULL
  • status — text
  • invited_at — timestamptz
  • accepted_at — timestamptz
  • created_at — timestamptz
  • updated_at — timestamptz

notification_logs

  • Key — uuid — Primary key — NOT NULL
  • user_id — uuid — NOT NULL
  • building_id — uuid — NOT NULL
  • to_phone — text — NOT NULL
  • channel — text — NOT NULL
  • event_type — text — NOT NULL
  • event_ref_id — text — NOT NULL — event_type에 따라 참조 대상이 바뀜
  • title — text
  • body — text
  • status — text
  • provider_message_id — text
  • error_message — text — API를 통한 발송 ID
  • sent_at — timestamptz
  • created_at — timestamptz
  • updated_at — timestamptz

payment_statuses

  • Key — VARCHAR(255) — Primary key — NOT NULL
  • building_id — uuid — NOT NULL
  • unit_id — uuid — NOT NULL
  • unit_charges_id — uuid — NOT NULL
  • year_month — text — NOT NULL
  • status — text
  • charged_amount — numeric
  • paid_amount — numeric
  • paid_at — timestamptz
  • memo — text
  • created_at — timestamptz
  • updated_at — timestamptz

role_change_requests

  • Key — uuid — Primary key — NOT NULL
  • building_id — uuid — NOT NULL
  • from_user_id — uuid
  • to_user_id — uuid
  • status — text
  • requested_at — timestamptz
  • responded_at — timestamptz
  • created_at — timestamptz
  • updated_at — timestamptz

unit_charges

  • Key — VARCHAR(255) — Primary key — NOT NULL
  • building_id — uuid — NOT NULL
  • unit_id — uuid — NOT NULL
  • bill_cycle_id — uuid — NOT NULL
  • year_month — text
  • amount_total — numeric
  • breakdown_json — jsonb — 청구서 핵심 데이터
  • late_fee_amount — numeric
  • after_due_amount — numeric — 총액 + 연체료
  • is_sent — boolean
  • sent_at — timestamptz
  • created_at — timestamptz
  • updated_at — timestamptz

units

  • Key — uuid — Primary key — NOT NULL
  • building_id — uuid — NOT NULL
  • dong — text — NOT NULL
  • ho — text — NOT NULL
  • floor — text — NOT NULL
  • unit_name — text — NOT NULL
  • tenant_name — text — NOT NULL
  • tenant_phone — text — NOT NULL
  • tenant_email — text — NOT NULL
  • is_owner — boolean
  • residents_count — numeric
  • move_in_date — date
  • car_count — numeric
  • car_numbers — text
  • share_ratio — numeric
  • needs_review — boolean
  • status — text
  • created_at — timestamptz
  • updated_at — timestamptz

user

  • Key — uuid — Primary key — NOT NULL
  • name — text — NOT NULL
  • email — text — NOT NULL
  • phone — text — NOT NULL
  • auth_provider — text — NOT NULL
  • created_at — uuid — NOT NULL
  • updated_at — uuid — NOT NULL