|
|
|
|
@ -373,10 +373,9 @@ class AppointmentsVM extends BaseVM {
|
|
|
|
|
(element.appointmentStatusEnum == AppointmentStatusEnum.booked || element.appointmentStatusEnum == AppointmentStatusEnum.confirmed) &&
|
|
|
|
|
(DateHelper.parseStringToDate(element.appointmentDate!).isAfter(DateTime.now())))
|
|
|
|
|
.toList();
|
|
|
|
|
log("myUpComingAppointments: ${myUpComingAppointments.length}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log("myUpComingAppointments: ${myUpComingAppointments.length}");
|
|
|
|
|
|
|
|
|
|
if (isNeedCustomerFilter) {
|
|
|
|
|
myFilteredAppointmentsForProvider = findAppointmentsBasedOnCustomers(myFilteredAppointmentsForProvider);
|
|
|
|
|
}
|
|
|
|
|
@ -391,10 +390,9 @@ class AppointmentsVM extends BaseVM {
|
|
|
|
|
}
|
|
|
|
|
int index = appointmentsFilterOptions.indexWhere((element) => element.id == appointmentStatusEnum.getIdFromAppointmentStatusEnum());
|
|
|
|
|
appointmentsFilterOptions[index].isSelected = true;
|
|
|
|
|
|
|
|
|
|
isAppointmentLoading = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
myFilteredAppointmentsForCustomers = await getAppointmentsBasedOnFiltersForCustomer();
|
|
|
|
|
myFilteredAppointmentsForCustomers = await getAppointmentsBasedOnFiltersForCustomer(appointmentStatusEnum: appointmentStatusEnum);
|
|
|
|
|
isAppointmentLoading = false;
|
|
|
|
|
|
|
|
|
|
if (shouldPopulateUpcoming) {
|
|
|
|
|
@ -1814,7 +1812,7 @@ class AppointmentsVM extends BaseVM {
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<List<AppointmentListModel>> getAppointmentsBasedOnFiltersForCustomer() async {
|
|
|
|
|
Future<List<AppointmentListModel>> getAppointmentsBasedOnFiltersForCustomer({required AppointmentStatusEnum appointmentStatusEnum}) async {
|
|
|
|
|
try {
|
|
|
|
|
setState(ViewState.busy);
|
|
|
|
|
List<String> providersIdsList = [];
|
|
|
|
|
@ -1854,6 +1852,7 @@ class AppointmentsVM extends BaseVM {
|
|
|
|
|
serviceIdsList: servicesIdsList,
|
|
|
|
|
itemIdsList: itemIdsList,
|
|
|
|
|
branchIdsList: branchesIdsList,
|
|
|
|
|
appointmentStatusEnum: appointmentStatusEnum,
|
|
|
|
|
);
|
|
|
|
|
setState(ViewState.idle);
|
|
|
|
|
|
|
|
|
|
|