Refactor calendar event loading: replace parameters with LoadEventsParam class and implement memory caching for improved performance

This commit is contained in:
mohammad
2025-07-17 11:20:32 +03:00
parent c6729f476f
commit c9b8fbb0c2
8 changed files with 100 additions and 47 deletions

View File

@ -0,0 +1,28 @@
import 'package:equatable/equatable.dart';
class LoadEventsParam extends Equatable {
final DateTime startDate;
final DateTime endDate;
final String id;
const LoadEventsParam({
required this.startDate,
required this.endDate,
required this.id,
});
@override
List<Object?> get props => [startDate, endDate, id];
LoadEventsParam copyWith({
DateTime? startDate,
DateTime? endDate,
String? id,
}) {
return LoadEventsParam(
startDate: startDate ?? this.startDate,
endDate: endDate ?? this.endDate,
id: id ?? this.id,
);
}
}

View File

@ -1,9 +1,8 @@
import 'package:syncrow_web/pages/access_management/booking_system/domain/LoadEventsParam.dart';
import 'package:syncrow_web/pages/access_management/booking_system/domain/models/calendar_event_booking.dart';
abstract class CalendarSystemService {
Future<CalendarEventsResponse> getCalendarEvents({
required String spaceId,
required String month,
required String year,
required LoadEventsParam params,
});
}