SnackDeal

Tables (18)

cartItem (cart_item)

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • quantity — INTEGER — NOT NULL
  • createdAt (created_at) — DATETIME — NOT NULL
  • updatedAt (updated_at) — DATETIME — NOT NULL
  • memberId (member_id) — BIGINT — Foreign key → member.id — NOT NULL
  • productId (product_id) — BIGINT — Foreign key → product.id — NOT NULL

category

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • name — VARCHAR(50) — NOT NULL — UNIQUE
  • sortOrder (sort_order) — INTEGER — NOT NULL
  • createdAt (created_at) — DATETIME — NOT NULL
  • updatedAt (updated_at) — DATETIME
  • deletedAt (deleted_at) — DATETIME

coupon

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • name — VARCHAR(50) — NOT NULL
  • discountType (discount_type) — VARCHAR(50) — NOT NULL
  • discountValue (discount_value) — BIGINT — NOT NULL
  • minOrderPrice (min_order_price) — BIGINT — NOT NULL — DEFAULT 0
  • validFrom (valid_from) — DATETIME — NOT NULL
  • validUntil (valid_until) — DATETIME
  • totalQuantity (total_quantity) — INTEGER — NOT NULL
  • issuedQuantity (issued_quantity) — INTEGER — NOT NULL
  • issueType (issue_type) — VARCHAR(50) — NOT NULL — EVENT, SIGNIN
  • isActive (is_active) — TINYINT(1) — NOT NULL — t/f , 강제 중지용
  • deletedAt (deleted_at) — DATETIME
  • updatedAt (updated_at) — DATETIME
  • createdAt (created_at) — DATETIME — NOT NULL
  • couponBoardId (coupon_board_id) — BIGINT — Foreign key → couponBoard.id

couponBoard (coupon_board)

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • title — VARCHAR(100) — NOT NULL
  • content — TEXT — NOT NULL
  • thumbnailUrl (thumbnail_url) — VARCHAR(255)
  • isActive (is_active) — TINYINT(1) — NOT NULL — t/f
  • startAt (start_at) — DATETIME — NOT NULL
  • endAt (end_at) — DATETIME
  • createdAt (created_at) — DATETIME — NOT NULL
  • updatedAt (updated_at) — DATETIME
  • deletedAt (deleted_at) — DATETIME

delivery

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • name — VARCHAR(50) — NOT NULL
  • receiver_name — VARCHAR(50) — NOT NULL
  • receiver_phone — VARCHAR(20) — NOT NULL
  • zipcode — VARCHAR(10) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • detail_address — VARCHAR(255)
  • is_default — TINYINT(1) — NOT NULL — 기본 배송지 여부
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME
  • deleted_at — DATETIME
  • memberId (member_id) — BIGINT — Foreign key → member.id — NOT NULL

emailVerification (email_verification)

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • email — VARCHAR(50) — NOT NULL
  • code — VARCHAR(10) — NOT NULL
  • verificationToken (verification_token) — VARCHAR(255)
  • codeExpiresAt (code_expires_at) — DATETIME — NOT NULL
  • tokenExpiresAt (token_expires_at) — DATETIME
  • verified — TINYINT(1) — NOT NULL
  • createdAt (created_at) — DATETIME — NOT NULL
  • memberId (member_id) — BIGINT — Foreign key → member.id

faq

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • type — VARCHAR(50) — NOT NULL — ORDER, SHIPPING, PRODUCT, OTHER
  • title — VARCHAR(50) — NOT NULL
  • content — TEXT — NOT NULL
  • createdAt (created_at) — DATETIME — NOT NULL
  • updatedAt (updated_at) — DATETIME
  • deletedAt (deleted_at) — DATETIME

member

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • email — VARCHAR(50) — NOT NULL — UNIQUE
  • password — VARCHAR(255) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • status — VARCHAR(50) — NOT NULL — ACTIVE, DELETED, INACTIVE
  • deletedAt (deleted_at) — DATETIME
  • updatedAt (updated_at) — DATETIME
  • createdAt (created_at) — DATETIME — NOT NULL
  • birth — DATE — NOT NULL
  • gender — VARCHAR(50) — NOT NULL — MALE, FEMALE
  • lastLogin (last_login) — DATETIME
  • role — VARCHAR(20) — NOT NULL — USER, ADMIN
  • phone — VARCHAR(50) — NOT NULL

notice

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • title — VARCHAR(50) — NOT NULL
  • content — TEXT — NOT NULL
  • isPinned (is_pinned) — TINYINT(1) — NOT NULL — t/f
  • createdAt (created_at) — DATETIME — NOT NULL
  • updatedAt (updated_at) — DATETIME
  • deletedAt (deleted_at) — DATETIME

orderItem (order_item)

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • productName (product_name) — VARCHAR(50) — NOT NULL
  • price — BIGINT — NOT NULL
  • quantity — INTEGER — NOT NULL
  • productId (product_id) — BIGINT — Foreign key → product.id — NOT NULL
  • orderId (order_id) — BIGINT — Foreign key → orders.id — NOT NULL

orders

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • orderNumber (order_number) — VARCHAR(50) — NOT NULL — UNIQUE
  • productAmount (product_amount) — BIGINT — NOT NULL
  • shippingFee (shipping_fee) — BIGINT — NOT NULL
  • discountAmount (discount_amount) — BIGINT — NOT NULL
  • finalAmount (final_amount) — BIGINT — NOT NULL
  • status — VARCHAR(50) — NOT NULL — PENDING_PAYMENT , PAYMENT_COMPLETED , PREPARING_SHIPMENT , SHIPPED , COMPLETED , CANCELLED, REFUND_REQUESTED, REFUND_CO…
  • orderedAt (ordered_at) — DATETIME — NOT NULL
  • cancelledAt (cancelled_at) — DATETIME
  • createdAt (created_at) — DATETIME — NOT NULL
  • updatedAt (updated_at) — DATETIME
  • deletedAt (deleted_at) — DATETIME
  • memberId (member_id) — BIGINT — Foreign key → member.id — NOT NULL
  • userCouponId (user_coupon_id) — BIGINT — Foreign key → userCoupon.id

payment

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • impUid (imp_uid) — VARCHAR(255)
  • merchantUid (merchant_uid) — VARCHAR(255)
  • amount — BIGINT — NOT NULL
  • payMethod (pay_method) — VARCHAR(50) — CARD, TRANS, VBANK 등 결제수단
  • pgProvider (pg_provider) — VARCHAR(50) — tosspayments, kakaopay 등
  • status — VARCHAR(50) — NOT NULL — READY, PAID, FAILED, CANCELLED
  • receiptUrl (receipt_url) — VARCHAR(255)
  • paidAt (paid_at) — DATETIME
  • cancelledAt (cancelled_at) — DATETIME
  • createdAt (created_at) — DATETIME — NOT NULL
  • updatedAt (updated_at) — DATETIME
  • orderId (order_id) — BIGINT — Foreign key → orders.id — NOT NULL — UNIQUE

product

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • name — VARCHAR(50) — NOT NULL
  • price — BIGINT — NOT NULL
  • description — TEXT
  • status — VARCHAR(50) — NOT NULL — ACTIVE, DELETED, INACTIVE
  • stock — INTEGER — NOT NULL
  • recentSalesCount (recent_sales_count) — BIGINT — NOT NULL
  • deletedAt (deleted_at) — DATETIME
  • updatedAt (updated_at) — DATETIME
  • createdAt (created_at) — DATETIME — NOT NULL
  • categoryId (category_id) — BIGINT — Foreign key → category.id — NOT NULL

productImage (product_image)

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • attachmentUrl (attachment_url) — TEXT — NOT NULL
  • sortOrder (sort_order) — INTEGER — NOT NULL
  • productId (product_id) — BIGINT — Foreign key → product.id — NOT NULL

qna

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • type — VARCHAR(50) — NOT NULL — ORDER, SHIPPING, PRODUCT, OTHER
  • title — VARCHAR(50) — NOT NULL
  • content — TEXT — NOT NULL
  • attachmentUrl (attachment_url) — TEXT — 추후 상의 경로만? 유효기간?
  • isAnswered (is_answered) — TINYINT(1) — NOT NULL — true/ false
  • createdAt (created_at) — DATETIME — NOT NULL
  • updatedAt (updated_at) — DATETIME
  • deletedAt (deleted_at) — DATETIME
  • memberId (member_id) — BIGINT — Foreign key → member.id — NOT NULL

qnaAnswer (qna_answer)

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • content — TEXT — NOT NULL
  • answeredAt (answered_at) — DATETIME — NOT NULL
  • qnaId (qna_id) — BIGINT — Foreign key → qna.id — NOT NULL — UNIQUE

shipping

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • orderId (order_id) — BIGINT — Foreign key → orders.id — NOT NULL — UNIQUE
  • receiverName (receiver_name) — VARCHAR(50) — NOT NULL
  • receiverPhone (receiver_phone) — VARCHAR(20) — NOT NULL
  • zipcode — VARCHAR(10) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • detailAddress (detail_address) — VARCHAR(255)
  • deliveryRequest (delivery_request) — VARCHAR(100)
  • courier — VARCHAR(50)
  • trackingNumber (tracking_number) — VARCHAR(100)
  • status — VARCHAR(50) — NOT NULL — READY, PREPARING, SHIPPING, DELIVERED
  • shippedAt (shipped_at) — DATETIME
  • deliveredAt (delivered_at) — DATETIME
  • createdAt (created_at) — DATETIME — NOT NULL
  • updatedAt (updated_at) — DATETIME

userCoupon (user_coupon)

  • id — BIGINT — Primary key — NOT NULL — AUTO_INCREMENT
  • status — VARCHAR(50) — NOT NULL — ACTIVE, USED , EXPIRED
  • issuedAt (issued_at) — DATETIME — NOT NULL
  • usedAt (used_at) — DATETIME
  • memberId (member_id) — BIGINT — Foreign key → member.id — NOT NULL
  • couponId (coupon_id) — BIGINT — Foreign key → coupon.id — NOT NULL