e-commerce

Tables (7)

Balance (잔액)

  • PK (id) — Long — Primary key — NOT NULL
  • PK (id2) — Long — Foreign key → User.PK — NOT NULL
  • 사용자 식별자 (userId) — Long — NOT NULL
  • 금액 (amount) — Long — NOT NULL
  • 최근 갱신 일자 (updatedAt) — Date — NOT NULL

Cart (장바구니)

  • PK (id) — Long — Primary key — NOT NULL
  • 사용자 식별자 (userId) — Long — Foreign key → User.PK — NOT NULL

CartItem (장바구니 아이템)

  • PK (id) — Long — Primary key — NOT NULL
  • 장바구니 식별자 (cartId) — Long — Foreign key → Cart.PK — NOT NULL
  • 제품 식별자 (productId) — Long — Foreign key → Product.PK — NOT NULL
  • 제품 수량 (quantity) — int — NOT NULL
  • 장바구니 추가 일자 (createdAt) — Date — NOT NULL
  • 장바구니 삭제 일자 (deletedAt) — Date — NOT NULL

Order (주문)

  • PK (id) — Long — Primary key — NOT NULL
  • 사용자 식별자 (userId) — Long — Foreign key → User.PK — NOT NULL
  • 총 금액 (totalAmount) — int — NOT NULL
  • 주문 상태 (status) — ENUM — NOT NULL
  • 주문 생성 일자 (createdAt) — Date — NOT NULL

OrderItem (주문 아이템)

  • PK (id) — Long — Primary key — NOT NULL
  • 주문 식별자 (orderId) — Long — Foreign key → Order.PK — NOT NULL
  • 제품 식별자 (productId) — Long — Foreign key → Product.PK — NOT NULL
  • 제품 주문 수량 (quantity) — int — NOT NULL
  • 제품 수량 만큼의 총 금액 (unitPrice) — int — NOT NULL
  • 주문 상태 (status) — ENUM — NOT NULL
  • 주문 아이템 생성 일자 (createdAt) — Date — NOT NULL

Product (제품)

  • PK (id) — Long — Primary key — NOT NULL
  • 제품 이름 (name) — String — NOT NULL
  • 제품 가격 (price) — int — NOT NULL
  • 남은 수량 (quantity) — int — NOT NULL
  • 생성 일자 (createdAt) — Date — NOT NULL
  • 최근 갱신 일자 (updatedAt) — Date — NOT NULL

User (사용자)

  • PK (id) — Long — Primary key — NOT NULL
  • 사용자 이름 (name) — String — NOT NULL
  • 이메일 (email) — String — NOT NULL
  • 로그인 아이디 (loginId) — String — NOT NULL
  • 비밀번호 (password) — String — NOT NULL
  • 회원 활성화 여부 (isActive) — Boolean — NOT NULL
  • 생성 일자(가입 일자) (createdAt) — Date — NOT NULL
  • 최근 갱신 일자 (updatedAt) — Date — NOT NULL