Product Numbers
Concrete product numbers/SKUs/revisions; the natural key referenced by parts
| Column Name | Data Type | Constraints |
|---|---|---|
| product_number | text | NOT NULL, PRIMARY KEY |
| product_id | bigint | NOT NULL, FK -> products |
| name | text | Optional display name, non-blank when set |
| gtin | text | unique when set (GS1 GTIN-8/12/13/14) |
| revision | text | |
| notes | text | |
| lifecycle | public.entity_lifecycle | DEFAULT 'active' NOT NULL |
| lifecycle_changed_at | timestamp with time zone | DEFAULT timezone('utc'::text, now()) NOT NULL |
| lifecycle_changed_by | uuid | |
| lifecycle_reason | text | |
| inserted_at | timestamp with time zone | DEFAULT timezone('utc'::text, now()) NOT NULL |
parts.product_number is a foreign key into this table.
Security Policies (RLS)
RLS enabled. Scope: Global, superadmin-managed catalog.
| Operation | has_herd_ability ability key | Other paths |
|---|---|---|
| SELECT | — | has_view_role_any_herd (herds.read in any herd), device API key, or superadmin |
| INSERT | — | Platform superadmin only |
| UPDATE | — | Platform superadmin only |
| DELETE | — | Platform superadmin only |
Platform superadmin: FOR ALL bypass where defined.