Issue #64.2: Mathematical Expression Evaluator #66

Open
opened 2025-10-02 08:25:47 +00:00 by tegwick · 0 comments
Owner

Implement calculation engine for business logic and mathematical operations

Epic: #64 Template & Calculation Engine
Priority: Critical | Effort: Large | Dependencies: #65 (Template Engine Foundation)

Description

Implement calculation engine for business logic and mathematical operations to enable automated calculations in business documents.

Acceptance Criteria

  • Evaluate expressions: {{add field1 field2}}, {{multiply quantity price}}
  • Support mathematical functions: add, subtract, multiply, divide, sum, avg
  • Handle currency formatting and decimal precision
  • Array operations: sum, count, filter, map
  • Date/time calculations and formatting
  • Error handling for invalid calculations

Technical Requirements

  • Expression parser with mathematical operation support
  • Type system for numbers, currencies, dates
  • Formatter system for output presentation
  • Integration with template variable substitution

Example Usage

Total: {{multiply quantity unit_price}} EUR
Tax: {{multiply total 0.19}} EUR
Grand Total: {{add total tax}} EUR
Implement calculation engine for business logic and mathematical operations **Epic**: #64 Template & Calculation Engine **Priority**: Critical | **Effort**: Large | **Dependencies**: #65 (Template Engine Foundation) ## Description Implement calculation engine for business logic and mathematical operations to enable automated calculations in business documents. ## Acceptance Criteria - [ ] Evaluate expressions: `{{add field1 field2}}`, `{{multiply quantity price}}` - [ ] Support mathematical functions: add, subtract, multiply, divide, sum, avg - [ ] Handle currency formatting and decimal precision - [ ] Array operations: sum, count, filter, map - [ ] Date/time calculations and formatting - [ ] Error handling for invalid calculations ## Technical Requirements - Expression parser with mathematical operation support - Type system for numbers, currencies, dates - Formatter system for output presentation - Integration with template variable substitution ## Example Usage ```markdown Total: {{multiply quantity unit_price}} EUR Tax: {{multiply total 0.19}} EUR Grand Total: {{add total tax}} EUR ```
tegwick added this to the Templates, Calculations and Workflows project 2025-10-02 13:01:13 +00:00
Sign in to join this conversation.