Data Model
Overview

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

TablePurpose
locationsVenues/properties
productsProduct catalog (bottles, kegs, etc.)
products_tagLinks an RFID EPC to a product
rfid_eventsEvery tag scan — source of truth for tag location
device_configPer-device configuration blob (RFID settings, etc.)
location_device_configMany-to-many: which config rows belong to which location
rfid_tag_familiesSensor tag calibration data (one row per tag type)
storeroomsStorage areas, linked to a location
zonesService areas/outlets, linked to a location
product_inventory_stockCurrent stock count and tag assignment per storeroom

RLS policy summary

  • Authenticated users can SELECT on all core tables for their organization
  • Service role is required for INSERT/UPDATE/DELETE on most tables
  • rfid_tag_families is readable by all authenticated users; writes require service role
  • rfid_events is insert-only from the ingest pipeline (uses RFID_INGEST_KEY auth, not JWT)