removed getting energy management data using communityUuid.

This commit is contained in:
Faris Armoush
2025-06-03 16:01:45 +03:00
parent 74ae9d7ce1
commit 0135b6711e
3 changed files with 0 additions and 13 deletions

View File

@ -16,7 +16,6 @@ import 'package:syncrow_web/pages/analytics/params/get_total_energy_consumption_
abstract final class FetchEnergyManagementDataHelper { abstract final class FetchEnergyManagementDataHelper {
const FetchEnergyManagementDataHelper._(); const FetchEnergyManagementDataHelper._();
// static const String _powerClampId = 'cb71d6ad-6e29-4eaa-ae3e-1a0d1c5f60fa';
static AnalyticsDevice? getSelectedDevice(BuildContext context) { static AnalyticsDevice? getSelectedDevice(BuildContext context) {
return context.read<AnalyticsDevicesBloc>().state.selectedDevice; return context.read<AnalyticsDevicesBloc>().state.selectedDevice;
} }
@ -48,7 +47,6 @@ abstract final class FetchEnergyManagementDataHelper {
loadTotalEnergyConsumption( loadTotalEnergyConsumption(
context, context,
selectedDate: selectedDate0, selectedDate: selectedDate0,
communityId: communityId,
spaceId: spaceId, spaceId: spaceId,
); );
final selectedDevice = getSelectedDevice(context); final selectedDevice = getSelectedDevice(context);
@ -61,7 +59,6 @@ abstract final class FetchEnergyManagementDataHelper {
} }
loadEnergyConsumptionPerDevice( loadEnergyConsumptionPerDevice(
context, context,
communityId: communityId,
spaceId: spaceId, spaceId: spaceId,
selectedDate: selectedDate0, selectedDate: selectedDate0,
); );
@ -84,12 +81,10 @@ abstract final class FetchEnergyManagementDataHelper {
static void loadTotalEnergyConsumption( static void loadTotalEnergyConsumption(
BuildContext context, { BuildContext context, {
DateTime? selectedDate, DateTime? selectedDate,
required String communityId,
required String spaceId, required String spaceId,
}) { }) {
final param = GetTotalEnergyConsumptionParam( final param = GetTotalEnergyConsumptionParam(
spaceId: spaceId, spaceId: spaceId,
communityId: communityId,
monthDate: selectedDate, monthDate: selectedDate,
); );
context.read<TotalEnergyConsumptionBloc>().add( context.read<TotalEnergyConsumptionBloc>().add(
@ -100,12 +95,10 @@ abstract final class FetchEnergyManagementDataHelper {
static void loadEnergyConsumptionPerDevice( static void loadEnergyConsumptionPerDevice(
BuildContext context, { BuildContext context, {
DateTime? selectedDate, DateTime? selectedDate,
required String communityId,
required String spaceId, required String spaceId,
}) { }) {
final param = GetEnergyConsumptionPerDeviceParam( final param = GetEnergyConsumptionPerDeviceParam(
spaceId: spaceId, spaceId: spaceId,
communityId: communityId,
monthDate: selectedDate, monthDate: selectedDate,
); );
context.read<EnergyConsumptionPerDeviceBloc>().add( context.read<EnergyConsumptionPerDeviceBloc>().add(

View File

@ -2,18 +2,15 @@ class GetEnergyConsumptionPerDeviceParam {
const GetEnergyConsumptionPerDeviceParam({ const GetEnergyConsumptionPerDeviceParam({
this.monthDate, this.monthDate,
this.spaceId, this.spaceId,
this.communityId,
}); });
final DateTime? monthDate; final DateTime? monthDate;
final String? spaceId; final String? spaceId;
final String? communityId;
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
'monthDate': 'monthDate':
'${monthDate?.year}-${monthDate?.month.toString().padLeft(2, '0')}', '${monthDate?.year}-${monthDate?.month.toString().padLeft(2, '0')}',
if (spaceId == null || spaceId == null) 'spaceUuid': spaceId, if (spaceId == null || spaceId == null) 'spaceUuid': spaceId,
'communityUuid': communityId,
'groupByDevice': true, 'groupByDevice': true,
}; };
} }

View File

@ -1,12 +1,10 @@
class GetTotalEnergyConsumptionParam { class GetTotalEnergyConsumptionParam {
final DateTime? monthDate; final DateTime? monthDate;
final String? spaceId; final String? spaceId;
final String? communityId;
const GetTotalEnergyConsumptionParam({ const GetTotalEnergyConsumptionParam({
this.monthDate, this.monthDate,
this.spaceId, this.spaceId,
this.communityId,
}); });
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -14,7 +12,6 @@ class GetTotalEnergyConsumptionParam {
'monthDate': 'monthDate':
'${monthDate?.year}-${monthDate?.month.toString().padLeft(2, '0')}', '${monthDate?.year}-${monthDate?.month.toString().padLeft(2, '0')}',
if (spaceId == null || spaceId == null) 'spaceUuid': spaceId, if (spaceId == null || spaceId == null) 'spaceUuid': spaceId,
'communityUuid': communityId,
'groupByDevice': false, 'groupByDevice': false,
}; };
} }