Data Models
Business data architecture — 55 entities across 1 models
Configuration (15)
Stores user-controlled accessibility settings including font scale factor, contrast mode, and haptic feedback configuration. Persisted local...
Defines a category of peer mentor activity within an organization's catalogue. Each type has metadata flags controlling travel expense eligi...
Stores the per-organization mapping from internal activity fields to official Bufdir export column names, date formats, and decimal separato...
Defines the fixed categories of allowable expenses (kilometers driven, toll road fees, parking, public transit). Expense types carry mutual ...
Defines an individual feature toggle for a specific organization, controlling which capabilities are visible (travel reimbursement, certific...
Defines how an internal data field maps to the corresponding field name and format in an external accounting or member management system. St...
Stores a user's opt-in or opt-out decision for each notification category (assignment_reminders, certificate_expiry, pause_status, scenario_...
Stores all organization-specific runtime configuration including feature flag JSONB, terminology label overrides JSONB, receipt amount thres...
Stores organisation-specific display labels used when warning a user or nearby listeners before a screen reader vocalises sensitive field co...
Defines the dynamic form field configuration for post-session reports on a per-organization basis. Specifies field types (text, multiline, c...
Defines a Bufdir reporting period (start and end date) for an organization, typically aligned to grant cycles. Organizations may configure p...
Defines the trigger conditions and message template for a context-aware scenario notification (e.g., 'no activity logged in 21 days', '50th ...
Defines which form fields are classified as sensitive personal data (e.g., address, contact details, medical history) requiring a spoken dis...
Configures the automated synchronization frequency and preferred time window for an organization integration. Supports daily, weekly, monthl...
Stores user-level feature-specific settings, primarily the boolean flag controlling whether sensitive field disclosure warnings are suppress...
Core Entities (31)
Core business record representing a peer mentor interaction or event, created through the accessible multi-step activity wizard. Captures th...
Represents the formal pairing of a peer mentor to a contact for ongoing support. Tracks status (open, pending, completed) and the date of la...
Defines a badge type within an organization's peer mentor recognition system. Includes display name, icon key, criteria type (activity_count...
A formal confidentiality agreement that Blindeforbundet drivers must electronically sign before accessing sensitive service recipient inform...
Represents an individual who is served by or associated with a peer mentor programme — a service recipient, family member, or professional r...
Junction entity linking a contact to an organization unit (chapter). A contact in NHF may belong to up to 5 local chapters simultaneously. T...
Stores the FCM push notification token for a user's registered device. Tokens are registered on login and refreshed automatically by Firebas...
A file (PDF, JPEG, PNG) attached to an activity record as supporting evidence for Bufdir audit purposes. Used by NHF to attach event invitat...
Records a Blindeforbundet-specific arrangement where a peer mentor provides transportation to a service recipient. Captures the transported ...
Stores the honorarium amount awarded to a peer mentor for providing transportation in a driver assignment. The fee amount is linked to organ...
Records that a specific peer mentor has earned a specific badge at a given timestamp. Award is idempotent — each badge can only be earned on...
Represents a reimbursement claim submitted by a peer mentor for travel and other expenses incurred during an activity. Claims go through a t...
Represents a generated Bufdir export file (PDF or Excel/CSV) for a specific organization and reporting period. Stores the Supabase Storage f...
Stores kilometer distance and route details for a mileage-based expense claim line. Linked one-to-one to an expense claim, capturing origin,...
Represents a single in-app or push notification delivered to a user. Notifications carry a type (assignment_reminder, certificate_expiry, pa...
Represents one of the partner organizations using the platform (NHF, Blindeforbundet, HLF, etc.). Each organization has its own branding, te...
Stores the configuration for a connection between the platform and an external system (Xledger accounting, HLF Dynamics portal, Bufdir API, ...
Represents a node in the organizational hierarchy such as a local chapter, regional office, or national association. Units form a recursive ...
Profile record for a peer mentor (likeperson), the primary subject of coordinator bulk registration and the actor who creates activity recor...
Tracks the HLF certification status of a peer mentor including issue date, expiry date, certification type, and a JSONB renewal history log....
A formalised structured report completed by a peer mentor after a home visit or one-on-one session. Fields are dynamically rendered from the...
Stores the metadata and Supabase Storage reference for a receipt image attached to an expense claim. Receipts are required when a claim amou...
Defines a recognition level (e.g., Bronze, Silver, Gold) with eligibility criteria, icon, and award period (annual, seasonal). Tiers are ass...
A saved template for activities that recur regularly (e.g., weekly group training sessions), used by coordinators during bulk proxy registra...
A unique code generated per peer mentor encoding their identity and organization in a shareable URL and QR code for the membership recruitme...
A generated notification instance created when a scenario rule's trigger conditions are satisfied for a specific peer mentor. Tracks whether...
Links a user to one or more organization units, defining their operational scope for activities and contacts. A coordinator may be assigned ...
Represents an authenticated system user account with a unique email address. Each user belongs to one or more organizations and is assigned ...
Assigns a specific role (peer_mentor, coordinator, org_admin, global_admin) to a user within an organization context. Role assignments deter...
Represents an authenticated user session storing JWT tokens and expiry metadata for persistent login. Sessions enable biometric re-authentic...
An individual follow-up action item extracted from the 'way forward' section of a post-session report. Each item represents a specific coord...
Derived Data (4)
A computed yearly summary of a peer mentor's contributions, powering the Spotify Wrapped-inspired annual impact feature. Contains total hour...
Represents a significant achievement threshold reached by a peer mentor (10th session, 50th session, 100 hours volunteered). Milestones are ...
Aggregated statistical snapshot of a peer mentor's performance used for badge evaluation, gamification scoring, and coordinator dashboard di...
A half-year or quarterly aggregated activity summary used for home screen progress cards and coordinator team overview dashboards. Includes ...
Audit & Tracking (5)
An append-only audit record for each Bufdir government reporting export operation, tracking initiating user, target period, pipeline status ...
An immutable audit trail entry recording a state transition in an expense claim's lifecycle (submitted, auto_approved, coordinator_approved,...
Records that a driver has explicitly confirmed reading and accepting a confidentiality declaration. Captures the driver identity, UTC acknow...
Records a single execution of an accounting system export to Xledger or the Dynamics portal. Tracks included expense claim IDs, export forma...
Records click and conversion events for member recruitment via referral codes. A click event is created when the referral URL is opened; a c...
Entity Relationships (67)
| From | Type | To | Description |
|---|---|---|---|
| accessibility_preferences | References | sensitive_field_definition | The screen reader active state in accessibility_preferences determines whether the sensitive field p |
| activity | Many-to-One | activity_type | Every activity record references the organization-specific activity type that determines its Bufdir |
| activity | One-to-Many | document_attachment | An activity record may have multiple supporting document attachments (invitations, screenshots, flye |
| activity | One-to-Many | driver_assignment | A Blindeforbundet activity involving transportation may have one or more driver assignments linked t |
| activity | One-to-One | expense_claim | A travel-eligible activity may have exactly one linked expense claim covering all expense lines for |
| activity | One-to-One | post_session_report | An activity requiring a structured report (based on activity type metadata) has exactly one linked p |
| bufdir_export_audit_log | References | report_period | A Bufdir export audit record references the target reporting period for traceability of which grant |
| certification | Belongs To | peer_mentor | A certification record belongs to exactly one peer mentor and tracks the full HLF certification life |
| confidentiality_declaration | One-to-One | declaration_acknowledgement | A sent confidentiality declaration has at most one acknowledgement record created when the driver ex |
| contact | One-to-Many | assignment | A contact may be assigned to peer mentors sequentially or simultaneously depending on organizational |
| contact | One-to-Many | contact_chapter | A contact (especially in NHF) may belong to up to 5 local chapters simultaneously through the contac |
| contact_chapter | Many-to-One | organization_unit | Each contact-chapter membership links to a specific organization unit (local chapter) in the hierarc |
| driver_assignment | One-to-One | confidentiality_declaration | Each Blindeforbundet driver assignment requires exactly one confidentiality declaration to be sent a |
| driver_assignment | One-to-One | driver_fee | Each driver assignment has exactly one fee record storing the agreed honorarium amount and acknowled |
| earned_badge | Many-to-One | badge_definition | Each earned badge record references the badge definition that specifies the criteria that were satis |
| expense_claim | One-to-Many | claim_event | Every state transition of an expense claim generates an immutable audit event forming a complete app |
| expense_claim | References | export_run | An approved expense claim is stamped with the export_run_id when it is first included in an accounti |
| expense_claim | One-to-One | mileage_claim | When a claim includes a kilometers-driven expense type, exactly one mileage_claim record stores the |
| expense_claim | One-to-One | receipt | When a claim amount exceeds the configured threshold, exactly one receipt image record is linked to |
| generated_report | Many-to-One | report_period | Each Bufdir export file references the reporting period it covers, ensuring traceability between rep |
| organisation_configuration | One-to-Many | feature_flag | Organisation configuration embeds the features JSONB whose individual entries are logically represen |
| organisation_configuration | One-to-Many | organisation_label | Organisation configuration embeds the full terminology label map whose individual entries are logica |
| organization | One-to-Many | activity_type | Each organization maintains its own catalogue of activity types with organization-specific names and |
| organization | One-to-Many | badge_definition | Each organization configures its own badge definitions matching its volunteer recognition programme |
| organization | One-to-One | bufdir_column_schema | Each organization has one active Bufdir column schema that maps internal fields to official Bufdir e |
| organization | One-to-Many | bufdir_export_audit_log | Bufdir export audit records are scoped to an organization for regulatory accountability |
| organization | One-to-Many | contact | All contacts are scoped to a single organization for multi-tenant data isolation via Supabase RLS |
| organization | One-to-Many | export_run | Accounting system export runs are scoped to an organization and used to track double-export preventi |
| organization | One-to-Many | generated_report | All Bufdir export files are scoped to the requesting organization for audit trail and re-download pu |
| organization | One-to-One | organisation_configuration | Each organization has exactly one configuration record containing feature flags, terminology labels, |
| organization | One-to-Many | organization_integration | An organization may have multiple external system integrations (Xledger, Dynamics, member management |
| organization | One-to-Many | organization_unit | An organization owns its entire hierarchy of units (chapters, regions, national associations) as roo |
| organization | One-to-Many | recognition_tier | Organizations configure their own tier structure (Bronze/Silver/Gold) with organization-specific thr |
| organization | One-to-Many | report_period | An organization defines its own Bufdir reporting periods aligned to its grant cycle calendar |
| organization | One-to-Many | sensitive_field_definition | An organization defines its own set of sensitive fields that require screen reader disclosure warnin |
| organization_integration | One-to-Many | field_mapping | An integration configuration contains multiple field mapping entries defining how internal fields ma |
| organization_integration | One-to-One | sync_schedule | Each integration has exactly one sync schedule configuring its automated execution frequency and pre |
| organization_unit | One-to-Many | activity | Activities are recorded within a specific chapter context for chapter-level Bufdir aggregation and c |
| organization_unit | One-to-Many | organization_unit | Organization units form a recursive parent-child hierarchy (national → region → local chapter) via a |
| organization_unit | One-to-Many | recurring_activity_template | Recurring activity templates are scoped to a chapter so coordinators only see templates relevant to |
| organization_unit | One-to-Many | scenario_rule | Scenario notification rules are configured per chapter so coordinators can enable or disable scenari |
| organization_unit | One-to-Many | unit_assignment | A chapter or regional unit has multiple users (coordinators, peer mentors) assigned to it for scoped |
| peer_mentor | One-to-Many | activity | A peer mentor is the attributed actor for all activities they conduct, regardless of whether they se |
| peer_mentor | One-to-Many | annual_summary | A peer mentor has one annual summary record per year for the Wrapped impact feature, supporting mult |
| peer_mentor | One-to-Many | assignment | A peer mentor holds multiple active and historical assignments to contacts across their service tenu |
| peer_mentor | One-to-One | certification | An HLF peer mentor has exactly one current certification record tracking issue date, expiry, and ren |
| peer_mentor | One-to-Many | earned_badge | A peer mentor accumulates earned badges over time as activity and engagement milestones are reached |
| peer_mentor | One-to-One | peer_mentor_stats | A peer mentor has one stats snapshot record that is recomputed on each activity event for gamificati |
| peer_mentor | One-to-Many | periodic_summary | A peer mentor has periodic summaries generated for each half-year and quarterly period they are acti |
| peer_mentor | One-to-Many | referral_code | A peer mentor may have multiple referral codes over time (active plus rotated/invalidated historical |
| peer_mentor | One-to-Many | scenario_prompt | A peer mentor receives scenario prompts when the rule engine detects trigger conditions in their act |
| periodic_summary | Belongs To | user | A periodic summary is computed for and owned by a specific user (peer mentor or coordinator) for the |
| post_session_report | References | report_field_schema | A post-session report is rendered using the organization's dynamic field schema active at the time o |
| post_session_report | One-to-Many | way_forward_item | A submitted post-session report generates one or more follow-up action items representing coordinato |
| referral_code | One-to-Many | recruitment_attribution | A referral code accumulates multiple attribution events (clicks and confirmed conversions) over its |
| report_field_schema | Many-to-One | organization | Each field schema is owned by exactly one organization and defines that organization's post-session |
| scenario_prompt | References | activity | A scenario prompt may reference the specific activity that triggered its generation, enabling deep-l |
| scenario_rule | One-to-Many | scenario_prompt | A scenario rule generates multiple prompt instances over time as its trigger conditions are met for |
| user | One-to-One | accessibility_preferences | Each user has exactly one accessibility preferences record controlling font scale, contrast mode, an |
| user | One-to-Many | device_token | A user may have FCM push tokens registered across multiple devices simultaneously |
| user | One-to-Many | notification | A user receives many notifications over their lifetime across all notification types |
| user | One-to-Many | notification_preference | A user has one preference record per notification category controlling opt-in and opt-out state |
| user | One-to-One | peer_mentor | A user account that holds the peer_mentor role is linked to exactly one peer_mentor profile record p |
| user | One-to-Many | session | A user may have multiple active sessions across different devices for biometric re-authentication |
| user | One-to-One | user_preferences | Each user has exactly one preferences record storing last-used activity type, default duration, and |
| user | One-to-Many | user_role | A user may hold multiple role assignments across different organizations (peer_mentor in one org, co |
| user_role | Many-to-One | organization | Each role assignment is scoped to a specific organization, enabling users to hold different roles in |