fad stock

Tables (7)

inventory

  • id — BIGSERIAL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • quantity — INTEGER — NOT NULL — 현재
  • updated_at — TIMESTAMP — NOT NULL

inventory_predictions

  • id — BIGSERIAL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • predicted_daily_sales — NUMERIC(10, 2) — NOT NULL
  • current_quantity — INTEGER — NOT NULL — 예측
  • expected_stockout_date — DATE — 예상
  • recommendation_quantity — INTEGER — NOT NULL — 추천
  • predicted_at — TIMESTAMP — NOT NULL — 예측

products

  • id — BIGSERIAL
  • store_id — BIGINT — Foreign key → stores.id — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • category — VARCHAR(100) — 상품
  • unit — VARCHAR(30) — NOT NULL — 상품
  • safety_stock — INTEGER — NOT NULL — 안전
  • is_active — BOOLEAN — NOT NULL — 상품
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

sales

  • id — BIGSERIAL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • sold_quantity — INTEGER — NOT NULL — 판매
  • sold_at — TIMESTAMP — NOT NULL — 판매
  • created_at — TIMESTAMP — NOT NULL

store_members

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • store_id — BIGINT — Foreign key → stores.id — NOT NULL
  • role — VARCHAR(30) — NOT NULL
  • created_at — TIMESTAMP — NOT NULL

stores

  • id — BIGSERIAL
  • name — VARCHAR(100) — NOT NULL
  • business_type — VARCHAR(100) — 업종
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

users

  • id — BIGSERIAL
  • email — VARCHAR(255) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL — 암호화된
  • name — VARCHAR(100) — NOT NULL — 사용자
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL