🏪
KALAKAL Hub
🏪 Hub 🖥️ POS Main ⚡ SUPER ADMIN
📡 Live Platform
📦Orders today
🏪Active stores
Pending orders
📅Orders this week
⚠️Dead stores
Total Stores
Open Now
Featured
Hidden
Total Products
Needs Attention
Store Town Type Status Health Score Orders Today Products Flags Actions
📋 Admin Action Log (this session)
No actions yet this session.
⭐ Featured Products Max 5
Manually pick products to appear in the Hub homepage "Featured Products" section.
Loading...
🗺️ Hub Regions Commerce Zones
Define commerce regions and which cities belong to each hub. A city can appear in multiple hubs (e.g. Tacloban in both Leyte and Samar). Stores whose city matches will appear in that hub's search.
Loading regions...
Hub ID (no spaces)
Hub Name
Cities (comma-separated)
⭐ Featured Stores Max 5
Manually pick stores to appear in the Hub homepage "Featured Stores" section.
Loading...
🏷️ Set Business Type per Store
Tag each store with a business type. This enables the Hub business type filter for buyers.
Loading stores...

📖 Hub Admin — User Manual

Read this before using any buttons. Some actions are permanent.

TOOLBAR BUTTONS
🔄 Refresh
Reloads all store data from Firestore. Safe to click anytime. No data is changed.
🔧 Repair Missing Stores
Scans ALL POS client accounts and creates a Hub listing for any store that is not yet visible in the Hub. Use this once to fix old accounts registered before the Hub listing feature was added. It skips stores already listed — it will NEVER overwrite or delete existing Hub data. Safe to run multiple times.
🗺️ Repair Hub Assignments
Assigns primaryHub and servingHubs to all existing stores that were registered before the hub zone system was added. You will be asked which Hub ID to assign (e.g. "leyte"). Stores that already have a hub assignment are SKIPPED — never overwritten. Run this once after first deployment to bring all old stores into your first hub. Safe to run multiple times.
Filter: All / Open / ⭐ Featured / Hidden / ⚠️ Dead
These are VIEW FILTERS only — they do NOT delete anything. They just change which stores you see in the table. "Dead" means stores with 0 products and 0 orders — they still exist, they just have no activity yet. Clicking any filter is 100% safe.
PER-STORE ACTION BUTTONS
🔗 View
Opens the store's online order page in a new tab. No data changed. Safe.
⭐ Feature / Unfeature
Marks a store as Featured so it appears at the top of the Hub with a star badge. Reversible — you can unfeature anytime. Does NOT delete anything.
👁 Hide / Unhide
WARNING: This makes the store invisible to the public in the Hub. The store still exists — it is NOT deleted. The store owner can still log in to their POS. You can unhide it anytime by clicking the button again. Use this for suspended or problematic stores.
📋 Plan Dropdown (— Set Plan — / POS Only / Hub Only / Full Suite)
Changes the store's subscription plan. A confirmation dialog will appear before any change is saved. "POS Only" will automatically hide the store from the public Hub. Will ask for confirmation before executing.
🗑 Delete (Trash Icon)
⚠️ PERMANENT — CANNOT BE UNDONE. This removes the store from the Hub directory and deletes all its Hub products. The POS account and sales data are NOT affected — the store owner can still log in. But their store will no longer appear in the Hub and must be re-added manually. Only use this if a store owner requests removal or for spam/fake stores.
STATS CARDS (TOP OF PAGE)
Total Stores — all stores in hub_stores collection.
Open Now — stores with isOpen = true.
Featured — stores marked as featured.
Hidden — stores hidden from public view (still exist).
Total Products — all products listed across all stores.
Needs Attention — stores with 0 products AND 0 orders (Dead stores). These are likely new accounts that haven't added products yet.
QUICK REFERENCE — SAFE vs PERMANENT
✅ ALWAYS SAFE (reversible):
Refresh, Filter buttons, View, Feature/Unfeature, Hide/Unhide, Plan change, Repair Missing Stores, Repair Hub Assignments, Hub Regions save/delete
⚠️ PERMANENT (cannot undo):
🗑 Delete (trash icon) — removes store from Hub permanently
HUB CONFIG TAB
🗺️ Hub Regions — Commerce Zones
Define the commerce zones for the platform. Each region has a Hub ID (e.g. "leyte"), a Hub Name (e.g. "Leyte Hub"), and a list of included cities (comma-separated).

A city can appear in multiple hubs — for example, Tacloban can be in both Leyte Hub and Samar Hub because it is an economic center for both areas.

First-time setup: Add Leyte Hub first with all cities in Leyte, then run 🗺️ Repair Hub Assignments from the Stores tab.
⭐ Featured Products / Featured Stores
Manually curate which products and stores appear in the Hub homepage spotlight sections. Max 5 each. These are fully reversible — add and remove anytime.
🏷️ Business Type per Store
Tag each store with a business type (e.g. Grocery, Restaurant, Pharmacy, Spa). This enables the business type filter chips on the Hub landing page for buyers.
HOW COMMERCE HUBS WORK
When a user selects a Hub Region in the Hub (e.g. Leyte Hub), the system shows only stores that match ANY of these conditions:

1. The store's servingHubs array includes that hub ID
2. The store's primaryHub equals that hub ID
3. The store's city/town is in the hub's includedCities list (fallback for older stores)

New stores registered after the hub system was deployed automatically get primaryHub: "leyte". Old stores need the 🗺️ Repair Hub Assignments button run once.
⚠️
Are you sure?
This action cannot be undone.