public.benefit_definitions
Synced from
docs/generated/erd/— do not hand-edit.
Regenerate withbun run docs:erd(needs staging reader), then this script runs automatically.
Labels:docs/db/erd-table-labels.yml· Runbook:docs/runbooks/erd-schema-docs.md
Description
Section titled “Description”Catalog of chamber benefits that member_entitlements allocate — Not: commerce_products (sellable SKUs)
Columns
Section titled “Columns”| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| benefit_type | text | ‘consumable’::text | false | |||
| category | text | ‘event’::text | false | |||
| created_at | timestamp with time zone | now() | false | |||
| description | text | true | ||||
| id | uuid | gen_random_uuid() | false | public.entitlements public.member_entitlements package_benefits tier_benefits |
||
| is_active | boolean | true | false | |||
| name | text | false | ||||
| org_id | text | ‘’::text | false | organizations |
||
| unit_type | text | ‘count’::text | false | |||
| updated_at | timestamp with time zone | now() | false |
Viewpoints
Section titled “Viewpoints”| Name | Definition |
|---|---|
| Membership & Billing | Members split-payload (members + member_profiles + member_billing + member_metrics), tiers, commerce/billable offers, billing agreements/subscriptions/transactions. Catalog §2.1–2.2, 2.4. Strong first-review cluster for Nathan/Craig. NAMING TRAP — “entitlement” is three different concepts (see docs/db/erd-table-labels.yml): commerce_entitlements = plan/agreement commercial limits; member_entitlements = chamber member benefit allocations; member_product_entitlements = external product provisioning (e.g. Bullseye). The bare entitlements table is NOT the commerce ledger (ADR #2581). |
| Sponsorships | Sponsorship offerings and bookings, event sponsor slots/fulfillment, sponsor impressions/placements, package benefits. Catalog §2.3. (Table names on staging: sponsorships / sponsorship_offerings — not sponsorship_inventory from older prose.) |
Constraints
Section titled “Constraints”| Name | Type | Definition |
|---|---|---|
| benefit_definitions_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| fk_benefit_definitions_org | FOREIGN KEY | FOREIGN KEY (org_id) REFERENCES organizations(id) |
Indexes
Section titled “Indexes”| Name | Definition |
|---|---|
| benefit_definitions_pkey | CREATE UNIQUE INDEX benefit_definitions_pkey ON public.benefit_definitions USING btree (id) |
Triggers
Section titled “Triggers”| Name | Definition |
|---|---|
| benefit_definitions_updated_at | CREATE TRIGGER benefit_definitions_updated_at BEFORE UPDATE ON public.benefit_definitions FOR EACH ROW EXECUTE FUNCTION update_updated_at_column() |
Relations
Section titled “Relations”erDiagram
"public.entitlements" }o--|| "public.benefit_definitions" : "FOREIGN KEY (benefit_definition_id) REFERENCES benefit_definitions(id) ON DELETE RESTRICT"
"public.member_entitlements" }o--|| "public.benefit_definitions" : "FOREIGN KEY (benefit_definition_id) REFERENCES benefit_definitions(id) ON DELETE RESTRICT"
"public.package_benefits" }o--|| "public.benefit_definitions" : "FOREIGN KEY (benefit_definition_id) REFERENCES benefit_definitions(id) ON DELETE CASCADE"
"public.tier_benefits" }o--|| "public.benefit_definitions" : "FOREIGN KEY (benefit_definition_id) REFERENCES benefit_definitions(id) ON DELETE CASCADE"
"public.benefit_definitions" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.benefit_definitions" {
uuid id ""
text org_id FK ""
}
"public.entitlements" {
uuid benefit_definition_id FK ""
uuid company_id FK ""
uuid id ""
uuid membership_unit_id FK ""
text org_id FK ""
uuid sponsor_subscription_id FK ""
}
"public.member_entitlements" {
uuid benefit_definition_id FK ""
uuid id ""
uuid member_id FK ""
text org_id FK ""
}
"public.package_benefits" {
uuid benefit_definition_id FK ""
text org_id FK ""
uuid sponsor_package_id FK ""
}
"public.tier_benefits" {
uuid benefit_definition_id FK ""
text org_id FK ""
uuid tier_id FK ""
}
"public.organizations" {
text association_id FK ""
text id ""
}
Generated by tbls

