cai_tab
Tables (7)
menu_categories
- category_id — BIGINT — Primary key — NOT NULL
- category_name — VARCHAR(255) — NOT NULL
- display_order — INT
menu_items
- menu_id — BIGINT — Primary key — NOT NULL
- category_id — BIGINT — Foreign key → menu_categories.category_id — NOT NULL
- menu_name — VARCHAR(255) — NOT NULL
- price — INT — NOT NULL
- description — VARCHAR(255)
- image_url — VARCHAR(255)
- is_sold_out — BOOLEAN — NOT NULL
- created_at — DATETIME — NOT NULL
order_items
- order_item_id — BIGINT — Primary key — NOT NULL
- order_id — BIGINT — Foreign key → orders.order_id — NOT NULL
- menu_id — BIGINT — Foreign key → menu_items.menu_id — NOT NULL
- quantity — INT — NOT NULL
- unit_price — INT — NOT NULL
- subtotal — INT — NOT NULL
orders
- order_id — BIGINT — Primary key — NOT NULL
- table_id — BIGINT — Foreign key → tables.table_id — NOT NULL
- order_status — ENUM( 'PAYMENT_PENDING', 'APPROVED', 'REJECTED', 'COOKING', 'DONE', 'CANCELLED' ) — NOT NULL
- total_amount — INT — NOT NULL
- created_at — DATETIME — NOT NULL
- approved_at — DATETIME
- completed_at — DATETIME
payment_requests
- payment_request_id — BIGINT — Primary key — NOT NULL
- order_id — BIGINT — Foreign key → orders.order_id — NOT NULL
- payment_status — ENUM('PENDING', 'APPROVED', 'REJECTED') — NOT NULL
- requested_at — DATETIME — NOT NULL
- checked_at — DATETIME
- checked_by — BIGINT — Foreign key → staff.staff_id
staff
- staff_id — BIGINT — Primary key — NOT NULL
- password — VARCHAR(255) — NOT NULL
- staff_name — VARCHAR(255) — NOT NULL
- role — ENUM('ADMIN', 'STAFF') — NOT NULL
- created_at — DATETIME — NOT NULL
tables
- table_id — BIGINT — Primary key — NOT NULL
- table_number — INT — NOT NULL
- qr_token — VARCHAR(255) — NOT NULL
- status — ENUM('ACTIVE', 'INACTIVE') — NOT NULL
- created_at — DATETIME — NOT NULL