Migrated from Redmine #1357 | Author: Artem Panfilov
Status: New | Priority: Normal | Created: 2025-02-11
Good day, is there a booking threshold? We have the next code (dart) which used SimplyBook API:
final params = {
"eventId": timeslot.eventId,
"unitId": timeslot.unitId,
"startDate": DateFormat('yyyy-MM-dd').format(timeslot.date),
"startTime": timeslot.startingTime,
"clientData": {
"name": name,
"email": email,
"phone": phone,
},
"additionalFields": additionalFields ?? {},
"count": count,
if (batchId != null) "batchId": batchId,
if (recurringData != null) "recurringData": recurringData,
};
try {
final response = await _sendRequest("book", params);
if (response is Map && response.containsKey("bookings")) {
final bookingList = response["bookings"] as List?;
if (bookingList != null && bookingList.isNotEmpty) {
return BookReservation.fromJson(bookingList.first);
} else {
throw Exception("No bookings found in response.");
}
} else {
throw Exception("Unexpected response format from book API: $response");
}
} catch (e) {
throw Exception("Error during booking: $e");
}
}
The problem is that there are quite frequent errors thrown if we’re trying to book on the upcoming event somewhere in the next 2-3hrs. Is there any internal validations which prevent on booking the timeslot if we just got it from the API?