Skip to main content
Version: 3.0.1

Runfile List Design

Document Type: Domain Design (Tier 2) Domain: RUNFILE Domain Character: Thin orchestration SRS Reference: runfile-list.md Status: Draft Last Updated: 2026-01-25


1. Overview

1.1 Purpose

The Runfile List subsystem provides the primary navigation interface for processed run files. It displays a paginated, filterable, sortable list of runs with metadata and status information, enabling users to locate and open specific run files for detailed analysis.

This is a thin orchestration domain. It coordinates data retrieval and presentation but delegates substantive logic to other domains:

  • FILEIMPORT: Run creation via file upload
  • RUNRPT: Run details, well data, analysis operations
  • NOTIF: Notification badge aggregation
  • FILTERS: Filter criteria application
  • TABLES: Sorting and pagination

1.2 Requirements Covered

REQ IDTitlePriority
REQ-RUNFILE-001Display Runfile ListMust
REQ-RUNFILE-002Expand Runfile to View Mix DetailsMust
REQ-RUNFILE-003Search RunfilesMust
REQ-RUNFILE-004Filter Runfile ListMust
REQ-RUNFILE-005Sort Runfile ListMust
REQ-RUNFILE-006Navigate to Run ReportMust
REQ-RUNFILE-007Configure Visible ColumnsShould
REQ-RUNFILE-008Display Run StatusMust
REQ-RUNFILE-009Support Multi-Site OperationMust
REQ-RUNFILE-010Manage Run TagsShould
REQ-RUNFILE-011Organize Runfiles into Categorized ViewsShould
NFR-RUNFILE-001PerformanceMust

1.3 Constraints

Tier 2 Constraint: This document describes ownership, patterns, and design rationale. It links to reference docs for full schemas and API specifications.

1.4 Dependencies

DirectionDomain/ComponentPurpose
ConsumesFILEIMPORTRun creation (delegates file processing)
FILTERSFilter criteria application
TABLESSorting and pagination
NOTIFNotification badge data
Site ModelMulti-site filtering
Tag ModelRun tagging and categorization
Provides toRUNRPTNavigation target (run details)
FrontendPaginated run list data

2. Component Architecture

2.1 Component Diagram

2.2 Component Responsibilities

ComponentLayerResponsibilityREQ Trace
RunBackend ModelStores run metadata, relationships, status constantsREQ-RUNFILE-001, 008
SiteBackend ModelMulti-site associationREQ-RUNFILE-009
TagBackend ModelRun tagging for organizationREQ-RUNFILE-010, 011
ListRunsActionBackend ActionPaginated list with filters, sortingREQ-RUNFILE-001, 003, 004, 005
DeleteRunsActionBackend ActionDispatches run deletion jobREQ-RUNFILE-009
CreateRunActionBackend ActionDelegates to FILEIMPORTREQ-RUNFILE-001
RunsControllerBackend ControllerAPI endpoint orchestrationAll REQ-RUNFILE-*
RunFiltersBackend FilterFilter criteria implementationREQ-RUNFILE-004
Runs.vueFrontend ViewList container, view orchestrationREQ-RUNFILE-001, 011
RunFilesTable.vueFrontend ComponentTable display, row expansionREQ-RUNFILE-001, 002
Tags.vueFrontend ComponentTag management interfaceREQ-RUNFILE-010

3. Data Design

3.1 Entities

This domain owns the Run entity and coordinates access to related entities.

EntityOwnerUsage in RUNFILE
runsRUNFILEPrimary entity for run metadata
run_tagRUNFILEMany-to-many run-tag associations
tagsRUNFILETag definitions
sitesSITEMulti-site filtering
usersUSERMGMTUploader reference
run_mixesRUNRPTMix details for expansion

See Database Reference for full schema.

3.2 Data Structures

Run Status Constants

const RUN_STATUS = [
'ALL_WELLS_EXPORTED' => 1,
'ALL_WELLS_READY_FOR_EXPORT' => 2,
'NO_EXPORT_ERRORS_TO_RESOLVE' => 3,
'SOME_WELLS_READY_FOR_EXPORT_WITH_ERRORS_TO_RESOLVE' => 4,
];

List Response Structure

interface RunListItem {
id: string;
run_name: string;
uploaded_user: { username: string };
runfile_created_at: datetime;
created_at: datetime;
updated_at: datetime;
run_status: RunStatus;
resolution_status: string;
site: { name: string } | null;
tags: Tag[];
run_mixes: RunMix[];
notifications: NotificationCounts;
}

interface RunListResponse {
data: RunListItem[];
meta: {
current_page: number;
per_page: number;
total: number;
last_page: number;
};
}

3.3 State Transitions

This domain is primarily stateless for list operations. Run state transitions (creation, deletion) are managed by other domains:

  • Creation: Delegated to FILEIMPORT domain
  • Deletion: Dispatches RunDeleteJob asynchronously

4. Interface Design

4.1 APIs Provided

EndpointMethodPurposeREQ Trace
/api/runsGETList runs with pagination, filters, sortingREQ-RUNFILE-001, 003, 004, 005
/api/runsPOSTCreate run (delegates to FILEIMPORT)REQ-RUNFILE-001
/api/runsDELETEDelete runs for siteREQ-RUNFILE-009
/api/runs/:idGETSingle run details (delegates to RUNRPT)REQ-RUNFILE-006

See API Reference for full specification.

4.2 APIs Consumed

EndpointMethodPurpose
FILEIMPORT servicesInternalFile processing and run creation
NOTIF aggregationInternalNotification counts

4.3 Events

EventDirectionPayloadPurpose
RunUpdatedBackend broadcast{ run_id }Real-time list refresh
RunsDeletedBackend broadcast{ site_id }Notify deletion completion
RunAnalyzeStartedBackend broadcast{ run_id }Progress indicator
RunAnalyseProgressUpdatedBackend broadcast{ run_id, progress }Progress update

5. Behavioral Design

Behavior is straightforward CRUD/delegation. See component responsibilities in section 2.2.

5.1 List Retrieval

Algorithm: List Runs

Inputs:
- filters: RunFilters - Applied filter criteria
- per_page: integer - Pagination size
- sort_by: string | null - Sort column and direction
- patient_id: string | null - Patient search filter

Outputs:
- paginated_runs: LengthAwarePaginator - Paginated run list

Steps:
1. Build base query joining runs with users
2. Eager load relationships: uploadedUser, runTargets, runMixes, site, tags
3. If patient_id provided: filter to runs containing patient
4. If multi-site disabled: filter to default site
5. If sort_by provided: apply sorting via Sortable trait
6. Apply filter criteria via Filterable trait
7. Return paginated results

5.2 Run Status Determination

Run status is computed from well states. See SDS: RUNRPT for well state details.

StatusCondition
ALL_WELLS_EXPORTEDAll patient wells have been exported
ALL_WELLS_READY_FOR_EXPORTAll patient wells have no errors
NO_EXPORT_ERRORS_TO_RESOLVEAt least one error, none exportable
SOME_WELLS_READY_FOR_EXPORT_WITH_ERRORS_TO_RESOLVESome errors, some exportable

5.3 View Categorization

Runs are categorized into views based on tags and export state:

ViewFilter Condition
ActiveNo archive tags AND not fully exported
ExportedNo archive tags AND fully exported
ArchivedHas archive tag(s)

6. Error Handling

ConditionDetectionResponseUser Impact
No runs existEmpty result setReturn empty paginated responseEmpty state message
Filter returns no resultsEmpty result setReturn empty paginated response"No matching runs" message
API timeoutNetwork errorFrontend retry logicLoading indicator persists
Invalid filter valuesValidation layer422 responseFilter validation error shown

7. Configuration

SettingLocationDefaultEffect
use_multiple_sitesfeatures tablefalseEnable/disable multi-site filtering
archive_mode_enabledclient_configurationsfalseEnable archive view and toggle
default_per_pageApplication config20Default pagination size

See Configuration Reference for details.


8. Implementation Mapping

8.1 Code Locations

ComponentTypePath
RunModelcode/app/Run.php
TagModelcode/app/Tag.php
SiteModelcode/app/Site.php
RunsControllerControllercode/app/Http/Controllers/RunsController.php
ListRunsActionActioncode/app/Actions/Runs/ListRunsAction.php
DeleteRunsActionActioncode/app/Actions/Runs/DeleteRunsAction.php
CreateRunActionActioncode/app/Actions/Runs/CreateRunAction.php
RunFiltersFiltercode/app/Filters/RunFilters.php
RunDeleteJobJobcode/app/Jobs/RunDeleteJob.php
RunsListResourcecode/app/Http/Resources/RunsList.php
Runs.vueViewcode/views/Runs.vue
RunFilesTable.vueViewcode/views/RunFilesTable.vue

8.2 Requirement Traceability

REQ IDDesign SectionCode Location
REQ-RUNFILE-001Section 5.1ListRunsAction.php, RunsController@index
REQ-RUNFILE-002Section 2.2RunFilesTable.vue (frontend expansion)
REQ-RUNFILE-003Section 5.1ListRunsAction.php (patient_id filter)
REQ-RUNFILE-004Section 5.1RunFilters.php, ListRunsAction.php
REQ-RUNFILE-005Section 5.1ListRunsAction.php (Sortable trait)
REQ-RUNFILE-006Section 2.2RunsController@show, frontend routing
REQ-RUNFILE-007Section 2.2Frontend column configuration
REQ-RUNFILE-008Section 5.2Run.php (RUN_STATUS constants)
REQ-RUNFILE-009Section 5.1ListRunsAction.php (site filtering)
REQ-RUNFILE-010Section 2.2Run.php (tags relation), Tags.vue
REQ-RUNFILE-011Section 5.3Frontend view filtering
NFR-RUNFILE-001Section 5.1Pagination, eager loading optimizations

9. Design Decisions

DecisionRationaleAlternatives Considered
Thin orchestration patternList display has minimal owned logic; complexity is in RUNRPT and FILEIMPORTMonolithic domain (rejected: poor separation)
Action classes for operationsTestable, single-responsibility unitsController-only logic (rejected: harder to test)
Eager loading relationshipsPrevent N+1 queries on list displayLazy loading (rejected: performance issues)
Async deletion via jobLong-running operation, non-blockingSynchronous delete (rejected: timeout risk)
Status as computed constantAvoid stale cached valuesPersisted status field (rejected: sync complexity)

DocumentRelevant Sections
SRS: runfile-list.mdRequirements source
SDS: RUNRPT DomainRun details, well operations
SDS: FILEIMPORT DomainRun creation process
SDS: NOTIF DomainNotification badge data
SDS: ArchitectureSystem architecture context
Database ReferenceSchema details
API ReferenceEndpoint specifications