businesses
0 rows
Top-level tenant. Every shop / samosa business lives here.
- Referenced by ←
- users.business_id
- categories.business_id
- products.business_id
- customers.business_id
- +7 more
subscription_plans
0 rows
Available SaaS plans (pricing tiers).
- Referenced by ←
- business_subscriptions.plan_id
business_subscriptions
0 rows
Links a business to its active plan.
- Points to →
- business_id → businesses
- plan_id → subscription_plans
users
0 rows
Staff accounts scoped to a business (owner, cashier, etc.).
- Points to →
- business_id → businesses
- Referenced by ←
- sales.user_id
- expenses.created_by
- inventory_transactions.created_by
- orders.user_id
categories
0 rows
Product groupings per business (e.g. Samosas, Drinks).
- Points to →
- business_id → businesses
- Referenced by ←
- products.category_id
global_categories
0 rows
Platform-wide product categories shared by all businesses.
- Referenced by ←
- global_products.global_category_id
global_products
0 rows
Shared catalog items (Coca Cola, Rice, etc.) managed by the platform.
- Points to →
- global_category_id → global_categories
- Referenced by ←
- products.global_product_id
products
0 rows
Business inventory — may link to global_products or be fully custom.
- Points to →
- business_id → businesses
- category_id → categories
- global_product_id → global_products
- Referenced by ←
- sale_items.product_id
- purchase_items.product_id
- inventory_transactions.product_id
- order_items.product_id
customers
0 rows
People who buy from the business (in-store or online).
- Points to →
- business_id → businesses
- Referenced by ←
- sales.customer_id
suppliers
0 rows
Vendors you purchase stock from.
- Points to →
- business_id → businesses
- Referenced by ←
- purchases.supplier_id
sales
0 rows
A completed or pending in-store sale (invoice header).
- Points to →
- business_id → businesses
- customer_id → customers
- user_id → users
- Referenced by ←
- sale_items.sale_id
sale_items
0 rows
Line items inside a sale — links products to quantities sold.
- Points to →
- sale_id → sales
- product_id → products
purchases
0 rows
Stock bought from a supplier.
- Points to →
- business_id → businesses
- supplier_id → suppliers
- Referenced by ←
- purchase_items.purchase_id
purchase_items
0 rows
Line items inside a purchase.
- Points to →
- purchase_id → purchases
- product_id → products
expense_categories
0 rows
Buckets for expenses (rent, transport, gas…).
- Points to →
- business_id → businesses
- Referenced by ←
- expenses.category_id
expenses
0 rows
Money spent, recorded by a user under a category.
- Points to →
- business_id → businesses
- category_id → expense_categories
- created_by → users
inventory_transactions
0 rows
Stock in/out audit trail per product.
- Points to →
- business_id → businesses
- product_id → products
- created_by → users
orders
0 rows
Online customer orders (web client checkout).
- Points to →
- user_id → users
- Referenced by ←
- order_items.order_id
- mpesa_transactions.order_id
order_items
0 rows
Products in an online order.
- Points to →
- order_id → orders
- product_id → products
mpesa_transactions
0 rows
M-Pesa STK push records tied to online orders.
- Points to →
- order_id → orders