럭키버거 public

테이블 (17)

accounts (계정)

  • id — BIGINT — 기본 키 — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • role — ENUM('USER','OWNER',ADMIN') — NOT NULL
  • createdAt (created_at) — TIMESTAMP — NOT NULL
  • modifiedAt (modified_at) — TIMESTAMP — NOT NULL
  • deletedAt (deleted_at) — TIMESTAMP

cart_menus (장바구니 메뉴)

  • id — BIGINT — 기본 키 — NOT NULL
  • accountId (account_id) — BIGINT — 외래 키 → carts.id — NOT NULL
  • shopMenuId (shop_menu_id) — BIGINT — 외래 키 → shop_menus.id — NOT NULL
  • quantity — INT — NOT NULL

carts (장바구니)

  • id — BIGINT — 외래 키 → users.id — NOT NULL
  • totalPrice (total_price) — BIGINT — NOT NULL

coupon_audit (쿠폰 발급 로그)

  • id — BIGINT — 기본 키 — NOT NULL
  • userId (user_id) — BIGINT — NOT NULL
  • couponId — BIGINT — NOT NULL
  • couponIssueStatus (coupon_issue_status) — ENUM('ISSUED','RESERVED','ALREADY_ISSUED','DUPLICATE_DB','NOT_OPENED','SOLD_OUT','RESERVE_EXPIRED','UNKNOWN_ERROR','RETRY_FAIL','COMPENSATE') — NOT NULL
  • reason — VARCHAR(255)
  • createAt (created_at) — TIMESTAMP — NOT NULL

coupon_policies (쿠폰 정책)

  • id — BIGINT — 기본 키 — NOT NULL
  • shopId (shop_id) — BIGINT — 외래 키 → shops.id — NOT NULL
  • couponId (coupon_id) — BIGINT — 외래 키 → coupons.id — NOT NULL
  • couponStatus (status) — ENUM('AVAILABLE', 'UNAVAILABLE) — NOT NULL

coupons (쿠폰)

  • id — BIGINT — 기본 키 — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • discount — BIGINT
  • count — INT — NOT NULL
  • expirationDate (expiration_date) — TIMPESTAMP — NOT NULL
  • type — ENUM('PERCENTAGE','FIXED') — NOT NULL
  • createdAt (created_at) — TIMESTAMP — NOT NULL
  • modifiedAt (modified_at) — TIMPSTAMP — NOT NULL
  • deletedAt (deleted_at) — TIMESTAMP

events (이벤트)

  • id — BIGINT — 기본 키 — NOT NULL
  • title — VARCHAR(100) — NOT NULL
  • description — VARCHAR(255) — NOT NULL
  • createdAt (created_at) — TIMESTAMP — NOT NULL
  • modifiedAt (modified_at) — TIMPSTAMP — NOT NULL
  • deletedAt (deleted_at) — TIMESTAMP

menus (메뉴)

  • id — BIGINT — 기본 키 — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • category — ENUM('HAMBURGER','SIDE','DRINK') — NOT NULL
  • price — BIGINT — NOT NULL

order_forms (주문서)

  • id — 기본 키 — NOT NULL
  • accountId (account_id) — BIGINT — 외래 키 → users.id — NOT NULL
  • shopMenuId (shop_menu_id) — BIGINT — 외래 키 → shop_menus.id — NOT NULL
  • quantity — INT — NOT NULL

order_menus (주문 메뉴)

  • id — 기본 키 — NOT NULL
  • orderId (order_id) — BIGINT — 외래 키 → orders.id — NOT NULL
  • shopMenuId (shop_menu_id) — BIGINT — 외래 키 → shop_menus.id — NOT NULL
  • quantity — INT — NOT NULL

orders (주문)

  • id — BIGINT — 기본 키 — NOT NULL
  • accountId (account_id) — BIGINT — 외래 키 → users.id — NOT NULL
  • shopId (shop_id) — BIGINT — 외래 키 → shops.id — NOT NULL
  • receiver — VARCHAR(50) — NOT NULL
  • phone — VARCHAR(50) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • street — VARCHAR(100) — NOT NULL
  • request — VARCHAR(255)
  • couponId (coupon_id) — BIGINT — 외래 키 → coupons.id
  • point — INT
  • totalPrice (total_price) — BIGINT — NOT NULL
  • pay — NOT NULL
  • orderDate (order_date) — TIMESTAMP — NOT NULL
  • status — ENUM('WAITING','COOKING','ON_DELIVERY','COMPLETED','CANCEL') — NOT NULL

owners (점주)

  • id — BIGINT — 외래 키 → accounts.id — NOT NULL
  • shopId (shop_id) — BIGINT — 외래 키 → shops.id — NOT NULL

reviews (리뷰)

  • id — BIGINT — 기본 키 — NOT NULL
  • accountId (account_id) — BIGINT — 외래 키 → users.id — NOT NULL
  • shopId (shop_id) — BIGINT — 외래 키 → shops.id — NOT NULL
  • orderId (order_id) — BIGINT — 외래 키 → orders.id — NOT NULL
  • content — VARCHAR(255)
  • rating — INT — NOT NULL
  • comment — VARCHAR(255)
  • createdAt (created_at) — TIMESTAMP — NOT NULL
  • modifiedAt (modified_at) — TIMPSTAMP — NOT NULL
  • deletedAt (deleted_at) — TIMESTAMP

shop_menus (매장별 메뉴)

  • id — BIGINT — 기본 키 — NOT NULL
  • shopId (shop_id) — BIGINT — 외래 키 → shops.id — NOT NULL
  • menuId (menu_id) — BIGINT — 외래 키 → menus.id — NOT NULL
  • status — ENUM('ON_SALE','OUT_OF_STOCK','DEACTIVATE') — NOT NULL
  • salesVolume (sales_volume) — BIGINT — NOT NULL

shops (매장)

  • id — BIGINT — 기본 키 — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • status — ENUM('OPEN', 'BREAK', 'CLOSED') — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • street — VARCHAR(100) — NOT NULL
  • createdAt (created_at) — TIMESTAMP — NOT NULL
  • modifiedAt (modified_at) — TIMPSTAMP — NOT NULL
  • deletedAt (deleted_at) — TIMESTAMP

user_coupons (유저 보유 쿠폰)

  • id — BIGINT — 기본 키 — NOT NULL
  • accountId (account_id) — BIGINT — 외래 키 → users.id — NOT NULL
  • couponId (coupon_id) — BIGINT — 외래 키 → coupons.id — NOT NULL
  • issueDate (issue_date) — TIMESTAMP — NOT NULL
  • usedDate (used_date) — TIMESTAMP

users (유저)

  • id — BIGINT — 외래 키 → accounts.id — NOT NULL
  • phone — VARCHAR(50) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • street — VARCHAR(100) — NOT NULL
  • point — INT — NOT NULL