toJson method

Map<String, dynamic> toJson()

Convert to JSON map.

Implementation

Map<String, dynamic> toJson() => {
      'totalCost': totalCost,
      'itemCount': itemCount,
      'unit': unit,
      'threshold': threshold,
      'exceedsThreshold': exceedsThreshold,
      'costByType': costByType.map(
        (type, summary) => MapEntry(type.name, summary.toJson()),
      ),
      'costBySeverity': costBySeverity.map(
        (severity, cost) => MapEntry(severity.name, cost),
      ),
    };