Skip to main content
Version: Next

Configuration Import/Export Design

Document Type: Domain Design (Tier 2) Domain: CONFIGIO Domain Character: Integration SRS Reference: configio.md Status: Draft Last Updated: 2026-03-06 Version: v3.1.0


1. Overview

1.1 Purpose

The Configuration Import/Export (CONFIGIO) subsystem provides bulk configuration management via XLSX spreadsheet files. It enables administrators to:

  • Import configuration data from Excel files for bulk setup and migration
  • Export configuration data for backup, environment migration, and customer documentation
  • Generate status reports showing which rows were imported or ignored with reasons

This is an integration-heavy domain characterized by:

  • File format parsing and generation (XLSX)
  • Extensive per-row validation across 25+ sheet types
  • Asynchronous job processing for large imports
  • Notification delivery with downloadable status reports

1.2 Requirements Covered

REQ IDTitlePriority
REQ-CONFIGIO-001Generate Import Status ReportsMust
REQ-CONFIGIO-002Export Customer-Friendly ConfigurationMust
REQ-CONFIGIO-003Import and Export Mixes and Targets ConfigurationMust
REQ-CONFIGIO-004Import and Export Combined Outcomes ConfigurationMust
REQ-CONFIGIO-005Import and Export Control Labels ConfigurationMust
REQ-CONFIGIO-006Import and Export Error Codes ConfigurationMust
REQ-CONFIGIO-007Import and Export Error Resolutions ConfigurationMust
REQ-CONFIGIO-008Import and Export Help Items TagsShould
REQ-CONFIGIO-009Import and Export Rules ConfigurationMust
REQ-CONFIGIO-010Import and Export QIR Quantification SettingsMust
REQ-CONFIGIO-011Validate Westgard Limits on ImportMust
REQ-CONFIGIO-012Import Quantitative/Qualitative Reporting Cut-offsMust
REQ-CONFIGIO-013Import and Export LIMS Export ConfigurationMust
REQ-CONFIGIO-014Apply Extraction Instruments Toggle on ImportMust
REQ-CONFIGIO-015Global/Strict Configuration Import/Export PatternMust
REQ-CONFIGIO-016Control Labels Enhanced ColumnsMust
REQ-CONFIGIO-017Control Labels Re-import BehaviorMust
REQ-CONFIGIO-018Mix and Targets Quantification Scope Import/ExportMust
REQ-CONFIGIO-019Cross Contamination Limits Import ValidationMust
REQ-CONFIGIO-020Automatic Rule Mappings Export SheetMust
REQ-CONFIGIO-021Target Name Suffix Import SheetMust
REQ-CONFIGIO-022Config Import Progress IndicatorMust

1.3 Constraints

Tier 2 Constraint: This document describes ownership, patterns, and design rationale. It links to reference docs for full schemas and validation rules documented in the SRS acceptance criteria.

1.4 Dependencies

DirectionDomain/ComponentPurpose
ConsumesXLSX FilesConfiguration data input
Config TemplateCustomer-friendly export template
Provides toKITCFGImported configuration entities
Queue SystemAsynchronous job processing
Notification SystemImport status delivery
UsesCloud StorageStatus report file storage

2. Component Architecture

2.1 Component Diagram

2.2 Component Responsibilities

ComponentTypeResponsibilityREQ Trace
ConfigDataControllerControllerUpload endpoint, file validation, job dispatchREQ-CONFIGIO-001, 003-014
ConfigDataImportJobJobAsync import orchestration, notification triggerREQ-CONFIGIO-001
ConfigDataImportOrchestratorMulti-sheet import routing (29 sheet types)REQ-CONFIGIO-003-014
*ImportSheetSheet HandlerSheet-specific parsing and validationVarious
*ImportRowValidatorValidatorPer-row field validationVarious
KitConfigurationImportResultExportActionActionGenerate status report, send notificationREQ-CONFIGIO-001
KitConfigurationsExportExportFull configuration export to XLSXREQ-CONFIGIO-003-014
CustomerFriendlyKitConfigurationsExportExportCustomer-readable exportREQ-CONFIGIO-002
PrecedenceNormalizerAlgorithmRule precedence normalizationREQ-CONFIGIO-009

2.3 Architectural Patterns

Pattern: Sheet Registry

Import sheets are registered by name in ConfigDataImport. Unknown sheets are skipped with logging.

// Sheet name → Handler mapping
'Mix and Targets' => new MixAndTargetsImportSheet($user),
'Combined Outcomes' => new CombinedOutcomesImportSheet($user),
// ... 27 more sheets

Pattern: Row Status Collection

Each import sheet maintains a collection of rows with status:

$this->rowsWithStatuses = $importAction($user, $rows);
// Each row has 'status' = 'Imported' | 'Ignored: {reason}'

Pattern: Chunked Processing

Large sheets use chunked reading to manage memory:

// CombinedOutcomesImportSheet
public function chunkSize(): int { return 1000; }

Pattern: Post-Import Cascade

Mix/Target imports trigger global mapping:

public function afterSheet() {
(new GlobalMixMapper($this->authUser))->map();
}

3. Data Design

3.1 Entities

This domain does not own persistent entities. It orchestrates import/export operations that affect entities owned by KITCFG, ERRORCODES, and other configuration domains.

EntityOwnerUsage in CONFIGIO
mixesKITCFGImport/export target
targetsKITCFGImport/export target
control_labelsKITCFGImport/export target
combined_outcomesKITCFGImport/export target
error_codesERRORCODESImport/export target
error_resolutionsERRORCODESImport/export target
westgard_settingsKITCFGImport/export target
rulesRULESImport/export target
lims_statusesKITCFGImport/export target

See Database Reference for full schema.

3.2 Data Structures

Import Row with Status

interface ImportRow {
// Original row data from XLSX (varies by sheet type)
[column: string]: string | number | boolean | null;
// Appended by import process
status: 'Imported' | `Ignored: ${string}`;
}

Import Result Counts

interface ImportResultCounts {
imported: number;
ignored: number;
}

Sheet Configuration

// 29 supported sheet names (27 original + 2 added in v3.1.0)
type SheetName =
| 'Client Configurations'
| 'Dyes'
| 'Roles'
| 'Rules'
| 'Mix and Targets'
| 'Control Labels'
| 'Combined Outcomes'
| 'Error Codes'
| 'Error Resolutions'
| 'Westgard Limits'
| 'QIR - Quantification settings'
| 'Help Items'
| 'Rules Mapping'
| 'Kits' // v3.1.0
| 'Target Name Suffix - Specimen' // v3.1.0
// ... 14 more
;

3.3 State Transitions

This domain is stateless. All operations are request-scoped, though import jobs execute asynchronously.


4. Interface Design

4.1 APIs Provided

EndpointMethodPurposeREQ Trace
/api/config-dataPOSTUpload configuration file, dispatch import jobREQ-CONFIGIO-001, 003-014
/api/config-dataDELETEDelete all client configurations for siteN/A (admin utility)
/api/kit-configurations/exportGETExport full configuration XLSXREQ-CONFIGIO-003-014
/api/customer-friendly-kit-configurations/exportGETExport customer-friendly XLSXREQ-CONFIGIO-002

4.2 APIs Consumed

This domain does not consume external APIs. It interacts with the filesystem and queue system.

4.3 File Formats

Import File Requirements:

  • Format: XLSX or XLS
  • Structure: Multiple sheets, each with header row
  • Sheet names must match expected names (case-sensitive)
  • Unknown sheets are skipped

Export File Format:

  • Format: XLSX
  • Naming: kit-configurations-{site_name}-{timestamp}.xlsx
  • Customer-friendly naming: customer-friendly-kit-configurations-{site_name}.xlsx

Status Report Format:

  • Format: XLSX
  • Content: Original import data with appended "Status" column
  • Naming: kit-configuration-import-results-{timestamp}.xlsx

4.4 Events

EventDirectionPayloadPurpose
ConfigDataImportJobDispatchedfilePath, fileNameTrigger async import
KitConfigurationsImportedWithIgnoredRowsNotificationfileName, message, downloadUrlNotify user of import with errors
KitConfigurationsImportedWithoutIgnoredRowsNotificationfileNameNotify user of successful import

5. Behavioral Design

5.1 Import Processing Flow

Algorithm: Process Configuration Import

Inputs:
- file: XLSX file with multiple sheets
- user: Authenticated user

Outputs:
- notification: Import status notification with optional report download

Assumptions:
- File is valid XLSX format
- User has Administrator or Super Administrator role
- Queue system is operational

Steps:
1. Controller receives file upload
2. Validate file extension (xlsx, xls only)
3. Store file temporarily
4. Dispatch ConfigDataImportJob to queue
5. Job executes asynchronously:
a. Create ConfigDataImport with sheet registry
b. For each recognized sheet:
- Instantiate appropriate ImportSheet handler
- Parse rows with heading row mapping
- For each row:
* Validate required fields
* Validate field formats (type, range, precision)
* Check business rules (references, duplicates)
* If valid: create/update entity, status = "Imported"
* If invalid: skip entity, status = "Ignored: {reason}"
- Collect rows with statuses
- Execute post-sheet hooks (e.g., GlobalMixMapper)
c. Unknown sheets logged and skipped
6. Calculate import/ignored counts
7. If any ignored rows:
a. Generate status report XLSX
b. Store to cloud storage
c. Send notification with download link
8. Else:
Send success notification
9. Delete temporary upload file

Notes:
- Sheet processing order matters for dependencies
- Large sheets processed in chunks (1000 rows)
- Partial failures allowed: valid rows imported, invalid skipped

Import Sheet Processing Order:

OrderSheetDependencies
1Client ConfigurationsNone
2DyesNone
3RolesNone
4RulesNone
5Westgard EventsNone
6SpecimensNone
7ExtractionsNone
8Mix and TargetsNone
9ThermocyclersNone
10Control LabelsMixes, Roles
11Rules MappingMixes, Targets, Roles
12Lims ExportsNone
13Error CodesNone
14Curve Control LimitsMixes, Targets, Roles
15Westgard LimitsMixes, Targets, Roles
16Cross Contamination LimitsMixes, Targets
17Test CodesMixes
18Qualitative ReportingsMixes, Targets
19Error ResolutionsError Codes
20QIR - Quantification settingsTargets
21Help ItemsNone
22Combined OutcomesMixes, Targets, LIMS Statuses
23FeaturesNone
24AlertsNone
25Known QuantitiesMixes, Targets, Roles
26KitsMixes
27Target Name Suffix - SpecimenSpecimens

5.2 Status Report Generation

5.3 Rule Precedence Normalization

Algorithm: Normalize Rule Precedence on Import

Inputs:
- rules: Collection of imported rule rows
- existing_rules: Current rules in database

Outputs:
- rules: Collection with normalized global precedence values

Assumptions:
- Rules have rule_type and relative_precedence fields
- Rule types have fixed type precedence order

Steps:
1. Group imported rules by rule_type
2. For each rule type (in type precedence order):
a. Observation (type_precedence = 1)
b. Control Check (type_precedence = 2)
c. Sample Result (type_precedence = 3)
d. Apply Controls (type_precedence = 4)
e. Sample Check (type_precedence = 5)
f. Parse/Import/Reanalysis/General/Reporting (type_precedence = 6)
3. Within each type:
a. Sort by relative_precedence
b. Remove gaps (renumber sequentially)
c. Resolve duplicates (later rows get higher precedence)
d. New imported rules take priority over existing at same precedence
4. Calculate global_precedence = (type_precedence * 1000) + relative
5. Return rules with assigned global_precedence

Notes:
- Existing rules may shift to accommodate imports
- Precedence affects rule execution order in analysis

5.4 Validation Flow (Per-Row)

Algorithm: Validate Import Row

Inputs:
- row: Single row from import sheet
- validator: Sheet-specific row validator
- context: Site, user, related entities

Outputs:
- result: { valid: boolean, reason?: string }

Steps:
1. Check required fields present
2. For each field:
a. Validate data type (string, number, boolean)
b. Validate format (precision, range, enum values)
c. Validate business rules:
- Foreign key references exist
- No duplicates where uniqueness required
- Conditional rules (e.g., sample type toggle)
3. If all valid: return { valid: true }
4. If any invalid: return { valid: false, reason: first_failure }

Notes:
- First validation failure stops further checks
- Reason is human-readable for status report

5.5 Global/Strict Import Pattern (v3.1.0)

Version

Added in v3.1.0.

Multiple config entity types (Reporting Cut-offs, Combined Outcomes, Cross Contamination Limits, Curve Control Limits) now support a "Global" import/export pattern. This pattern separates non-strict (global) mappings from strict (mix/target-specific) ones.

5.5.1 Import Behavior

When a row in the import spreadsheet has "Global" in the Mix, Target, or Dye column:

Algorithm: Global Row Import

Inputs:
- row: Import row with "Global" in mix/target/dye column
- site: Current site

Steps:
1. Parse "Global" markers in mix/target/dye columns
2. Create the config entity with is_strict = false
3. Invoke the Global Mapper for this entity type:
a. Find all mixes/targets matching the non-"Global" columns
b. Create individual mapped records for each match (is_strict = false)
4. Return imported status

Notes:
- "Global" rows expand to multiple mapped records
- Existing strict records for the same entity are NOT overwritten
- Orphaned non-strict records (no matching mix/target) are marked strict

5.5.2 Export Behavior

On export, non-strict records are collapsed back to "Global":

Algorithm: Global Row Export

Steps:
1. Query all config entities for the site
2. Group by entity type and scope:
a. Records with is_strict = false → export with "Global" in column
b. Records with is_strict = true → export with specific mix/target/dye names
3. Deduplicate global rows (multiple mapped records → single "Global" row)

5.5.3 Orphan Marking

When a global mapping no longer matches any mix/target (e.g., the mix was deleted or renamed), the non-strict records are marked strict rather than deleted. This preserves configuration data and makes the orphaned state visible in the UI.

5.6 New Config Sheets (v3.1.0)

Version

Added in v3.1.0.

5.6.1 Automatic Rule Mappings Export Sheet

Exports the results of the automatic rule mapper for review. This is an export-only sheet -- there is no corresponding import sheet.

ColumnTypeDescription
RULEstringRule code
MIXstringMix name
TARGETstringTarget name (or "Global")
ROLEstringRole alias
TAGstringTag that generated this mapping

Export: AutomaticRuleMappingsExport generates the sheet from existing auto-mapped records. Manual rule mappings are imported via the existing Rules Mapping sheet (RulesMappingImportSheet).

5.6.2 Kits Sheet

Manages kit groupings (a kit groups multiple mixes under a named configuration set).

ColumnTypeDescription
KIT NAMEstringKit identifier
MIX NAMEstringAssociated mix name

Import: KitsImportSheet creates kit records and associates mixes. Kit names must be unique per site.

Export: KitsExport generates the sheet from kit-to-mix associations.

5.6.3 Target Name Suffix - Specimen Sheet

Maps target name suffixes to specimen types for automatic association.

ColumnTypeDescription
SUFFIXstringTarget name suffix
SPECIMEN NAMEstringAssociated specimen type

Import: TargetNameSuffixToSpecimenImportSheet validates suffix uniqueness per site and specimen existence. Triggers DeleteSuffixMixesAndMoveWellsAction on creation.

5.7 Config Import Progress Indicator (v3.1.0)

Version

Added in v3.1.0.

Config Mode displays a sticky progress indicator during config imports. The system tracks per-sheet progress via ConfigImportProgress records and broadcasts updates via ConfigImportProgressBroadcast.

The progress indicator is "sticky" -- it remains visible at the top of the Config Mode page even as the user navigates between tabs.

5.8 Control Label Import Enhancements (v3.1.0)

Version

Added in v3.1.0.

The Control Labels import sheet adds three new columns:

ColumnTypeValidationPurpose
VERIFY_IC_TARGET_IS_POSITIVEbooleantrue/false, 1/0, yes/noFlag to verify IC target positivity
VERIFIABLE_TARGETSstringComma-separated target names; each must exist in mixTargets checked for IC positivity
ASSOCIATED_SPECIMENSstringComma-separated specimen names; must exist in siteSpecimens associated with control label

Validation Rules:

  • verify_ic_target_is_positive is a boolean; now available for all role types (not just IC roles)
  • verifiable_targets references must resolve to existing targets in the mix
  • associated_specimens must resolve to existing site specimen records

Well Migration on Re-Import:

When control labels are re-imported (soft-deleted and recreated), wells referencing the old control label are migrated to the new record. This prevents orphaned well references.

Global Mapping Matching:

Re-imported control labels now use full global mapping matching (matching on role, mix, and site) rather than just role_id + site_id. This prevents false matches when a control label's role changes on re-import.


6. Error Handling

ConditionDetectionResponseUser Impact
Invalid file extensionController validation422 UnprocessableUpload rejected with error
Corrupt XLSX fileExcel library exceptionJob failure loggedNo notification (silent fail)
Unknown sheet nameSheet registry lookupSkip with logSheet ignored, others processed
Required field missingRow validatorStatus = "Ignored: field required"Row skipped
Invalid field formatRow validatorStatus = "Ignored: invalid format"Row skipped
Foreign key not foundRow validatorStatus = "Ignored: reference not found"Row skipped
Duplicate entityUnique constraintUpsert or skip (varies by sheet)Depends on sheet policy
Memory exhaustionPHP limitJob failurePartial import, no notification
Queue timeoutJob timeoutRetry or failMay result in duplicate processing

Malformed File Handling:

  • Files that cannot be parsed by PHPSpreadsheet result in job failure
  • No notification is sent in this case (limitation acknowledged)
  • Job logs capture the exception for debugging

7. Configuration

SettingLocationDefaultEffectREQ Trace
use_extraction_instrumentsclient_configurationsfalseToggle Westgard import based on extraction instrumentsREQ-CONFIGIO-014
use_role_priority_for_resolutionclient_configurationsfalseEnable resolution priority import for control labelsREQ-CONFIGIO-005
use_sample_typeclient_configurationsfalseEnable specimen type validation for reporting cut-offsREQ-CONFIGIO-012
memory_limitPHP ini5GSet during import for large filesREQ-CONFIGIO-003-014
queue.defaultLaravel configredisQueue driver for async processingREQ-CONFIGIO-001

See Configuration Reference for details.


8. Implementation Mapping

8.1 Code Locations

ComponentTypePath
ConfigDataControllerControllerapp/Http/Controllers/ConfigDataController.php
KitConfigurationsExportControllerControllerapp/Http/Controllers/KitConfigurationsExportController.php
CustomerFriendlyKitConfigurationsExportControllerControllerapp/Http/Controllers/CustomerFriendlyKitConfigurationsExportController.php
ConfigDataImportJobJobapp/Jobs/ConfigDataImportJob.php
ConfigDataImportOrchestratorapp/Imports/ConfigDataImport.php
MixAndTargetsImportSheetImport Sheetapp/Imports/Sheets/MixAndTargetsImportSheet.php
CombinedOutcomesImportSheetImport Sheetapp/Imports/Sheets/CombinedOutcomesImportSheet.php
ControlLabelsImportSheetImport Sheetapp/Imports/Sheets/ControlLabelsImportSheet.php
ErrorCodesImportSheetImport Sheetapp/Imports/Sheets/ErrorCodesImportSheet.php
ErrorResolutionsImportSheetImport Sheetapp/Imports/Sheets/ErrorResolutionsImportSheet.php
RulesImportSheetImport Sheetapp/Imports/Sheets/RulesImportSheet.php
WestgardLimitsImportSheetImport Sheetapp/Imports/Sheets/WestgardLimitsImportSheet.php
CalculatedQuantificationSettingsImportSheetImport Sheetapp/Imports/Sheets/CalculatedQuantificationSettingsImportSheet.php
QuantitativeReportingsImportSheetImport Sheetapp/Imports/Sheets/QuantitativeReportingsImportSheet.php
LimsStatusImportSheetImport Sheetapp/Imports/Sheets/LimsStatusImportSheet.php
HelpItemsImportSheetImport Sheetapp/Imports/Sheets/HelpItemsImportSheet.php
KitConfigurationImportResultExportActionActionapp/Actions/Notifications/KitConfigurationImportResultExportAction.php
KitConfigurationsExportActionActionapp/Actions/KitConfigurationsExportAction.php
CustomerFriendlyKitConfigurationsExportActionActionapp/Actions/CustomerFriendlyKitConfigurationsExportAction.php
KitConfigurationsExportExportapp/Exports/Config/KitConfigurationsExport.php
KitConfigurationsImportResultsExportExportapp/Exports/Config/KitConfigurationsImportResultsExport.php
MixImportRowValidatorValidatorapp/Actions/Mixes/ImportSupport/Validate/MixImportRowValidator.php
TargetImportRowValidatorValidatorapp/Actions/Mixes/ImportSupport/Validate/TargetImportRowValidator.php
CombinedOutcomeImportRowValidatorValidatorapp/Actions/OutcomeToLimsStatus/ImportSupport/Validate/CombinedOutcomeImportRowValidator.php
ControlLabelImportRowValidatorValidatorapp/Actions/ControlLabels/ImportSupport/Validate/ControlLabelImportRowValidator.php
WestgardLimitImportRowValidatorValidatorapp/Actions/WestgardLimits/ImportSupport/Validate/WestgardLimitImportRowValidator.php
PrecedenceNormalizerAlgorithmapp/Imports/Sheets/Support/PrecedenceNormalizer/PrecedenceNormalizer.php
RulesMappingImportSheetImport Sheetapp/Imports/Sheets/RulesMappingImportSheet.php
KitsImportSheetImport Sheetapp/Imports/Sheets/KitsImportSheet.php
TargetNameSuffixToSpecimenImportSheetImport Sheetapp/Imports/Sheets/TargetNameSuffixToSpecimenImportSheet.php
AutomaticRuleMappingsExportExportapp/Exports/Config/AutomaticRuleMappingsExport.php
KitsExportExportapp/Exports/Config/KitsExport.php
RuleImportRowValidatorValidatorapp/Actions/Rules/ImportSupport/Validate/RuleImportRowValidator.php
LimsStatusImportRowValidatorValidatorapp/Actions/LimsStatuses/ImportSupport/Validate/LimsStatusImportRowValidator.php
ConfigImportProgressModelapp/ConfigImportProgress.php
ConfigImportProgressBroadcastEventapp/Events/ConfigImportProgressBroadcast.php

8.2 Requirement Traceability

REQ IDDesign SectionPrimary Code
REQ-CONFIGIO-001§5.2 Status ReportKitConfigurationImportResultExportAction, KitConfigurationsImportResultsExport
REQ-CONFIGIO-002§5.1 (export path)CustomerFriendlyKitConfigurationsExportAction, CustomerFriendlyKitConfigurationsExport
REQ-CONFIGIO-003§5.1, §5.4MixAndTargetsImportSheet, MixImportRowValidator, TargetImportRowValidator
REQ-CONFIGIO-004§5.1, §5.4CombinedOutcomesImportSheet, CombinedOutcomeImportRowValidator
REQ-CONFIGIO-005§5.4ControlLabelsImportSheet, ControlLabelImportRowValidator
REQ-CONFIGIO-006§5.4ErrorCodesImportSheet
REQ-CONFIGIO-007§5.4ErrorResolutionsImportSheet, ResolutionCodeImportRowValidator
REQ-CONFIGIO-008§5.4HelpItemsImportSheet
REQ-CONFIGIO-009§5.3 PrecedenceRulesImportSheet, PrecedenceNormalizer
REQ-CONFIGIO-010§5.4CalculatedQuantificationSettingsImportSheet
REQ-CONFIGIO-011§5.4WestgardLimitsImportSheet, WestgardLimitImportRowValidator
REQ-CONFIGIO-012§5.4QuantitativeReportingsImportSheet, QuantitativeReportingImportRowValidator
REQ-CONFIGIO-013§5.4LimsStatusImportSheet
REQ-CONFIGIO-014§7 ConfigurationWestgardLimitsImportSheet (uses use_extraction_instruments toggle)
REQ-CONFIGIO-015§5.5Global/strict pattern for Reporting Cut-offs, Combined Outcomes, Cross Contamination Limits, Curve Control Limits
REQ-CONFIGIO-016§5.8Control Labels enhanced columns (verify_ic_target_is_positive, verifiable_targets, associated_specimens)
REQ-CONFIGIO-017§5.8Control Labels re-import: well migration, global mapping matching
REQ-CONFIGIO-018§5.1, §5.4Mix and Targets quantification scope/method, use_automatic_baseline, virtual mix target linking (MixAndTargetsImportSheet, MixDataExtractor)
REQ-CONFIGIO-019§5.5Cross Contamination Limits import validation (error cascade prevention)
REQ-CONFIGIO-020§5.6.1Automatic Rule Mappings export sheet (AutomaticRuleMappingsExport)
REQ-CONFIGIO-021§5.6.3Target Name Suffix to Specimen import (TargetNameSuffixToSpecimenImportSheet)
REQ-CONFIGIO-022§5.7Config import progress indicator (ConfigImportProgress, ConfigImportProgressBroadcast)

9. Design Decisions

DecisionRationaleAlternatives Considered
Asynchronous import via queueLarge files (1000+ rows) would timeout synchronous requestsSynchronous (rejected: timeout risk)
XLSX format for import/exportCustomer familiarity, Excel editing, round-trip compatibilityJSON (rejected: less accessible), CSV (rejected: no multi-sheet)
Per-row validation with statusPartial imports useful; users can fix specific rowsAll-or-nothing (rejected: frustrating UX)
Cloud storage for status reportsTemporary URLs, no server filesystem managementLocal storage (rejected: multi-server issues)
Sheet name registry patternExplicit mapping, unknown sheets safely skippedReflection (rejected: fragile), strict (rejected: breaks on new sheets)
Chunked processing for large sheetsMemory management for 1000+ row sheetsLoad all (rejected: OOM risk)
Status in notification, not responseAsync job cannot return responsePolling (rejected: complexity)
Memory limit override (5G)Large imports require significant memoryStreaming (rejected: library limitations)
Global/strict pattern (v3.1.0)"Global" rows reduce config duplication; orphans marked strict instead of deletedDelete orphans (rejected: data loss), separate global table (rejected: query complexity)
Config import progress via WebSocket (v3.1.0)Per-sheet granularity gives meaningful feedback without per-row noisePer-row broadcast (rejected: too noisy), no progress (rejected: poor UX for large imports)
Control label well migration on re-import (v3.1.0)Preserves well references when labels are soft-deleted and recreatedOrphan wells (rejected: breaks analysis), block re-import (rejected: too restrictive)
Import result via cloud storage (v3.1.0)Status report XLSX sent via S3 URL instead of inline responseInline response (rejected: async job cannot return response directly)

10. Performance Considerations

ScenarioConcernMitigation
Large import (5000+ rows)Memory exhaustionChunked processing, 5G memory limit
Many concurrent importsQueue congestionQueue worker scaling
Status report generationFile size, storage costCloud storage with temporary URLs (24h expiry)
Export with many entitiesQuery performance, memoryChunked export, lazy loading
File uploadNetwork timeoutClient-side chunking (frontend), size limits

DocumentRelevant Sections
SRS: configio.mdRequirements source
SDS: ArchitectureQueue system integration
SDS: KITCFG DomainTarget entities for import/export
SDS: Cross-CuttingError handling patterns
SDS: Configuration ReferenceClient configuration toggles
SDS: CONFIGMODE DomainConfig Mode integration
SDS: CALIBRATION DomainCalibration import/export