Data Model Overview
Parlevel uses Supabase (PostgreSQL) as its primary database. Row Level Security (RLS) is enabled on all tables — users only see data for their organization's locations.
Core entity relationships
organizations
│
└── locations (venues / properties)
│
├── storerooms (back-of-house storage areas)
│ └── product_inventory_stock
│ └── products_tag ──► products
│
├── zones (service areas / outlets)
│ └── (via rfid_events.to_location_id)
│
├── device_config (RFID settings, per location)
│
└── rfid_events (every tag scan / movement event)Key tables
| Table | Purpose |
|---|---|
locations | Venues/properties |
products | Product catalog (bottles, kegs, etc.) |
products_tag | Links an RFID EPC to a product |
rfid_events | Every tag scan — source of truth for tag location |
device_config | Per-device configuration blob (RFID settings, etc.) |
location_device_config | Many-to-many: which config rows belong to which location |
rfid_tag_families | Sensor tag calibration data (one row per tag type) |
storerooms | Storage areas, linked to a location |
zones | Service areas/outlets, linked to a location |
product_inventory_stock | Current stock count and tag assignment per storeroom |
RLS policy summary
- Authenticated users can
SELECTon all core tables for their organization - Service role is required for
INSERT/UPDATE/DELETEon most tables rfid_tag_familiesis readable by all authenticated users; writes require service rolerfid_eventsis insert-only from the ingest pipeline (usesRFID_INGEST_KEYauth, not JWT)