Format of a Mapping Type Definition
A mapping type is the definition of a context in which mapping takes place, such as the GL Accounts SAF-T 2.0 mapping. Such definition must be expressed in the following format:
{
id: string,
name: string,
configuration: {
source: string,
targets: string[],
mapping: string,
deleter: string,
metrics?: string,
}
}
A valid mapping type definition must include all the following fields:
-
id is the unique mapping type identifier that should be referenced in the definition of any new mapping type instances.
-
name is the user-readable name of the mapping type.
-
configuration determines where the mapping type logic is implemented:
-
source is the path to a source file (the Source Controller) that defines how to retrieve mapping sources. In the example of the GL Accounts SAF-T 2.0 mapping, the source determines how to retrieve the list of available GL accounts.
-
targets is a list of one or more source files (the Target Controllers) that define how to retrieve mapping targets. In the example of the GL Accounts SAF-T 2.0 mapping, there's one file that manages the retrieval of grouping codes, and another doing the same for grouping categories.
-
mapping is the path to a source file (the Mapping Controller) that defines how to store and retrieve mappings.
-
deleter is the path to a source file (the Mapping Type Instance deleter) that removes obsolete target values and any related data. This data must be cleaned up when a subsequent mapping type instance installation omits those values.
-
metrics is the path to a metrics logger file that implements the MetricsLogger type defined in src/types/MetricsLogger.ts. If you don't want to collect mapping data in OpenSearch, you can skip this option.
-
Below is an example of a valid mapping type definition:
{
id: 'UMA_SAFT_2_0_ACCOUNTS',
name: 'saft_2_0_accounts',
configuration: {
source: '/SuiteApps/com.netsuite.universalmappingassistant/src/controllers/AccountController',
targets: [
'/SuiteApps/com.netsuite.universalmappingassistant/src/controllers/saft2acc/GroupingCategoryController',
'/SuiteApps/com.netsuite.universalmappingassistant/src/controllers/saft2acc/GroupingCodeController',
],
mapping: '/SuiteApps/com.netsuite.universalmappingassistant/src/controllers/saft2acc/MappingController',
deleter: '/SuiteApps/com.netsuite.universalmappingassistant/src/services/saft2acc/MappingTypeInstanceDeleterService',
metrics: '/SuiteApps/com.netsuite.universalmappingassistant/src/services/saft2acc/MetricsLogger',
}
}