Appearance
Submodules & Cross-Module Exports
When to split a module into submodules under Modules/, how Export/ acts as a strict public API boundary, and how to link cleanly across modules with return navigation (back).
Two submodule patterns
Submodules live under admin/Modules/<Parent>/Modules/<Submodule>/, share the exact same folder layout as a top-level module, and never have their own index.php. All submodule controllers are registered in the parent's index.php, and LimsRouter automatically discovers every submodule's Database/, access_config.php, and flag_config.php.
Pattern A: Embedded helper submodule (example: Notes/Modules/Todos)
Use this when a sub-feature lives inside one of the parent's pages (e.g. a checklist panel on a Note page):
- Owns its own
Database/Schemas/,Migrations/,Core/, andControllers/TodosController.php(registered inNotes/index.php). - Exports an Angular component in
Modules/Todos/Export/TodoPanel.component.tsthat the parent page embeds directly. - Its controller answers the panel's actions with
JsonResponse.
Pattern B: Multi-feature parent module (example: QualityAssurance)
Use this when one LIMS module hosts multiple full-page disciplines that share a dashboard, lookup services, and permissions (such as QualityAssurance hosting ProficiencyTesting, DocumentControl, Improvements, and CorrectiveActions):
- Submodules own full Fusion pages in
Modules/<Submodule>/UI/Views/<Page>/<Page>.component.ts.Fusion::render('MyPage/MyPage.component.ts', $props)resolves relative to the calling controller's nearest module or submoduleUI/Views/directory. - Shared parent
Core/&UI/Components/: Submodules inject shared parent services (for example,QualityUserService,QualityLookupService,BusinessDaysService,ReferenceNumberService,NotificationService) and shared UI helpers (postForm.ts,dates.ts). - Contract-based dashboard integration: The parent defines a small interface in
Core/Interfaces/(such asQualityFeaturewithurl(),summary(),workItems()). Each submodule implements that interface inside itsExport/folder (Export/ImprovementsFeature.php), and the parent controller depends only onExport/— never reaching into a submodule'sCore/orUI/. - Optional quick-action exports: A submodule can export a standalone Angular trigger + modal component (such as
Export/LogImprovement.component.ts) that the parent dashboard and sibling registers embed cleanly viaExport/. - Per-submodule permissions/flags: A submodule may rely on the parent's
access_config.php, or add its ownModules/<Submodule>/access_config.phpandflag_config.phpwhen it needs an independent permission domain (likeDocumentControl).
Quality Assurance module-specific conventions
Developers working specifically inside QualityAssurance can also consult the in-repo admin/Modules/QualityAssurance/DEVELOPING.md for QA's quality_features ID table, shared QA services, and legacy submodule migration notes.
Designing Export/
Rule: Any code outside a module (another top-level module, a sibling submodule, or a parent module) may import only from Export/. Everything else (Core/, UI/, Database/) is private.
Put these in Export/:
- Facade or contract implementations (
Export/Sales.php,Export/OrdersFeature.php) - Embeddable Angular components (
Export/OrderPanel.component.ts,Export/LogOrder.component.ts) - Legacy PHP HTML renderers if legacy pages need to embed your module (
Export/RecordNotes.php) - Every DTO, value object, enum, or interface referenced by the public API — never force external callers to import from
Core/Enums/orCore/DTOs/.
Cross-module links & returning (back parameter)
When another module links into your module (for example, opening a Note from a Corrective Action page), carry the calling page's address in a ?back= query parameter:
- Build the link in
Export/: Have yourExport/helper populatebackautomatically so callers don't repeat URL construction. - Validate
backon the server: Accept only relative paths inside the same application (never external URLs orjavascript:URIs — seeNotes/UI/Components/BackLink.php). - Preserve
backacross edits: Pass the validatedbackprop to your Angular views and appendback: this.back()to everyurl(...)call (url()omitsnull/undefinedautomatically). - Leave via a full page load: Because the calling page belongs to a different module, render the Back button as a plain
<a [href]="back">or setwindow.location.href = back— never callnavigate(back).