class GetEnergyConsumptionPerDeviceParam {
  const GetEnergyConsumptionPerDeviceParam({
    this.monthDate,
    this.spaceId,
    this.communityId,
  });

  final DateTime? monthDate;
  final String? spaceId;
  final String? communityId;

  Map<String, dynamic> toJson() => {
        'monthDate':
            '${monthDate?.year}-${monthDate?.month.toString().padLeft(2, '0')}',
        if (spaceId == null || spaceId == null) 'spaceUuid': spaceId,
        'communityUuid': communityId,
        'groupByDevice': true,
      };
}
