Written to: 5 requirements: 5 proved, 0 partly, 0 failing, 0 with no test recorded. 0028-modules FR-001 , 0028-modules FR-002 , 0028-modules FR-003 , 0028-modules FR-004 , 0028-modules FR-005
Modules (commons data 0028-modules ): a subject area as a value, composed with others into one domain. A module names the modules it requires and holds concepts and code lists that may refer to those of the modules it requires; a project lists the modules it wants and composeModules makes one domain of them, validated whole. A module that is not listed has no concept in the domain, so it has no table.
const billing = defineModule ({ name: "billing" , requires: ["party" ], concepts: [invoice], codeLists: [] });
const app = composeModules ("shop" , { definition: "A shop" }, [moduleOf (partyDomain.value), billing]);Source: commons/data/governance/module.ts
5 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.
function composeModules (name : string , spec : { readonly definition ?: string | undefined ; readonly annotations ?: readonly Annotation [] | undefined ; }, modules : readonly Module []): Result <Domain , readonly ComposeError []>The domain of the modules a project lists.
Parameter What it is namethe project's name for the domain, which the identities of its elements carry specits definition and its own annotations modulesthe modules, every one required by a listed module included
Returns: the domain, or every error
Imported by 40 tests of the run (40 passed, 0 failed): the library's results
const defineModule : (spec : ModuleSpec ) => Module A module.
Parameter What it is specits name, what it requires, its concepts and code lists
Returns: the module
Imported by 9 tests of the run (9 passed, 0 failed): the library's results
interface Module A subject area.
Member Type What it is kind"module"namestringdefinitionstringrequiresreadonly string[]conceptsreadonly AnyConcept[]codeListsreadonly AnyCodeList[]subject?stringThe id of the subject it applies to (subjects.ts), where it names one.
Imported by 23 tests of the run (23 passed, 0 failed): the library's results
const moduleOf : (d : Domain , requires ?: readonly string []) => Module A module made from a domain that is already valid.
Parameter What it is dthe domain requiresthe modules it requires, none where it stands alone
Returns: the module, named as the domain is
Imported by 36 tests of the run (36 passed, 0 failed): the library's results
ModuleSpecinterface no test imports it interface ModuleSpec What a module is made from.
Member Type What it is namestringdefinition?stringrequires?readonly string[]conceptsreadonly AnyConcept[]codeLists?readonly AnyCodeList[]subject?string
function withRequired (all : readonly Module [], wanted : readonly string []): Result <readonly Module [], readonly ComposeError []>The modules a project gets from the names it wants: those and everything they require, in the order of the requirements.
Parameter What it is allthe modules that exist wantedthe names a project wants
Returns: the modules to compose, or why not
Imported by 15 tests of the run (15 passed, 0 failed): the library's results