asdasd mvp

Tables (24)

auth_refresh_tokens

  • refresh_token_id — BIGINT — Primary key — NOT NULL — Refresh Token 식별자
  • member_id — BIGINT — Foreign key → members.member_id — NOT NULL
  • token_family_id — BINARY(16) — NOT NULL — 회전 토큰 패밀리 UUID
  • token_hash — CHAR(64) — NOT NULL — Refresh Token SHA-256 해시
  • parent_token_id — BIGINT — Foreign key → auth_refresh_tokens.refresh_token_id — 회전 전 토큰
  • issued_at — DATETIME — NOT NULL
  • expires_at — DATETIME — NOT NULL
  • rotated_at — DATETIME
  • revoked_at — DATETIME
  • reuse_detected_at — DATETIME

chat_messages

  • message_id — BIGINT — Primary key — NOT NULL
  • chat_room_id — BIGINT — Foreign key → chat_rooms.chat_room_id — NOT NULL
  • sender_id — BIGINT — Foreign key → members.member_id — 시스템 메시지는 NULL
  • message_type — VARCHAR(20) — NOT NULL — TEXT, SYSTEM
  • content — TEXT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • edited_at — DATETIME
  • deleted_at — DATETIME

chat_room_members

  • chat_room_member_id — BIGINT — Primary key — NOT NULL
  • chat_room_id — BIGINT — Foreign key → chat_rooms.chat_room_id — NOT NULL
  • member_id — BIGINT — Foreign key → members.member_id — NOT NULL
  • trip_id — BIGINT — Foreign key → trips.trip_id — 참가 이벤트를 반영할 여정
  • membership_status — VARCHAR(20) — NOT NULL — ACTIVE, LEFT
  • participation_status — VARCHAR(30) — NOT NULL — JOINED, CONFIRMED, ATTENDED, NO_SHOW, CANCELED, WITHDREW_AFTER_HOLD
  • joined_at — DATETIME — NOT NULL
  • left_at — DATETIME
  • confirmed_at — DATETIME
  • attended_at — DATETIME
  • canceled_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

chat_rooms

  • chat_room_id — BIGINT — Primary key — NOT NULL
  • event_id — BIGINT — Foreign key → events.event_id — NOT NULL
  • host_member_id — BIGINT — Foreign key → members.member_id — NOT NULL
  • room_name — VARCHAR(100) — NOT NULL
  • room_description — VARCHAR(500)
  • max_members — INT — NOT NULL
  • join_deadline — DATETIME — NOT NULL
  • deposit_amount — DECIMAL(19, 4) — NOT NULL
  • deposit_currency — CHAR(3) — NOT NULL
  • room_status — VARCHAR(20) — NOT NULL — RECRUITING, CLOSED, ONGOING, ENDED, DELETED
  • meeting_place — VARCHAR(200)
  • meeting_latitude — DECIMAL(10, 7)
  • meeting_longitude — DECIMAL(10, 7)
  • meeting_at — DATETIME
  • notice_content — TEXT
  • deleted_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

deposits

  • deposit_id — BIGINT — Primary key — NOT NULL
  • chat_room_member_id — BIGINT — Foreign key → chat_room_members.chat_room_member_id — NOT NULL
  • chat_room_id — BIGINT — Foreign key → chat_room_members.chat_room_id — NOT NULL — 보증금 대상 채팅방
  • member_id — BIGINT — Foreign key → wallets.member_id — NOT NULL — 보증금 납부 회원
  • wallet_id — BIGINT — Foreign key → wallets.wallet_id — NOT NULL — 보증금 출금 지갑
  • amount — DECIMAL(19, 4) — NOT NULL
  • currency — CHAR(3) — NOT NULL
  • deposit_status — VARCHAR(20) — NOT NULL — PENDING, HELD, REFUNDED, DEDUCTED, FAILED
  • held_at — DATETIME
  • settled_at — DATETIME — 환불 또는 차감 완료 시각
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

event_views

  • event_id — BIGINT — Foreign key → events.event_id — NOT NULL
  • member_id — BIGINT — Foreign key → members.member_id — NOT NULL
  • view_count — INT — NOT NULL
  • first_viewed_at — DATETIME — NOT NULL
  • last_viewed_at — DATETIME — NOT NULL

events

  • event_id — BIGINT — Primary key — NOT NULL — 이벤트 식별자
  • creator_id — BIGINT — Foreign key → members.member_id — NOT NULL — 이벤트 생성 회원
  • title — VARCHAR(200) — NOT NULL
  • description — TEXT — NOT NULL
  • category_code — VARCHAR(40) — NOT NULL — PERFORMANCE_EXHIBITION, FOOD, SPORTS, SHOPPING, POPUP
  • event_type — VARCHAR(20) — NOT NULL — OFFICIAL, UNOFFICIAL
  • hashtags_json — JSON — 해시태그 문자열 배열
  • thumbnail_url — VARCHAR(500)
  • place_name — VARCHAR(200) — NOT NULL
  • address — VARCHAR(500) — NOT NULL
  • latitude — DECIMAL(10, 7) — NOT NULL
  • longitude — DECIMAL(10, 7) — NOT NULL
  • start_at — DATETIME — NOT NULL
  • end_at — DATETIME — NOT NULL
  • event_status — VARCHAR(20) — NOT NULL — DRAFT, UPCOMING, ONGOING, ENDED, CANCELED
  • visibility_status — VARCHAR(30) — NOT NULL — VISIBLE, HIDDEN_BY_ADMIN, DELETED_BY_ADMIN
  • deleted_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

fx_rates

  • fx_rate_id — BIGINT — Primary key — NOT NULL
  • base_currency — CHAR(3) — NOT NULL — 외화
  • quote_currency — CHAR(3) — NOT NULL — MVP 상대 통화는 KRW
  • rate — DECIMAL(19, 8) — NOT NULL
  • provider — VARCHAR(50) — NOT NULL
  • quoted_at — DATETIME — NOT NULL
  • created_at — DATETIME — NOT NULL

member_term_agreements

  • agreement_id — BIGINT — Primary key — NOT NULL
  • member_id — BIGINT — Foreign key → members.member_id — NOT NULL
  • term_id — BIGINT — Foreign key → terms.term_id — NOT NULL
  • agreed_at — DATETIME — NOT NULL

members

  • member_id — BIGINT — Primary key — NOT NULL — 회원 식별자
  • display_name — VARCHAR(50) — NOT NULL — 서비스 표시 이름
  • profile_image_url — VARCHAR(500) — 프로필 이미지 URL
  • nationality_code — VARCHAR(10) — 국가 코드(예: KR, JP, US)
  • preferred_language — VARCHAR(10) — NOT NULL — 선호 언어 코드
  • base_currency — CHAR(3) — NOT NULL — 표시 기준 통화
  • role_code — VARCHAR(20) — NOT NULL — MEMBER, ADMIN
  • member_status — VARCHAR(20) — NOT NULL — ACTIVE, BLOCKED, WITHDRAWN
  • onboarding_completed_at — DATETIME — 온보딩 완료 시각
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

notifications

  • notification_id — BIGINT — Primary key — NOT NULL
  • recipient_member_id — BIGINT — Foreign key → members.member_id — NOT NULL
  • category — VARCHAR(20) — NOT NULL — EVENT, SETTLEMENT, PAYMENT, REPORT, SYSTEM
  • notification_type — VARCHAR(50) — NOT NULL
  • source_event_id — VARCHAR(100) — NOT NULL — 동일 알림 중복 방지용 이벤트 식별자
  • title — VARCHAR(200) — NOT NULL
  • body — VARCHAR(1000) — NOT NULL
  • target_type — VARCHAR(30) — EVENT, CHAT_ROOM, SETTLEMENT, TRANSACTION, REPORT
  • target_id — BIGINT
  • action_path — VARCHAR(500) — 서비스 내부 상대 경로만 저장
  • is_read — BOOLEAN — NOT NULL
  • read_at — DATETIME
  • created_at — DATETIME — NOT NULL

payment_webhook_events

  • webhook_event_id — BIGINT — Primary key — NOT NULL
  • provider — VARCHAR(20) — NOT NULL — STRIPE, PAYPAL
  • provider_event_id — VARCHAR(255) — NOT NULL
  • topup_order_id — BIGINT — Foreign key → topup_orders.topup_order_id
  • event_type — VARCHAR(100) — NOT NULL
  • signature_verified — BOOLEAN — NOT NULL
  • payload_hash — CHAR(64) — NOT NULL — 민감 payload 원문 대신 SHA-256 저장
  • processing_status — VARCHAR(20) — NOT NULL — RECEIVED, PROCESSED, IGNORED, FAILED
  • error_code — VARCHAR(100)
  • received_at — DATETIME — NOT NULL
  • processed_at — DATETIME

qr_payment_requests

  • qr_request_id — BIGINT — Primary key — NOT NULL
  • payee_wallet_id — BIGINT — Foreign key → wallets.wallet_id — NOT NULL
  • qr_token_hash — CHAR(64) — NOT NULL — QR 원문 토큰의 SHA-256 해시
  • qr_type — VARCHAR(20) — NOT NULL — WALLET, PAYMENT
  • amount — DECIMAL(19, 4) — NULL이면 결제자가 입력
  • currency — CHAR(3) — NOT NULL
  • memo — VARCHAR(255)
  • request_status — VARCHAR(20) — NOT NULL — ACTIVE, COMPLETED, EXPIRED, CANCELED
  • expires_at — DATETIME — NOT NULL
  • created_at — DATETIME — NOT NULL
  • completed_at — DATETIME

report_shares

  • share_id — BIGINT — Primary key — NOT NULL
  • report_id — BIGINT — Foreign key → reports.report_id — NOT NULL
  • report_version — INT — NOT NULL
  • share_token_hash — CHAR(64) — NOT NULL — 공개 URL 토큰의 SHA-256 해시
  • visible_sections — JSON — NOT NULL
  • snapshot_json — JSON — NOT NULL — 공유 시점의 불변 리포트 스냅샷
  • expires_at — DATETIME
  • revoked_at — DATETIME
  • created_at — DATETIME — NOT NULL

reports

  • report_id — BIGINT — Primary key — NOT NULL
  • trip_id — BIGINT — Foreign key → trips.trip_id — NOT NULL
  • member_id — BIGINT — Foreign key → trips.member_id — NOT NULL — 여정 소유권 검증용
  • generation_status — VARCHAR(20) — NOT NULL — QUEUED, GENERATING, READY, FAILED
  • generation_type — VARCHAR(20) — NOT NULL — FULL, AI_CONTENT
  • replace_existing — BOOLEAN — NOT NULL
  • version_number — INT — NOT NULL
  • retry_count — INT — NOT NULL
  • locale — VARCHAR(10) — NOT NULL
  • display_currency — CHAR(3) — NOT NULL
  • included_sections — JSON
  • editable_sections — JSON
  • visibility_selections — JSON
  • title — VARCHAR(200)
  • generation_basis_at — DATETIME — 재생성 시에도 고정할 산출 기준 시각
  • fx_snapshot_json — JSON
  • trip_period_json — JSON
  • spending_summary_json — JSON
  • ai_content_json — JSON
  • sections_json — JSON
  • last_error_code — VARCHAR(100)
  • requested_at — DATETIME — NOT NULL
  • started_at — DATETIME
  • generated_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

settlement_participants

  • settlement_participant_id — BIGINT — Primary key — NOT NULL
  • settlement_id — BIGINT — Foreign key → settlements.settlement_id — NOT NULL
  • chat_room_member_id — BIGINT — Foreign key → chat_room_members.chat_room_member_id — NOT NULL
  • chat_room_id — BIGINT — Foreign key → chat_room_members.chat_room_id — NOT NULL — 정산 채팅방 소속 검증용
  • member_id — BIGINT — Foreign key → chat_room_members.member_id — NOT NULL — 정산금을 낼 회원
  • share_amount — DECIMAL(19, 4) — NOT NULL
  • participant_status — VARCHAR(20) — NOT NULL — ACTIVE, EXCLUDED
  • request_status — VARCHAR(20) — NOT NULL — PENDING, ACCEPTED, REJECTED, PAID, CANCELED, FAILED
  • request_message — VARCHAR(500)
  • due_at — DATETIME
  • reject_reason — VARCHAR(500)
  • paid_transaction_id — BIGINT — Foreign key → wallet_transactions.transaction_id — 실제 TRANSFER 거래
  • sent_at — DATETIME
  • responded_at — DATETIME
  • paid_at — DATETIME
  • last_reminded_at — DATETIME
  • reminder_count — INT — NOT NULL
  • excluded_at — DATETIME
  • exclusion_reason — VARCHAR(500)
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

settlements

  • settlement_id — BIGINT — Primary key — NOT NULL
  • chat_room_id — BIGINT — Foreign key → chat_rooms.chat_room_id — NOT NULL
  • created_by_member_id — BIGINT — Foreign key → members.member_id — NOT NULL — 정산 생성자
  • payer_member_id — BIGINT — Foreign key → members.member_id — NOT NULL — 원 결제 선결제자
  • source_transaction_id — BIGINT — Foreign key → wallet_transactions.transaction_id — MVP에서는 대표 원 결제 거래 1개
  • settlement_status — VARCHAR(20) — NOT NULL — DRAFT, REQUESTED, IN_PROGRESS, COMPLETED, CANCELED, FAILED
  • split_method — VARCHAR(20) — NOT NULL — MVP에서는 EQUAL만 지원
  • total_amount — DECIMAL(19, 4) — NOT NULL — 원 결제 전체 금액
  • payer_share_amount — DECIMAL(19, 4) — NOT NULL
  • receivable_amount — DECIMAL(19, 4) — NOT NULL — 다른 참여자 부담금 합계
  • currency — CHAR(3) — NOT NULL
  • memo — VARCHAR(500)
  • requested_at — DATETIME
  • completed_at — DATETIME
  • canceled_at — DATETIME
  • cancel_reason — VARCHAR(500)
  • version — BIGINT — NOT NULL — 동시 송금 상태 갱신용
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

social_accounts

  • social_account_id — BIGINT — Primary key — NOT NULL — 소셜 계정 식별자
  • member_id — BIGINT — Foreign key → members.member_id — NOT NULL — 연결 회원
  • provider — VARCHAR(20) — NOT NULL — GOOGLE, LINE, WECHAT
  • provider_user_id — VARCHAR(255) — NOT NULL — 공급자 사용자 식별자
  • provider_email — VARCHAR(320) — 공급자가 검증한 이메일; 회원 자동 병합 키로 사용하지 않음
  • connected_at — DATETIME — NOT NULL

terms

  • term_id — BIGINT — Primary key — NOT NULL — 약관 식별자
  • term_code — VARCHAR(50) — NOT NULL — 약관 종류 코드
  • version — VARCHAR(20) — NOT NULL — 약관 버전
  • title — VARCHAR(200) — NOT NULL
  • content — LONGTEXT
  • required — BOOLEAN — NOT NULL
  • effective_at — DATETIME — NOT NULL
  • created_at — DATETIME — NOT NULL

topup_orders

  • topup_order_id — BIGINT — Primary key — NOT NULL
  • wallet_id — BIGINT — Foreign key → wallets.wallet_id — NOT NULL
  • provider — VARCHAR(20) — NOT NULL — STRIPE, PAYPAL
  • provider_payment_id — VARCHAR(255) — PaymentIntent ID 또는 PayPal Order ID
  • provider_capture_id — VARCHAR(255)
  • amount — DECIMAL(19, 4) — NOT NULL
  • currency — CHAR(3) — NOT NULL
  • topup_status — VARCHAR(20) — NOT NULL — PENDING, READY, CREATED, APPROVED, SUCCESS, FAILED, CANCELED
  • idempotency_key — VARCHAR(100) — NOT NULL
  • return_url — VARCHAR(1000)
  • cancel_url — VARCHAR(1000)
  • created_at — DATETIME — NOT NULL
  • completed_at — DATETIME
  • balance_reflected_at — DATETIME

trips

  • trip_id — BIGINT — Primary key — NOT NULL — 여정 식별자
  • member_id — BIGINT — Foreign key → members.member_id — NOT NULL — 여정 소유 회원
  • title — VARCHAR(100) — NOT NULL
  • start_date — DATE — NOT NULL
  • end_date — DATE — NOT NULL
  • budget_amount — DECIMAL(19, 4)
  • budget_currency — CHAR(3)
  • companion_preference — VARCHAR(30)
  • regions_json — JSON — {code, name, displayOrder}
  • interest_codes_json — JSON — 관심사 코드 배열
  • deleted_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

wallet_ledger_entries

  • ledger_entry_id — BIGINT — Primary key — NOT NULL
  • transaction_id — BIGINT — Foreign key → wallet_transactions.transaction_id — NOT NULL
  • wallet_id — BIGINT — Foreign key → wallets.wallet_id — NOT NULL
  • entry_sequence — SMALLINT — NOT NULL — 거래 내 원장 순서
  • balance_bucket — VARCHAR(20) — NOT NULL — AVAILABLE, HELD
  • entry_direction — VARCHAR(10) — NOT NULL — DEBIT, CREDIT
  • amount — DECIMAL(19, 4) — NOT NULL
  • balance_after — DECIMAL(19, 4) — NOT NULL
  • created_at — DATETIME — NOT NULL

wallet_transactions

  • transaction_id — BIGINT — Primary key — NOT NULL
  • transaction_number — VARCHAR(50) — NOT NULL — 외부 노출 거래 번호
  • initiator_member_id — BIGINT — Foreign key → members.member_id — NOT NULL — 거래를 시작한 회원
  • topup_order_id — BIGINT — Foreign key → topup_orders.topup_order_id
  • qr_request_id — BIGINT — Foreign key → qr_payment_requests.qr_request_id
  • deposit_id — BIGINT — Foreign key → deposits.deposit_id
  • fx_rate_id — BIGINT — Foreign key → fx_rates.fx_rate_id
  • transaction_type — VARCHAR(30) — NOT NULL — TOP_UP, QR_PAYMENT, TRANSFER, DEPOSIT_HOLD, DEPOSIT_REFUND, DEPOSIT_DEDUCTION
  • transaction_status — VARCHAR(20) — NOT NULL — PENDING, SUCCESS, FAILED, CANCELED
  • amount — DECIMAL(19, 4) — NOT NULL — 대표 거래 금액; 방향은 원장 항목에서 표현
  • currency — CHAR(3) — NOT NULL
  • spending_category — VARCHAR(20) — FOOD, BEAUTY, K_POP, SHOPPING, ETC
  • spending_type — VARCHAR(20) — PERSONAL, SETTLEMENT
  • memo — VARCHAR(255)
  • idempotency_key — VARCHAR(100)
  • created_at — DATETIME — NOT NULL
  • completed_at — DATETIME

wallets

  • wallet_id — BIGINT — Primary key — NOT NULL
  • member_id — BIGINT — Foreign key → members.member_id — NOT NULL
  • currency — CHAR(3) — NOT NULL
  • available_balance — DECIMAL(19, 4) — NOT NULL
  • held_balance — DECIMAL(19, 4) — NOT NULL
  • wallet_status — VARCHAR(20) — NOT NULL — ACTIVE, RESTRICTED, CLOSED
  • version — BIGINT — NOT NULL — 낙관적 잠금 버전
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL