DeliShare

Tables (9)

CartImage (방장이 업로드한 장바구니 사진)

  • id (Key) — Primary key — NOT NULL
  • image_url (Field)
  • created_at (Field2)
  • room_id (Key2) — Foreign key → Room.id — NOT NULL

MenuItem (참가자가 입력한 메뉴)

  • id (Key) — Primary key — NOT NULL
  • menu_name (Field) — UNIQUE
  • quantity (Field2)
  • price (Field3)
  • is_locked (주문 확정 잠금 여부)
  • created_at (Field4)
  • updated_at (Field5)
  • room_id (Key2) — Foreign key → Room.id — NOT NULL
  • user_id (Key3) — Foreign key → User.id — NOT NULL

Payment (에스크로 결제 (참가자별))

  • id (Key) — Primary key — NOT NULL
  • food_amount (음식값)
  • delivery_fee_share (배달비 분담금)
  • total_amount (총 결제 금액)
  • payment_status (Field) — 'HELD', 'RELEASED', 'REFUNDED'
  • paid_at (결제 시간)
  • released_at (정산 시간)
  • room_id (Key2) — Foreign key → Room.id — NOT NULL
  • payer_user_id (참여자) — Foreign key → User.id — NOT NULL
  • receiver_user_id (방장) — Foreign key → User.id — NOT NULL

QRScan (참가자의 QR 스캔 기록)

  • id (Key) — Primary key — NOT NULL
  • scanned_at (Field)
  • qr_session_id (Key2) — Foreign key → QRSession.id — NOT NULL
  • user_id (Key3) — Foreign key → User.id — NOT NULL
  • payment_id (Key4) — Foreign key → Payment.id — NOT NULL

QRSession (Untitled)

  • id (Key) — Primary key — NOT NULL
  • qr_token (Field) — UNIQUE
  • expired_at (Field2)
  • created_at (Field3)
  • room_id (Key2) — Foreign key → Room.id — NOT NULL

Room (공동 배달방)

  • id (Key) — Primary key — NOT NULL
  • restaurant_name (Field)
  • restaurant_url (배달 플랫폼 링크)
  • delivery_platform (Field2)
  • min_order_amount (최소 주문 금액)
  • delivery_fee (총 배달비)
  • max_participants (최대 인원)
  • current_participants (현재 인원)
  • address (수령 위치)
  • latitude (수령 위치 위도)
  • longitude (수령 위치 경도)
  • status (Field3) — 'OPEN', 'ORDERING', 'DONE', 'CLOSED'
  • created_at (Field4)
  • updated_at (Field5)
  • user_id (Key2) — Foreign key → User.id — NOT NULL

RoomParticipant (방 참가 정보)

  • id (Key) — Primary key — NOT NULL
  • role (Field) — 'HOST', 'PARTICIPANT'
  • order_confirmed (주문 확정 여부)
  • cart_confirmed (장바구니 확인 여부)
  • room_id (Key2) — Foreign key → Room.id — NOT NULL
  • user_id (Key3) — Foreign key → User.id — NOT NULL

SavedLocation (사용자가 저장한 주소(수령 위치))

  • id (Key) — Primary key — NOT NULL
  • location_name (Field)
  • address (Field2)
  • latitude (위도)
  • longitude (경도)
  • is_default (기본 위치 여부)
  • created_at (Field3)
  • user_id (Key2) — Foreign key → User.id — NOT NULL

User (사용자 정보)

  • id (Key) — Primary key — NOT NULL
  • device_uuid (Field) — UNIQUE
  • nickname (Field2) — UNIQUE
  • created_at (Field3)
  • updated_at (Field4)