From ded6e02663f4efdde3812318b6f25a51df919f3b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 26 Nov 2023 15:05:45 +0300 Subject: [PATCH] CheckIn By Param added --- lib/pages/BookAppointment/QRCode.dart | 10 +++++----- lib/services/appointment_services/GetDoctorsList.dart | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index a6d55dce..2c2cc83d 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -77,7 +77,7 @@ class _QRCodeState extends State { Future.delayed(const Duration(milliseconds: 500), () { showNfcReader(context, onNcfScan: (String nfcId) { Future.delayed(const Duration(milliseconds: 100), () { - sendNfcCheckInRequest(nfcId); + sendNfcCheckInRequest(nfcId, 1); locator().todoList.to_do_list_nfc(widget.appointment); }); }, onCancel: () { @@ -90,7 +90,7 @@ class _QRCodeState extends State { startQRCodeScan() async { String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent; if (onlineCheckInQRCode != "") { - sendNfcCheckInRequest(onlineCheckInQRCode); + sendNfcCheckInRequest(onlineCheckInQRCode, 2); locator().todoList.to_do_list_nfc(widget.appointment); } else {} } @@ -102,7 +102,7 @@ class _QRCodeState extends State { double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude), double.parse(projectDetailListModel.longitude)).ceilToDouble() * 1000; print(dist); if (dist <= projectDetailListModel.geofenceRadius) { - sendNfcCheckInRequest(projectDetailListModel.checkInQrCode); + sendNfcCheckInRequest(projectDetailListModel.checkInQrCode, 3); } else { AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError); } @@ -341,12 +341,12 @@ class _QRCodeState extends State { return docSpeciality; } - sendNfcCheckInRequest(String nfcId) { + sendNfcCheckInRequest(String nfcId, int checkInBy) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) { + service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, checkInBy, context).then((res) { print(res); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 052078bf..a7482eaa 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1553,13 +1553,14 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, BuildContext context) async { + Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async { Map request; request = { "AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, + "CheckinBy": checkInBy }; dynamic localRes; await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async {