Data Layer
126 components in the data layer layer
Data Layer components manage data persistence, storage operations, and data access patterns throughout the application.
Data access layer responsible for reading and writing the selected organization ID to device-local storage (SharedPreferences). Abstracts th...
Data layer repository providing a stable interface for authentication persistence operations. Manages local session caching via secure stora...
Secure local storage adapter for OAuth tokens (Vipps, BankID) and Supabase session data. Uses Flutter Secure Storage to encrypt tokens at re...
Manages persistence and retrieval of verified user identity data in Supabase, including personnummer obtained via Vipps Login and BankID ver...
Encrypted key-value store backed by flutter_secure_storage that persists the Supabase session token, its expiry timestamp, and the user's bi...
Fetches and caches user role assignments from Supabase, providing a data access layer between the role resolution service and the database. ...
Read-only repository that retrieves the admin portal URL and the list of roles blocked from mobile access. Sources configuration from Supaba...
Data access layer for activity records, providing CRUD operations against the Supabase activities table. Implements an optimistic insert pat...
Local persistence layer for user-specific registration preferences, specifically the last-used activity type ID. Uses the shared local stora...
Riverpod AsyncNotifier that fetches activity types on login and holds them in memory for the session. Serves cached data to UI and service l...
Data access layer that wraps all Supabase queries for the activity_types table. Enforces row-level security by always including org_id in qu...
Handles all CRUD operations for post-session report records in Supabase. Ensures every report is stored with its parent activity_id foreign ...
In-memory and optional local-storage cache for org-specific report field schemas. Reduces Supabase round-trips when the user opens multiple ...
Manages persistence of way-forward follow-up items in Supabase, linked to their parent report. Supports coordinator workflows by providing q...
Data access layer for all expense records in Supabase. Provides CRUD operations for expense claims, queries for attestation queues, and filt...
Repository managing the configurable catalogue of expense types and their mutual exclusion group definitions. Fetches the catalogue from Sup...
Adapter encapsulating all interactions with Supabase Storage for receipt image management. Handles image compression before upload, generate...
Data access layer extending the base activity repository to support the recorded_by_user_id field introduced for proxy registrations. Provid...
Riverpod provider that exposes the coordinator's peer mentor contact list filtered and ready for use in proxy and bulk selection UIs. Caches...
Typed Dart data classes representing the stats domain: StatsSnapshot (totals for a given scope and time window), PeerMentorStatRow (one row ...
Data access component that queries Supabase materialized views or database views to retrieve pre-aggregated activity statistics. Avoids clie...
Transforms aggregated internal activity data into the canonical Bufdir JSON payload structure. This intermediate representation is consumed ...
Constructs parameterised Supabase queries for fetching activity data within the selected scope and period. Encapsulates complex join logic a...
Data access layer for the generated_reports table. Each export attempt creates a record with org scope, period, format, status, and file ref...
Data access layer that wraps the Supabase RPC for duplicate detection. Constructs the parameterised RPC call with peer_mentor_id, activity_t...
Repository that provides coordinator-scoped queries for activities where duplicate_reviewed is false and a matching sibling record exists. E...
Riverpod providers that expose role-aware contact and peer mentor streams to the UI layer. Manages loading, error, and data states using Asy...
Data access layer for contacts and peer mentors backed by Supabase. All queries are scoped by organization ID and rely on Supabase Row Level...
Dedicated repository for querying assignment records associated with contacts in the Blindeforbundet context, including status history and l...
Data access layer for retrieving and updating full contact profiles, including extended attributes like chapter affiliations, encrypted fiel...
Data access layer for Blindeforbundet assignment records linked to a peer mentor. Fetches assigned contacts with their open/closed assignmen...
Data access layer for HLF certification records stored in Supabase. Fetches certification expiry dates, completion history, and linked cours...
Data access layer for fetching aggregated activity statistics scoped to a single peer mentor. Queries the activity log table in Supabase wit...
Data access layer for peer mentor profile records in Supabase. Provides typed Dart models for peer mentor data including profile fields, pau...
Data access layer for reading and writing peer mentor status fields in Supabase. Manages the status enum (active, paused, inactive), pause t...
Data access layer for the contact_chapters junction table in Supabase, providing CRUD operations for contact-to-chapter many-to-many relatio...
Specialized query component that retrieves all activity records for a specific contact across all chapters they are affiliated with. Used ex...
Maintains a local Drift SQLite cache of contacts and notes fetched from Supabase, used by the offline search repository. Refreshes the cache...
Searches the locally cached contacts stored in the Drift SQLite database when the device is offline. Provides the same interface as the Supa...
Executes debounced ilike queries against the Supabase contacts and notes tables, searching by name, organization affiliation, and notes keyw...
Data access layer for proxy activity records in Supabase. Stores both the acting coordinator ID and the attributed peer mentor ID on every p...
Manages persistent recurring activity templates used by coordinators for bulk registration. Templates store default activity type, duration,...
Data access layer for reading and writing peer mentor location data stored as PostGIS points in Supabase. Supports spatial bounding box quer...
Defines the canonical enum of expense types (kilometers, tolls, parking, public transit), their display metadata (labels, icons, description...
Manages persistence of expense type selections as part of an expense record in the travel and expense registration flow. Reads and writes th...
Abstracts all Supabase read/write operations for mileage claim records. Handles inserting new claims with their computed status, fetching cl...
Fetches and caches the organisation-level per-km reimbursement rate and auto-approval threshold from Supabase. Provides reactive access so t...
Persists and retrieves the association between expense claim records and their Supabase Storage receipt paths in the Supabase database. Ensu...
Manages file upload and retrieval operations against Supabase Storage using an org/user/claim-scoped path strategy. Enforces access boundari...
Stores coordinator approval and rejection decisions, including actor identity, timestamp, and comment, linked to the parent expense claim. P...
Data access layer for the claim_events audit table. Inserts timestamped event records for every state transition and exposes ordered read ac...
Repository managing the current status field on expense claim records. Provides targeted read/write access for the workflow service to updat...
Data access layer for confidentiality declaration records, including acknowledgement state and storage references. Maintains a declarations ...
Abstracts Supabase Storage operations for encrypted declaration files. Handles upload, download, and signed URL generation for declaration b...
Manages organization-specific confidentiality declaration templates stored in the database. Provides versioned template retrieval so that hi...
Data access layer for driver assignment records, supporting CRUD operations and query patterns needed by the driver assignment service. Pers...
Queries the database for approved expense claims within a configurable date range, grouped by peer mentor and expense type as required by ac...
Maps internal expense claim field names and expense types to the target accounting system's chart of accounts codes. Maintains per-org mappi...
Data access layer for persisting and querying export run metadata. Each export run record stores the timestamp, triggering user, organizatio...
Constructs the Supabase RPC calls and view queries that perform server-side aggregation, leveraging PostgreSQL's aggregation capabilities to...
Data access layer for reading raw activity/event/contact data and persisting computed Bufdir metric snapshots. Wraps Supabase table queries ...
Enforces strict per-organization data isolation across all database queries, ensuring that NHF, Blindeforbundet, HLF, and Barnekreftforening...
Read-only data access layer that queries the aggregated activity records used by the Bufdir reporting pipeline. Shared with the Bufdir Data ...
Reads and writes organization-specific Bufdir period preset configurations from Supabase. Supports per-organization agreement dates so that ...
Provides data access for the preview feature, including fetching the aggregated report figures for the selected period and retrieving prior-...
Supabase Storage adapter managing upload, retrieval, and signed URL generation for exported Bufdir report files. Enforces organization-scope...
Data access layer for persisting and querying Bufdir report history records in the organization-scoped Supabase table. Handles all CRUD oper...
Dart model classes and serialization logic for all proxy and bulk registration domain objects. Includes ProxyActivityRecord, ProxyActivityDr...
Data access layer for all proxy and bulk activity records. Provides CRUD operations against Supabase with support for the registered_by / at...
Supabase data access layer for peer mentor certification records. Stores certification type, issue date, expiry date, and renewal status. Us...
Supabase data access layer for peer mentor status records and pause history. Manages the peer_mentor_status table including current status e...
Data access layer for all admin portal queries, including aggregated statistics, user lists, activity logs, and org structure. All queries a...
BLoC state management for the admin portal screens, coordinating dashboard stats, org hierarchy selection, user list state, and export progr...
Persists and retrieves per-organisation Bufdir column schema configurations in Supabase. Allows Norse Digital Products to update column mapp...
Provides CRUD access to the Bufdir export audit log table in Supabase. Enforces append-only semantics for completed records to maintain an i...
Data access layer for the activity_attachments table in Supabase. Handles insert, soft delete, and query operations for attachment metadata ...
Data access layer for peer mentor certification records stored in Supabase. Manages CRUD operations on the certifications table and JSONB re...
In-memory cache for statistics query results with a 15-minute TTL to avoid repeated heavy Supabase queries. Cache is keyed by (coordinatorId...
Data access layer that queries Supabase pre-aggregated views for activity statistics. All queries target views pre-aggregated by org_id + co...
Manages per-user per-category notification opt-in preferences stored in Supabase. Provides a local cache to avoid repeated round-trips durin...
Supabase-backed repository for persisting received notifications and managing read state. Provides a real-time stream of unread count via Su...
Data access layer for reading and updating the last_contact_date field per assignment. Provides queries needed by the evaluation service to ...
Data access layer for persisting and retrieving in-app notification records displayed in the Notifications tab. Supports read/unread state, ...
Data access layer for reading and writing organisation-specific reminder threshold settings from the org settings table. Provides typed acce...
Data access component responsible for querying and managing certification expiry dates stored in the peer mentor profile or user roles table...
Data access component for persistent in-app notification records related to certificate expiry. Stores notification state, acknowledgement s...
Data access layer for reading peer mentor pause status records and resolving coordinator relationships from the org membership table. Provid...
Tracks which scenario prompts have been sent to which users, their delivery status, and whether the user acted on or dismissed them. Used by...
Data access layer for reading and persisting scenario rule definitions and chapter-level configuration. Rules are stored as JSON in Supabase...
Typed Dart data class representing a single notification record from the Supabase notifications table. Encapsulates all fields (user_id, typ...
Data access layer for the Supabase notifications table. Provides typed query methods for fetching, filtering, and mutating notifications. Ha...
Data access layer that queries Supabase for a peer mentor's activity records within a specified date range, transforming raw database rows i...
Local persistence store (using Hive or SQLite via drift) that serialises computed AnnualSummary objects to device storage. Enables offline v...
Data access layer for badge taxonomy definitions stored in Supabase. Manages the configurable badge catalog per organisation including crite...
Data access layer for earned badge records in Supabase. Stores earned badges with earned_at timestamps and provides query methods for profil...
Data access layer for recognition tier definitions and awarded tier records. Manages both the tier catalog (Coordinator of the Year, seasona...
Executes aggregation queries over the activity table to compute session counts, total hours, and other metrics for a given peer mentor or co...
Stores periodic summary records locally on the device using the app's offline persistence layer, allowing the summary card and team view to ...
Manages CRUD operations for generated periodic summary records in the database. Provides queries to fetch the latest summary for a user and ...
Persistence layer for user-level notification preference records keyed by user ID and scenario type. Provides fast upsert semantics so a mis...
Data access layer for persisting and querying scenario-based push notification records, including trigger history, delivery status, and cool...
Persists and queries recruitment funnel events in Supabase. Records click events, pending signups, and confirmed registrations with full att...
Handles all Supabase CRUD operations for the referral_codes table. Ensures each peer mentor has at most one active code per organisation and...
Immutable value object and associated serialization logic for a completed benefit calculation. Stores all computed metrics and the input par...
Reads organisation-specific multiplier values (hourly rate equivalent, travel cost per session, health system cost per hour) from the Supaba...
Persists user-level accessibility preferences including screen reader warning suppression preferences, announcement verbosity level, and whe...
Defines and persists the list of form fields throughout the app that are designated as containing sensitive personal data. Each field entry ...
Static registry mapping every application error code to a plain-language two-part message object containing a cause description and a correc...
Stores and serves inline contextual help texts keyed by screen identifier and field identifier. Loaded from a bundled asset so help content ...
Persists and retrieves partial wizard answers locally using shared preferences or Hive, enabling pause-and-resume without data loss. Each dr...
A structured data file (JSON or Dart constants file) that declares every color pair, type scale entry, and sizing token alongside its comput...
Central repository of all design tokens (colors, typography, spacing, sizing, radii) for the application. Tokens are defined as non-overrida...
Persists tab index and navigation stack snapshots across app sessions using local storage, so users with motor fatigue return to their last ...
A local-storage repository that persists partial transcription results incrementally during a dictation session so that a crash or interrupt...
In-memory and disk cache for organization-specific branding assets and design token overrides. Preloads logo images and color tokens after o...
Data access layer responsible for fetching, caching, and exposing organization records from Supabase. Provides the complete list of active p...
Persistence layer that reads and writes the selected organization ID and associated tenant metadata to both secure local storage (for offlin...
Persists terminology maps to device-local storage (e.g., SharedPreferences or Hive) so that labels are available immediately on app launch a...
Data-layer abstraction for fetching and persisting organization terminology maps. Queries the organization_configs Supabase table for the la...
A short-lived in-memory and persistent cache layer for feature flag data that reduces redundant Supabase reads. Stores the resolved flag map...
Data access layer responsible for fetching organization feature flag configurations from the Supabase `organization_configs` table. Parses t...
In-memory and optional local-storage cache for the full organizational hierarchy tree. Prevents repeated Supabase fetches for a structure th...
Supabase data access layer for the organization_units table which implements a recursive adjacency-list structure (parent_id self-reference)...
Data access layer for the user_organization_unit_assignments junction table. Manages user-to-unit relationships including the is_primary fla...
Data component wrapping Supabase Vault for secure storage and retrieval of external system API credentials (API keys, client secrets, OAuth ...
Data access layer for the organization_integrations table. Provides typed CRUD operations including reading and writing the JSONB field_mapp...
Other Component Types
User Interface components handle presentation logic, user interactions, and visual elements of the application.
Service Layer components contain business logic, orchestrate operations, and provide core application functionality.
Infrastructure components provide foundational utilities, system integrations, and supporting functionality for the application.