Kaizen
Browse modulesPricingpricing/sharedFunctions

Function: mergeWithBuiltInScopes()

function mergeWithBuiltInScopes(custom: 
  | Record<string, Record<string, string> | undefined>
| undefined): Record<string, Record<string, string>>;

Defined in: shared/pricing/scope-mapping.ts:132

Section-level deep merge of a consumer-supplied scope mapping with the package's built-in PRICING_SCOPES. Two levels: section → scope_type → path. On collision (same section + same scope_type), the consumer's value wins.

Untyped on TContext deliberately: the merge is purely structural and the downstream consumers (buildEngineScopeMapping, partitionPricingResult's lineItemScopes) only need the loose Record<string, Record<string, string>> shape. Keeping the typed PricingScopeMapping<TContext> surface on the public API still type-checks consumer authoring at the boundary; we just widen here.

Parameters

ParameterType
custom| Record<string, Record<string, string> | undefined> | undefined

Returns

Record<string, Record<string, string>>

On this page