2026-03-19: Formula Output Type Enhancements & Currency Stability
Key Achievements
- Enhanced Formula Output Type Resolution:
- Refactored
updateFormulaFieldSuggestionsinright-panel-static.component.tsto correctly resolveoutputTypeandcurrencyfor formula fields, particularly for rule-based formulas. - Added support for
ruleBasedReturnTypemetadata to ensure type stability when chaining formulas. - Updated suggestion logic to correctly handle
decimal,currency, anddatetypes for regular widgets and calculated fields.
- Refactored
- Improved Currency Defaulting:
- Terminated accidental currency assignments by defaulting
currencytoundefined(instead ofINR) inDynaformService.getConfig(). - Implemented prioritization for resolved currency from referenced fields, falling back to defaults only when appropriate.
- Terminated accidental currency assignments by defaulting
- Refined Type Handling in Properties Panel:
- Optimized
onNumberTypeChangelogic to preserve field metadata when transitioning between field types. - Ensured formula fields in the suggestion list correctly inherit relevant widget properties (e.g.,
fieldType: 'datepicker'for date formulas).
- Optimized
Design Decisions
- Metadata Inheritance: Decided to propagate formula result metadata through the suggestion engine rather than recalculating it on every interaction, improving build-time performance.
- Type Stability: Enforced specialized formula return types (
decimal,currency,date) to prevent accidental type-mismatches in downstream calculators. - Explicit Currency Configuration: Switched to
undefineddefaults for currency to ensure that currency icons and codes only appear when explicitly intended by the user.