Uniconvert_final
Tables (21)
auth_identity
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL — OAuth 제공자의 고유 식별값(sub)
- provider — VARCHAR(30) — NOT NULL — Apple Hide My Email 포함
- provider_subject — VARCHAR(255) — NOT NULL — 원문 저장 금지
- provider_email — VARCHAR(255) — 로그아웃/비밀번호 변경 시 전체 무효화 (RCV-06, SET-03)
- created_at — TIMESTAMP — NOT NULL
- =소셜 — 로그인
budget
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL
- year_month — VARCHAR(7) — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
category
- id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(50) — NOT NULL — PRELIMINARY(18시 이전 임시) / FINAL(확정)
- icon_key — VARCHAR(255) — 유저당 정확히 1개만 존재 (WALL-01)
- sort_order — TINYINT — NOT NULL
- is_active — BOOLEAN — NOT NULL
- created_at — TIMESTAMP — NOT NULL
currency
- code — VARCHAR(3) — Primary key — NOT NULL — 마지막 선택 시각. 사용자가 카테고리를 바꿀 때마다 갱신
- name_ko — VARCHAR(50) — NOT NULL
- name_en — VARCHAR(50) — NOT NULL
- symbol — VARCHAR(5) — NOT NULL — MORNING(09:00) / NOON(13:00) / EVENING(18:00) (RATE-01)
- is_supported — BOOLEAN — NOT NULL — ECOS, exchangerate.host 등 원천 API
email_verification_token
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL — 발급 후 1시간 (RCV-05)
- token — VARCHAR(255) — NOT NULL — SERVICE, PRIVACY, MARKETING
- expires_at — TIMESTAMP — NOT NULL — 예: v1.0
- used_at — TIMESTAMP
- created_at — TIMESTAMP — NOT NULL
exchange_rate_daily
- id — BIGINT — Primary key — NOT NULL
- local_currency_code — VARCHAR(3) — NOT NULL
- home_currency_code — VARCHAR(3) — NOT NULL
- rate_date — DATE — NOT NULL
- rate_value — DECIMAL(10, 4) — NOT NULL — 잠금 Pot 여부. "지금 써도 되는 돈" 계산에서 제외 (WALL-04)
- source — VARCHAR(20) — NOT NULL — 환전 환율 고정 모드 여부
- sample_count — TINYINT — NOT NULL — is_rate_fixed=TRUE일 때만 값 존재
- status — VARCHAR(20) — NOT NULL — 신규 보완 삭제 대신 보관 처리. 거래내역·잔액은 유지, 목록에서만 숨김 (WALL-06)
- created_at — TIMESTAMP — NOT NULL
exchange_rate_snapshot
- id — BIGINT — Primary key — NOT NULL
- local_currency_code — VARCHAR(3) — NOT NULL
- home_currency_code — VARCHAR(3) — NOT NULL
- rate_date — DATE — NOT NULL
- collection_slot — VARCHAR(10) — NOT NULL — LOCAL_ACCOUNT(현지계좌) / CASH(현금) / POT(목적별)
- rate_value — DECIMAL(10, 4) — NOT NULL
- source — VARCHAR(30) — NOT NULL — 현지 통화 기준 잔액
- collected_at — TIMESTAMP — NOT NULL
- =하루 — 3회(09/13/18시
expense
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL
- category_id — BIGINT — Foreign key → category.id — NOT NULL
- wallet_id — BIGINT — Foreign key → sub_wallet.id — NOT NULL — 홈 통화 기준 월 예산. 0이면 미설정과 동일 처리 (SET-02)
- local_currency_code — VARCHAR(3) — NOT NULL
- local_amount — DECIMAL(12, 2) — NOT NULL
- applied_rate — DECIMAL(10, 4) — NOT NULL
- merchant_name_normalized — VARCHAR(255)
- expense_date — DATE — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
fixed_expense
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL
- category_id — BIGINT — Foreign key → category.id — NOT NULL
- wallet_id — BIGINT — Foreign key → sub_wallet.id — NOT NULL
- amount — DECIMAL(12, 2) — NOT NULL
- recurrence_type — VARCHAR(10) — NOT NULL
- is_active — BOOLEAN — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
fixed_expense_occurrence
- scheduled_date — DATE — Primary key — NOT NULL
- id — BIGINT — NOT NULL
- fixed_expense_id — BIGINT — Foreign key → fixed_expense.id — NOT NULL
local_credential
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL — BCrypt 암호화값. 최소 8자, 영문·숫자 조합 필수 (AUTH-06)
- password_hash — VARCHAR(255) — NOT NULL — 인증 전 로그인 불가 (AUTH-07)
- is_email_verified — BOOLEAN — NOT NULL — 연속 실패 횟수, 성공 시 0 초기화
- failed_login_count — TINYINT — NOT NULL — 한 user가 Google/Apple 등 복수 소셜 수단을 가질 수 있음 (1:N)
- locked_until — TIMESTAMP
- password_changed_at — TIMESTAMP
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
main_wallet
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL — 이 송금에 적용된 환율
- balance — DECIMAL(14, 2) — NOT NULL — 서브 지갑(현지 통화) 기준 입금액
- created_at — TIMESTAMP — NOT NULL
main_wallet_transaction
- id — BIGINT — Primary key — NOT NULL
- main_wallet_id — BIGINT — Foreign key → main_wallet.id — NOT NULL
- type — VARCHAR(20) — NOT NULL — sub_wallet.id 참조
- amount — DECIMAL(14, 2) — NOT NULL — 당시 실제 적용 환율(시스템 평균 또는 직접입력)
- memo — VARCHAR(100)
- created_at — TIMESTAMP — NOT NULL
merchant_category_preference
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL
- merchant_name — VARCHAR(255) — NOT NULL — DEPOSIT(입금 기록) / MANUAL_SET(직접 잔액 설정) / TRANSFER_OUT(서브 지갑 송금 차감)
- category_id — BIGINT — Foreign key → category.id — NOT NULL
- updated_at — TIMESTAMP — NOT NULL — 변동 금액(부호로 증감 표현)
password_reset_token
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL — 예: £, €, $, ₩
- token — VARCHAR(255) — NOT NULL
- expires_at — TIMESTAMP — NOT NULL — 운영 토글. v1.0 지원 통화(USD/EUR/JPY/CNY/GBP)만 TRUE
- used_at — TIMESTAMP
- created_at — TIMESTAMP — NOT NULL
refresh_token
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL
- token_hash — VARCHAR(255) — NOT NULL — 인증 메일 링크에 포함되는 랜덤 문자열
- expires_at — TIMESTAMP — NOT NULL
- revoked_at — TIMESTAMP — 발급 후 24시간 (AUTH-06)
- created_at — TIMESTAMP — NOT NULL
- =세션 — 토큰.
sub_wallet
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL
- name — VARCHAR(50) — NOT NULL — 당시 환산 결과
- wallet_type — VARCHAR(20) — NOT NULL — 텐텐 채택 거래 당시 user.home_currency 스냅샷. 이후 홈 통화 변경과 무관하게 보존
- local_currency_code — VARCHAR(3) — NOT NULL
- balance — DECIMAL(14, 2) — NOT NULL — 카테고리 자동 추천용 정규화 값
- category_id — BIGINT — Foreign key → category.id — sub_wallet.id 참조(선택)
- is_locked — BOOLEAN — NOT NULL — 예: 기숙사비, 통신비
- is_rate_fixed — BOOLEAN — NOT NULL — MONTHLY / WEEKLY / SEMESTER
- fixed_rate — DECIMAL(10, 4) — 매월 N일 (recurrence_type=MONTHLY)
- is_archived — BOOLEAN — NOT NULL — 소온 채택 매주 N요일, 1~7 (recurrence_type=WEEKLY)
- created_at — TIMESTAMP — NOT NULL
- =서브 — 지갑(현지 계좌/현금/목적별 Pot
terms_agreement
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL
- terms_type — VARCHAR(30) — NOT NULL — 식비·교통·학비·기숙사·쇼핑·의료·비자·여가·기타 등
- terms_version — VARCHAR(255) — NOT NULL — 프론트 아이콘 연결 키
- is_agreed — BOOLEAN — NOT NULL
- agreed_at — TIMESTAMP
- =신규 — 가입
user
- id — BIGINT — Primary key — NOT NULL
- email — VARCHAR(255) — NOT NULL — 가입 이메일. 모든 인증수단(local_credential, auth_identity)이 공유하는 식별 기준
- nickname — VARCHAR(255) — 온보딩 중 또는 이후 설정
- status — VARCHAR(30) — NOT NULL — ACTIVE, WITHDRAWN 등
- home_currency — VARCHAR(10) — 온보딩 1단계(B101)에서 설정. 모든 환율 환산의 기준값. 온보딩 전엔 NULL
- onboarding_step — TINYINT — NOT NULL — 0~3단계
- is_onboarding_completed — BOOLEAN — NOT NULL
- timezone — VARCHAR(50) — NOT NULL — 예: Europe/London
- withdrawn_at — TIMESTAMP — 탈퇴 시 기록 (SET-04)
- rejoin_available_at — TIMESTAMP — 탈퇴 후 재가입 제한 기준
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
user_local_currency
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → user.id — NOT NULL
- currency_code — VARCHAR(3) — Foreign key → currency.code — NOT NULL — SYSTEM_AVG / MANUAL (RATE-04 직접 입력 태그 구분용)
- created_at — TIMESTAMP — NOT NULL
- =유저가 — 등록한
wallet_transfer
- id — BIGINT — Primary key — NOT NULL
- main_wallet_id — BIGINT — Foreign key → main_wallet.id — NOT NULL
- sub_wallet_id — BIGINT — Foreign key → sub_wallet.id — NOT NULL
- home_amount — DECIMAL(14, 2) — NOT NULL — 이번 회차 결제 예정일
- applied_rate — DECIMAL(10, 4) — NOT NULL — SCHEDULED / CREATED / SKIPPED
- local_amount — DECIMAL(14, 2) — NOT NULL — CREATED 전환 시각
- is_rate_fixed_applied — BOOLEAN — NOT NULL — CREATED 시 생성된 expense.id 연결
- memo — VARCHAR(255)
- created_at — TIMESTAMP — NOT NULL
- =메인→서브 — 송금·환전