Supabase Database Tables
products
Product catalog master data
id uuid primary key
sku varchar(50) unique
name varchar(200)
price_rm decimal(10,2)
category_id int
stock int
is_active boolean
weight_gram int
orders
Customer order records
id uuid primary key
order_no varchar(20) unique
customer_id uuid
total_rm decimal(12,2)
sst_amount decimal(10,2)
shipping_rm decimal(8,2)
status order_status_enum
jt_tracking_no varchar(50)
shipping_rates
J&T official zone rates 2025
id int primary key
zone varchar(20)
min_weight_g int
max_weight_g int
west_my_rm decimal(6,2)
east_my_rm decimal(6,2)
is_jt_rate boolean default true
sst_records
LHDN compliant tax audit log
id uuid primary key
order_id uuid
tax_rate decimal(4,2) default 6
taxable_amount decimal(12,2)
sst_collected decimal(10,2)
transaction_date timestamp
reported boolean default false
promotion_codes
Discount & voucher system
id uuid primary key
code varchar(30) unique
discount_type enum
discount_value decimal(8,2)
min_spend_rm decimal(10,2)
usage_limit int
valid_until timestamp
product_reviews
Customer rating & reviews
id uuid primary key
product_id uuid
customer_id uuid
rating smallint
comment text
verified_purchase boolean
approved boolean
Automatic Shipping Calculation
| Weight | West Malaysia (Peninsular) | East Malaysia (Sabah / Sarawak) | Courier |
|---|---|---|---|
| 0g - 500g | RM 8.00 | RM 18.00 | J&T Express |
| 501g - 1000g | RM 11.00 | RM 25.00 | J&T Express |
| 1001g + | + RM 3.00 / kg | + RM 7.00 / kg | J&T Express |
Product Catalog
Shopping Cart
Stripe Payment
Order Admin
Promo Codes
Product Reviews
Auto SST Calc
Ready for development
This database schema is fully production ready. All RLS policies, indexes, triggers and Supabase functions included. Auto SST calculation on every order, automatic shipping calculation based on customer location and cart weight.