Data Model
Schema Reference

Schema Reference

products

The product catalog. One row per SKU.

ColumnTypeDescription
idbigint PKAuto-increment
nametextProduct name (e.g. "Jack Daniel's Tennessee Whiskey")
skutextSKU / barcode
categorytextCategory (e.g. "Spirits")
size_mlnumericBottle/keg volume in mL
location_idbigint FKOwning location
created_attimestamptz

products_tag

Links an RFID tag (EPC) to a product.

ColumnTypeDescription
idbigint PK
product_idbigint FKReferences products.id
tag_epctextEPC identifier (uppercase hex, no spaces)
tag_idtextTID bank value (populated after first TID read)
tag_statustext"Active", "Offline", "Removed"
location_idbigint FK
created_attimestamptz

rfid_events

Every tag scan and movement event. The source of truth for where a tag was last seen.

See RFID Events for full documentation.

device_config

Stores arbitrary configuration blobs for devices. Used by Parlevel for per-location RFID settings.

ColumnTypeDescription
iduuid PK
configjsonbConfig payload. For RFID: { configType: "rfid_settings", u300: {...}, ... }
created_attimestamptz
updated_attimestamptz

location_device_config

Join table linking device configs to locations.

ColumnTypeDescription
idbigint PK
location_idbigint FKReferences locations.id
config_iduuid FKReferences device_config.id
updated_attimestamptz

A location can have multiple config rows (one per device type). Parlevel identifies the RFID config by config.configType === "rfid_settings".

When a config row is shared between multiple locations (e.g. a template was duplicated), saving an update for one location forks it into a new row rather than modifying the shared one.

rfid_tag_families

Calibration and classification parameters for sensor tag families.

ColumnTypeDescription
iduuid PK
nametext UNIQUEFamily identifier, e.g. "AZN3120-AFR"
tid_prefixtextFirst 3 bytes of TID bank (hex), e.g. "E28240"
descriptiontextHuman-readable description
calibrationjsonbArray of { sc, volumeMl } calibration points
level_bandsjsonbArray of { label, minSc, maxSc } level bands
min_readsintegerMinimum stable readings before emitting a level
ambiguous_zonesjsonbArray of { centerSc, halfWidthSc } hysteresis zones
created_attimestamptz
updated_attimestamptz

storerooms

Back-of-house storage areas.

ColumnTypeDescription
idbigint PK
nametextArea name
location_idbigint FKOwning location
reader_idtextRFID reader ID assigned to this area
statusinteger1 = active

zones

Service areas / outlets (bar stations, etc.).

ColumnTypeDescription
idbigint PK
nametextZone name
location_idbigint FKOwning location
zone_typetext"outlet", "bar", etc.
statusinteger1 = active