use TimeOfDay instead of String

This commit is contained in:
Rafeek-Khoudare
2025-07-07 17:07:38 +03:00
parent 368b1be3c0
commit 42c410d982
5 changed files with 47 additions and 28 deletions

View File

@ -1,4 +1,5 @@
import 'package:syncrow_web/pages/access_management/manage_bookable_spaces/domain/models/bookable_space_model.dart';
import 'package:syncrow_web/utils/string_utils.dart';
class SendBookableSpacesToApiParams {
List<String> spaceUuids;
@ -14,7 +15,7 @@ class SendBookableSpacesToApiParams {
required this.points,
});
static SendBookableSpacesToApiParams fromBookableSpacesModel(
static SendBookableSpacesToApiParams fromBookableSpacesModel(
List<BookableSpacemodel> bookableSpaces) {
return SendBookableSpacesToApiParams(
spaceUuids: bookableSpaces.map((space) => space.spaceUuid).toList(),
@ -22,8 +23,10 @@ class SendBookableSpacesToApiParams {
.expand((space) => space.spaceConfig.bookableDays)
.toSet()
.toList(),
startTime: bookableSpaces.first.spaceConfig.bookingStartTime,
endTime: bookableSpaces.first.spaceConfig.bookingEndTime,
startTime: formatTimeOfDayTo24HourString(
bookableSpaces.first.spaceConfig.bookingStartTime),
endTime: formatTimeOfDayTo24HourString(
bookableSpaces.first.spaceConfig.bookingEndTime),
points: bookableSpaces.first.spaceConfig.cost,
);
}