You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.8 KiB
Dart
69 lines
2.8 KiB
Dart
import 'package:doctor_app_flutter/config/config.dart';
|
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart';
|
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart';
|
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart';
|
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoResponseModel.dart';
|
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart';
|
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart';
|
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
|
|
|
class PatientRegistrationService extends BaseService {
|
|
GetPatientInfoResponseModel getPatientInfoResponseModel;
|
|
|
|
checkPatientForRegistration(
|
|
CheckPatientForRegistrationModel registrationModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post(CHECK_PATIENT_FOR_REGISTRATION,
|
|
onSuccess: (dynamic response, int statusCode) {},
|
|
onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: registrationModel.toJson());
|
|
}
|
|
|
|
getPatientInfo(GetPatientInfoRequestModel getPatientInfoRequestMode) async {
|
|
hasError = false;
|
|
await baseAppClient.post(GET_PATIENT_INFO,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
getPatientInfoResponseModel =
|
|
GetPatientInfoResponseModel.fromJson(response);
|
|
print("ddd");
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: getPatientInfoRequestMode.toJson());
|
|
}
|
|
|
|
sendActivationCodeByOTPNotificationType(
|
|
SendActivationCodeByOTPNotificationTypeForRegistrationModel
|
|
registrationModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE,
|
|
onSuccess: (dynamic response, int statusCode) {},
|
|
onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: registrationModel.toJson());
|
|
}
|
|
|
|
checkActivationCode(CheckActivationCodeModel registrationModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_PATIENT,
|
|
onSuccess: (dynamic response, int statusCode) {},
|
|
onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: registrationModel.toJson());
|
|
}
|
|
|
|
registrationPatient(PatientRegistrationModel registrationModel) async {
|
|
hasError = false;
|
|
await baseAppClient.post(PATIENT_REGISTRATION,
|
|
onSuccess: (dynamic response, int statusCode) {},
|
|
onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: registrationModel.toJson());
|
|
}
|
|
}
|