@salesforce/plugin-bre-to-cml 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -4
- package/lib/commands/cml/convert/surcharge-rules.d.ts +12 -0
- package/lib/commands/cml/convert/surcharge-rules.js +79 -5
- package/lib/commands/cml/convert/surcharge-rules.js.map +1 -1
- package/lib/commands/cml/convert/underwriting-rules.d.ts +41 -2
- package/lib/commands/cml/convert/underwriting-rules.js +141 -17
- package/lib/commands/cml/convert/underwriting-rules.js.map +1 -1
- package/lib/commands/insurance/import/record-updates.d.ts +66 -0
- package/lib/commands/insurance/import/record-updates.js +239 -0
- package/lib/commands/insurance/import/record-updates.js.map +1 -0
- package/lib/shared/cml-operators.d.ts +9 -1
- package/lib/shared/cml-operators.js +23 -5
- package/lib/shared/cml-operators.js.map +1 -1
- package/lib/shared/insurance/confirm-org-changes.d.ts +49 -0
- package/lib/shared/insurance/confirm-org-changes.js +43 -0
- package/lib/shared/insurance/confirm-org-changes.js.map +1 -0
- package/lib/shared/insurance/insurance-cml-merge.d.ts +100 -13
- package/lib/shared/insurance/insurance-cml-merge.js +355 -54
- package/lib/shared/insurance/insurance-cml-merge.js.map +1 -1
- package/lib/shared/insurance/insurance-context-tags.d.ts +124 -0
- package/lib/shared/insurance/insurance-context-tags.js +210 -0
- package/lib/shared/insurance/insurance-context-tags.js.map +1 -0
- package/lib/shared/insurance/insurance-org.d.ts +12 -0
- package/lib/shared/insurance/insurance-org.js +38 -2
- package/lib/shared/insurance/insurance-org.js.map +1 -1
- package/lib/shared/insurance/insurance-rule-convert-command.d.ts +27 -0
- package/lib/shared/insurance/insurance-rule-convert-command.js +57 -4
- package/lib/shared/insurance/insurance-rule-convert-command.js.map +1 -1
- package/lib/shared/insurance/insurance-rule-generator.d.ts +101 -8
- package/lib/shared/insurance/insurance-rule-generator.js +293 -42
- package/lib/shared/insurance/insurance-rule-generator.js.map +1 -1
- package/lib/shared/insurance/models.d.ts +2 -1
- package/lib/shared/insurance/planned-change-mapper.d.ts +15 -0
- package/lib/shared/insurance/planned-change-mapper.js +51 -0
- package/lib/shared/insurance/planned-change-mapper.js.map +1 -0
- package/lib/shared/insurance/planned-change.d.ts +83 -0
- package/lib/shared/insurance/planned-change.js +74 -0
- package/lib/shared/insurance/planned-change.js.map +1 -0
- package/lib/shared/insurance/record-update-apply.d.ts +100 -0
- package/lib/shared/insurance/record-update-apply.js +303 -0
- package/lib/shared/insurance/record-update-apply.js.map +1 -0
- package/lib/shared/insurance/record-update-plan.d.ts +104 -0
- package/lib/shared/insurance/record-update-plan.js +397 -0
- package/lib/shared/insurance/record-update-plan.js.map +1 -0
- package/messages/cml.convert.surcharge-rules.md +3 -1
- package/messages/cml.convert.underwriting-rules.md +1 -1
- package/messages/insurance.import.record-updates.md +176 -0
- package/oclif.lock +28 -28
- package/oclif.manifest.json +127 -35
- package/package.json +16 -8
|
@@ -22,7 +22,7 @@ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
|
22
22
|
import { Messages } from '@salesforce/core';
|
|
23
23
|
import { generateCsvForAssociations } from '../utils/association.utils.js';
|
|
24
24
|
import { buildCmlModel, isSafeAssociationReferenceValue, sanitizeName } from './insurance-rule-generator.js';
|
|
25
|
-
import { discoverCmlApiByProducts, fetchProductCodes } from './insurance-org.js';
|
|
25
|
+
import { discoverCmlApiByProducts, fetchAttributeDataTypes, fetchProductCodes } from './insurance-org.js';
|
|
26
26
|
import { splitProductPath } from './insurance-cml-merge.js';
|
|
27
27
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
28
28
|
const messages = Messages.loadMessages('@salesforce/plugin-bre-to-cml', 'cml.convert.insurance-shared');
|
|
@@ -57,6 +57,21 @@ export class InsuranceRuleConvertCommand extends SfCommand {
|
|
|
57
57
|
// When defined, eligibility is emitted as a CML `rule(...)` statement tagged with this rule
|
|
58
58
|
// type instead of a `constraint`. Subclasses that want the constraint form leave it undefined.
|
|
59
59
|
ruleType;
|
|
60
|
+
/**
|
|
61
|
+
* AttributeDefinition id -> the data type its condition values must be compared as, resolved once
|
|
62
|
+
* per run and shared by build and merge mode. Populated by {@link runConvert} before either mode
|
|
63
|
+
* builds a declaration; empty when no condition carries an attribute id.
|
|
64
|
+
*/
|
|
65
|
+
attributeDataTypes = new Map();
|
|
66
|
+
/**
|
|
67
|
+
* Product2 ids named by some rule's ProductPath that the Product2 query did not return — the same
|
|
68
|
+
* condition {@link resolveProductCodes} already warns about per id, captured so later reporting can
|
|
69
|
+
* tell an operator that a rule is blocked permanently (the product does not exist / is not visible
|
|
70
|
+
* here) rather than blocked until the next run. Deliberately populated only on the path that emits
|
|
71
|
+
* that warning: when the query itself fails no id is recorded, so nothing can claim a product was
|
|
72
|
+
* absent when we simply never learned.
|
|
73
|
+
*/
|
|
74
|
+
productIdsMissingFromOrg = new Set();
|
|
60
75
|
async runConvert(ctx) {
|
|
61
76
|
// Tripwire: convert is now strictly file-only. The legacy --update-records flag mutated the org
|
|
62
77
|
// as a side effect; it is removed, and passing it errors with a pointer to the new flow.
|
|
@@ -81,13 +96,17 @@ export class InsuranceRuleConvertCommand extends SfCommand {
|
|
|
81
96
|
}
|
|
82
97
|
const ruleDefs = this.parseAllRecords(records);
|
|
83
98
|
const { productIdToCode, productIdToName } = await this.resolveProductCodes(conn, ruleDefs);
|
|
99
|
+
this.attributeDataTypes = await this.resolveAttributeDataTypes(conn, ruleDefs);
|
|
84
100
|
const api = ctx.cmlApi ?? (await this.discoverCmlApi(conn, ruleDefs, productIdToCode));
|
|
85
101
|
const safeApi = api.replace(/[^a-zA-Z0-9_-]/g, '_');
|
|
86
102
|
if (ctx.mergeWithOrg) {
|
|
87
103
|
return this.runMergeConvert(ctx, conn, records, ruleDefs, productIdToCode, api, safeApi, workspaceDir);
|
|
88
104
|
}
|
|
89
|
-
const { cmlModel, ruleKeyMapping } = buildCmlModel(ruleDefs, productIdToCode, this.keyPrefix, this.constraintLabel, this.ruleType, productIdToName);
|
|
105
|
+
const { cmlModel, ruleKeyMapping, skipped } = buildCmlModel(ruleDefs, productIdToCode, this.keyPrefix, this.constraintLabel, this.ruleType, productIdToName, this.attributeDataTypes);
|
|
90
106
|
ruleKeyMapping.forEach((m) => this.log(` -> ${m.name} => ${m.ruleKey}`));
|
|
107
|
+
// Mirrors the merge modes' SKIPPED lines: a rule the generator refused is named with its
|
|
108
|
+
// reason, never dropped in silence.
|
|
109
|
+
skipped.forEach((s) => this.warn(` SKIPPED ${s.name}: ${s.reason}`));
|
|
91
110
|
const recordUpdateFile = await this.writeRecordUpdateFile(records, ruleKeyMapping, api, safeApi, workspaceDir);
|
|
92
111
|
return this.writeOutputFiles(cmlModel, ruleKeyMapping, safeApi, workspaceDir, api, recordUpdateFile);
|
|
93
112
|
}
|
|
@@ -123,7 +142,7 @@ export class InsuranceRuleConvertCommand extends SfCommand {
|
|
|
123
142
|
this.log('\nNext steps (this command wrote nothing to the org):');
|
|
124
143
|
this.log(' 1. Review the merged .cml file (diff against the org model) and the record update file');
|
|
125
144
|
this.log(` 2. Activate the CML: sf cml import as-expression-set --cml-api ${api} --context-definition <CD_NAME> --target-org <org>`);
|
|
126
|
-
this.log(` 3. Apply the org-record changes
|
|
145
|
+
this.log(` 3. Apply the org-record changes: sf insurance import record-updates --file ${recordUpdateFile} --target-org <org>`);
|
|
127
146
|
return { cmlFile: cmlPath, associationsFile: associationsPath, ruleKeyMapping, recordUpdateFile };
|
|
128
147
|
}
|
|
129
148
|
/**
|
|
@@ -198,6 +217,37 @@ export class InsuranceRuleConvertCommand extends SfCommand {
|
|
|
198
217
|
this.log(`Parsed ${parsed.length} valid rule definitions`);
|
|
199
218
|
return parsed;
|
|
200
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Resolves the comparable data type of every attribute the rules reference.
|
|
222
|
+
*
|
|
223
|
+
* A condition reports `dataType: 'Picklist'`, which is not a comparable type — a Deductible whose
|
|
224
|
+
* values are 250/500/1000 sits behind a Currency picklist. Unresolved, its values are emitted
|
|
225
|
+
* quoted while the same model declares the attribute `decimal`, so the rule compares a decimal
|
|
226
|
+
* against a string and never fires.
|
|
227
|
+
*
|
|
228
|
+
* A failure here is downgraded to a warning rather than aborting the convert: without resolution
|
|
229
|
+
* every value falls back to the string-quoted path, which is the pre-existing behavior.
|
|
230
|
+
*/
|
|
231
|
+
async resolveAttributeDataTypes(conn, ruleDefs) {
|
|
232
|
+
const attributeIds = new Set();
|
|
233
|
+
for (const { ruleDef } of ruleDefs) {
|
|
234
|
+
for (const criteria of ruleDef.ruleCriteria ?? []) {
|
|
235
|
+
for (const condition of criteria.conditions ?? []) {
|
|
236
|
+
if (condition.attributeId)
|
|
237
|
+
attributeIds.add(condition.attributeId);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (attributeIds.size === 0)
|
|
242
|
+
return new Map();
|
|
243
|
+
try {
|
|
244
|
+
return await fetchAttributeDataTypes(conn, attributeIds);
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
247
|
+
this.warn(`Could not resolve attribute data types (${err instanceof Error ? err.message : String(err)}); picklist values will be compared as strings and numeric comparisons may not fire`);
|
|
248
|
+
return new Map();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
201
251
|
async resolveProductCodes(conn, ruleDefs) {
|
|
202
252
|
// Collect EVERY ProductPath segment, not just the root: merge mode needs the code of each
|
|
203
253
|
// segment to build the platform-compatible pathed rule key, and the leaf segment's code to
|
|
@@ -219,12 +269,15 @@ export class InsuranceRuleConvertCommand extends SfCommand {
|
|
|
219
269
|
// ids mean the Product2 row is invalid / deleted / outside the visible scope — generation
|
|
220
270
|
// will silently fall back to the raw Id for that path segment, again yielding a non-matching
|
|
221
271
|
// platform RuleKey. Surface this case explicitly so the operator can investigate.
|
|
272
|
+
const missingFromOrg = new Set();
|
|
222
273
|
for (const id of productIds) {
|
|
223
274
|
if (!productIdToCode.has(id)) {
|
|
275
|
+
missingFromOrg.add(id);
|
|
224
276
|
this.warn(`Product ${id} was not returned by Product2 query (not found, not visible, or filtered out); ` +
|
|
225
277
|
'rule key for paths through this product will fall back to the raw Id and may not match the platform-generated RuleKey');
|
|
226
278
|
}
|
|
227
279
|
}
|
|
280
|
+
this.productIdsMissingFromOrg = missingFromOrg;
|
|
228
281
|
this.validateAssociationNames(productIdToName);
|
|
229
282
|
return { productIdToCode, productIdToName };
|
|
230
283
|
}
|
|
@@ -305,7 +358,7 @@ export class InsuranceRuleConvertCommand extends SfCommand {
|
|
|
305
358
|
this.log('\nNext steps (this command wrote nothing to the org):');
|
|
306
359
|
this.log(' 1. Review the generated .cml file and the record update file');
|
|
307
360
|
this.log(` 2. Activate the CML: sf cml import as-expression-set --cml-api ${api} --context-definition <CD_NAME> --target-org <org>`);
|
|
308
|
-
this.log(` 3. Apply the org-record changes
|
|
361
|
+
this.log(` 3. Apply the org-record changes: sf insurance import record-updates --file ${recordUpdateFile} --target-org <org>`);
|
|
309
362
|
return { cmlFile: cmlPath, associationsFile: associationsPath, ruleKeyMapping, recordUpdateFile };
|
|
310
363
|
}
|
|
311
364
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insurance-rule-convert-command.js","sourceRoot":"","sources":["../../../src/shared/insurance/insurance-rule-convert-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,mHAAmH;AACnH,4EAA4E;AAC5E,yCAAyC;AACzC,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAc,QAAQ,EAAO,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,+BAA+B,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7G,OAAO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AG,CAAC,gEAAgE,CAAC,CAAC;QAC3E,IAAI,CAAC,GAAG,CACN,oEAAoE,GAAG,oDAAoD,CAC5H,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,mDAAmD,gBAAgB,oBAAoB,CAAC,CAAC;QAElG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC;IACpG,CAAC;;AAWH,SAAS,oBAAoB,CAAC,QAAuC;IACnE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QAClC,6FAA6F;QAC7F,0BAA0B;QAC1B,KAAK,MAAM,EAAE,IAAI,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC;YAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,+FAA+F;AAC/F,gGAAgG;AAChG,SAAS,qBAAqB,CAAC,QAAuC;IACpE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QAClC,8FAA8F;QAC9F,2DAA2D;QAC3D,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,IAAI,IAAI;YAAE,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
1
|
+
{"version":3,"file":"insurance-rule-convert-command.js","sourceRoot":"","sources":["../../../src/shared/insurance/insurance-rule-convert-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,mHAAmH;AACnH,4EAA4E;AAC5E,yCAAyC;AACzC,OAAO,KAAK,EAAE,MAAM,kBA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IACpE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QAClC,8FAA8F;QAC9F,2DAA2D;QAC3D,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,IAAI,IAAI;YAAE,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
import { CmlModel } from '../types/types.js';
|
|
2
2
|
import { ParsedRuleDefinition, RuleCriteria, RuleKeyEntry, RuleRecord, UnderwritingRuleGroup } from './models.js';
|
|
3
|
+
/**
|
|
4
|
+
* AttributeDefinition id -> the data type its values must be compared as, resolved from the org by
|
|
5
|
+
* {@link fetchAttributeDataTypes}.
|
|
6
|
+
*
|
|
7
|
+
* Needed because a condition reports `dataType: 'Picklist'`, and a picklist carries no comparable
|
|
8
|
+
* type of its own — a Deductible whose values are 250/500/1000 sits behind a Currency picklist.
|
|
9
|
+
* Left unresolved, its values are emitted quoted while PcmGenerator declares the attribute
|
|
10
|
+
* `decimal`, so the model compares a decimal against a string literal and the rule never fires.
|
|
11
|
+
*/
|
|
12
|
+
export type AttributeDataTypes = ReadonlyMap<string, string>;
|
|
13
|
+
/**
|
|
14
|
+
* Raw context tag name -> the type the org's ContextAttribute declares for it. Structurally the
|
|
15
|
+
* subset of `ContextTagBindings` this module needs, declared here rather than imported so the
|
|
16
|
+
* generator keeps no dependency on the org-fetch layer.
|
|
17
|
+
*
|
|
18
|
+
* Needed for the same reason {@link AttributeDataTypes} is: a Tag condition's own `dataType` is a
|
|
19
|
+
* snapshot taken by the rule engine, while ContextAttribute.DataType is what the model will be made
|
|
20
|
+
* to declare. Feeding the resolved type through here — rather than only into the declaration —
|
|
21
|
+
* keeps the two in step, so a tag can never be declared `decimal(2)` and then compared as a quoted
|
|
22
|
+
* string (the never-fires mismatch `collectAttributeTypes` already guards against on the attribute
|
|
23
|
+
* path).
|
|
24
|
+
*/
|
|
25
|
+
export type ContextTagDataTypes = ReadonlyMap<string, {
|
|
26
|
+
sourceDataType: string;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* The context tags a rule actually EMITS a reference to — the Tag-condition counterpart of
|
|
30
|
+
* {@link collectEmittedAttributes}, and its exact discipline: a condition the safe-literal guard,
|
|
31
|
+
* an unknown operator or a missing value dropped contributes nothing, because its tag never reaches
|
|
32
|
+
* the declaration and so needs no binding.
|
|
33
|
+
*
|
|
34
|
+
* Names are returned RAW (not sanitized): the raw title is what resolves against ContextTag.Title
|
|
35
|
+
* and what the emitted `tagName` / `contextPath` annotation must carry. Sanitizing is the
|
|
36
|
+
* identifier's problem, not the binding's.
|
|
37
|
+
*/
|
|
38
|
+
export declare function collectEmittedContextTags(ruleDefs: Array<{
|
|
39
|
+
ruleDef: {
|
|
40
|
+
ruleCriteria?: RuleCriteria[];
|
|
41
|
+
};
|
|
42
|
+
}>, attributeDataTypes?: AttributeDataTypes, contextTagDataTypes?: ContextTagDataTypes): Set<string>;
|
|
3
43
|
export declare function sanitizeName(name: string): string;
|
|
4
44
|
/**
|
|
5
45
|
* Decodes the common HTML entities that can appear in a RuleDefinition / DynamicRuleDefinition
|
|
@@ -21,9 +61,52 @@ export declare function generateRuleKey(prefix: string, productCode: string, api
|
|
|
21
61
|
* stance of {@link isSafeQuotableString} for condition values.
|
|
22
62
|
*/
|
|
23
63
|
export declare function isSafeAssociationReferenceValue(value: string): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The reasons, if any, why a rule cannot be converted faithfully — one per offending condition.
|
|
66
|
+
* A rule with any reason must be SKIPPED with those reasons reported, never partially converted.
|
|
67
|
+
*
|
|
68
|
+
* Dropping just the offending condition is not an option: `buildConstraintDeclaration` returns
|
|
69
|
+
* `true` once every condition of a criteria is gone, and nothing downstream withholds a rule whose
|
|
70
|
+
* declaration is `true`, so a rule that lost its conditions arrives matching everything. That is
|
|
71
|
+
* the empty-`dataType` defect, and the guard exists so a new cause cannot re-create it. Dropping
|
|
72
|
+
* one condition of several is no better — it widens what the rule matches.
|
|
73
|
+
*
|
|
74
|
+
* Two of the three causes today are a condition CML has no primitive for.
|
|
75
|
+
*
|
|
76
|
+
* A date-typed condition whose value carries a time: CML has no datetime primitive, so the
|
|
77
|
+
* alternatives were to emit a timestamp into a `date` slot (platform behavior unverified) or to
|
|
78
|
+
* silently truncate it to its date part (changes what the rule matches, with no signal).
|
|
79
|
+
*
|
|
80
|
+
* A substring test (Contains / DoesNotContain) on an attribute that is not a string: `strcontain`
|
|
81
|
+
* is a string function, and against a `decimal`, `boolean` or `date` attribute there is nothing
|
|
82
|
+
* faithful to emit — quoting the value produces the never-fires type mismatch, and unquoting it is
|
|
83
|
+
* not a substring test at all.
|
|
84
|
+
*
|
|
85
|
+
* In both cases declining the rule and saying so beats emitting something that quietly does nothing.
|
|
86
|
+
*
|
|
87
|
+
* The third reason is not about one condition but about the rule as a whole: a rule whose criteria
|
|
88
|
+
* existed and lost EVERY condition — see {@link collapsesToUnconditional}. It is raised here rather
|
|
89
|
+
* than through a second mechanism because this function is the single point all three skip-reason
|
|
90
|
+
* collectors (`buildCmlModel`, `buildPathedSurchargeRules`, `buildUnderwritingConstraintRules`)
|
|
91
|
+
* already consult, so every caller withholds the rule the same way and a future caller cannot get
|
|
92
|
+
* half the behaviour.
|
|
93
|
+
*/
|
|
94
|
+
export declare function findUnconvertibleConditions(ruleDef: {
|
|
95
|
+
ruleCriteria?: RuleCriteria[];
|
|
96
|
+
apiName?: string;
|
|
97
|
+
name?: string;
|
|
98
|
+
}, attributeDataTypes?: AttributeDataTypes, contextTagDataTypes?: ContextTagDataTypes): string[];
|
|
99
|
+
/**
|
|
100
|
+
* Both `'true'` returns below are deliberate and stay total — the function must answer for any
|
|
101
|
+
* input, because merge mode builds a rule's statement before deciding whether to place it, and
|
|
102
|
+
* throwing here would bypass a caller's skip handling. Only the FIRST is a faithful conversion (a
|
|
103
|
+
* rule with no criteria really does always apply). The second means every expression was dropped,
|
|
104
|
+
* which {@link findUnconvertibleConditions} classifies as unconvertible so the callers that collect
|
|
105
|
+
* skip reasons withhold the rule instead of placing this declaration.
|
|
106
|
+
*/
|
|
24
107
|
export declare function buildConstraintDeclaration(ruleDef: {
|
|
25
108
|
ruleCriteria?: RuleCriteria[];
|
|
26
|
-
}): string;
|
|
109
|
+
}, attributeDataTypes?: AttributeDataTypes, contextTagDataTypes?: ContextTagDataTypes): string;
|
|
27
110
|
export declare function collectAttributes(ruleDefs: Array<{
|
|
28
111
|
ruleDef: {
|
|
29
112
|
ruleCriteria?: RuleCriteria[];
|
|
@@ -42,22 +125,32 @@ export declare function collectEmittedAttributes(ruleDefs: Array<{
|
|
|
42
125
|
ruleDef: {
|
|
43
126
|
ruleCriteria?: RuleCriteria[];
|
|
44
127
|
};
|
|
45
|
-
}
|
|
128
|
+
}>, attributeDataTypes?: AttributeDataTypes, contextTagDataTypes?: ContextTagDataTypes): Set<string>;
|
|
46
129
|
/**
|
|
47
|
-
* Derives the real CML data type for each collected attribute from its
|
|
48
|
-
* When an attribute appears with more than one distinct CML
|
|
49
|
-
* unknown, it falls back to STRING. Returned alongside (not
|
|
50
|
-
* collectAttributes, which merge mode still depends on.
|
|
130
|
+
* Derives the real CML data type for each collected attribute from its resolved data type (falling
|
|
131
|
+
* back to the condition's own `dataType`). When an attribute appears with more than one distinct CML
|
|
132
|
+
* type (a conflict), or its type is unknown, it falls back to STRING. Returned alongside (not
|
|
133
|
+
* replacing) the Set from collectAttributes, which merge mode still depends on.
|
|
134
|
+
*
|
|
135
|
+
* Shares `conditionDataType` with the declaration builder so an attribute is never declared as one
|
|
136
|
+
* type and then compared as another.
|
|
51
137
|
*/
|
|
52
138
|
export declare function collectAttributeTypes(ruleDefs: Array<{
|
|
53
139
|
ruleDef: {
|
|
54
140
|
ruleCriteria?: RuleCriteria[];
|
|
55
141
|
};
|
|
56
|
-
}
|
|
142
|
+
}>, attributeDataTypes?: AttributeDataTypes): Map<string, string>;
|
|
143
|
+
/** A rule withheld from the built model, with the reason to report to the operator. */
|
|
144
|
+
export type SkippedRule = {
|
|
145
|
+
recordId: string;
|
|
146
|
+
name: string;
|
|
147
|
+
reason: string;
|
|
148
|
+
};
|
|
57
149
|
export declare function buildCmlModel(ruleDefs: Array<{
|
|
58
150
|
record: RuleRecord;
|
|
59
151
|
ruleDef: ParsedRuleDefinition;
|
|
60
|
-
}>, productIdToCode: Map<string, string>, keyPrefix: string, constraintLabel: string, ruleType?: string, productIdToName?: Map<string, string
|
|
152
|
+
}>, productIdToCode: Map<string, string>, keyPrefix: string, constraintLabel: string, ruleType?: string, productIdToName?: Map<string, string>, attributeDataTypes?: AttributeDataTypes): {
|
|
61
153
|
cmlModel: CmlModel;
|
|
62
154
|
ruleKeyMapping: RuleKeyEntry[];
|
|
155
|
+
skipped: SkippedRule[];
|
|
63
156
|
};
|