completed the demo

faiz_dev
faizatflutter 3 days ago
parent 864b19d166
commit bcbdbb295d

@ -210,9 +210,9 @@ class ApiClientImp implements ApiClient {
body['TokenID'] = "@dm!n";
}
body['TokenID'] = "@dm!n";
// body['TokenID'] = "@dm!n";
// body['PatientID'] = 6424682;
body['PatientID'] = 4770714;
// body['PatientID'] = 4772785;
// body['PatientID'] = 4771727;
// body['PatientID'] = 3648831;
// body['PatientID'] = 89754444;
@ -263,7 +263,7 @@ class ApiClientImp implements ApiClient {
body: requestBody,
headers: headers,
);
// log("response: ${response.body.toString()}");
log("response: ${response.body.toString()}");
} on SocketException catch (e) {
final message = e.message.contains('Connection reset by peer') ? LocaleKeys.networkConnectionReset.tr() : LocaleKeys.networkErrorMessage.tr();
onFailure(message, -1, failureType: ConnectivityFailure(message));

@ -289,6 +289,7 @@ class ApiConsts {
static String submitRefund = "Services/COCWS.svc/REST/SubmitRefund";
static String isRefundableInvoice = "Services/Outps.svc/REST/isRefundableInvoice";
static String getThresholdAmount = "Services/OUTPs.svc/REST/HIS_getThresholdAmount";
static String checkIfPatientAdmitted = 'Services/Inps.svc/REST/checkIsPatientAdmittedOrAdmissionRequest';
static String getAiAnalysisURL = "https://api.labpredict.com";
static String getAiRadiologyAnalysis = "$getAiAnalysisURL/radiology";
@ -922,8 +923,6 @@ var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi';
// Check If InPatient API
var CHECK_IF_INPATIENT = 'Services/Patients.svc/REST/GetInPatientAdmissionInfo';
var CHECK_IF_PATIENT_ADMITTED = 'Services/Inps.svc/REST/checkIsPatientAdmittedOrAdmissionRequest';
// Get General Instructions API
var GET_GENERAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getGeneralInstructions';

@ -13,7 +13,12 @@ abstract class HabibWalletRepo {
Future<Either<Failure, GenericApiModel<List<HospitalsModel>>>> getProjectList();
Future<Either<Failure, GenericApiModel<dynamic>>> HISCreateAdvancePayment(
{required String paymentMethodName, required num paidAmount, required String paymentReference, required String patientID, required int projectID, required String depositorName});
{required String paymentMethodName,
required num paidAmount,
required String paymentReference,
required String patientID,
required int projectID,
required String depositorName});
Future<Either<Failure, GenericApiModel<dynamic>>> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference});
@ -52,7 +57,10 @@ class HabibWalletRepoImp implements HabibWalletRepo {
// throw Exception("lab list is empty");
// }
final List<PatientAdvanceBalanceResponseModel> balanceAmountList = list.map((item) => PatientAdvanceBalanceResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientAdvanceBalanceResponseModel>();
final List<PatientAdvanceBalanceResponseModel> balanceAmountList = list
.map((item) => PatientAdvanceBalanceResponseModel.fromJson(item as Map<String, dynamic>))
.toList()
.cast<PatientAdvanceBalanceResponseModel>();
for (var element in balanceAmountList) {
element.totalAmount = response['TotalAdvanceBalanceAmount'];
@ -117,7 +125,12 @@ class HabibWalletRepoImp implements HabibWalletRepo {
@override
Future<Either<Failure, GenericApiModel>> HISCreateAdvancePayment(
{required String paymentMethodName, required num paidAmount, required String paymentReference, required String patientID, required int projectID, required String depositorName}) async {
{required String paymentMethodName,
required num paidAmount,
required String paymentReference,
required String patientID,
required int projectID,
required String depositorName}) async {
Map<String, dynamic> request = {
"CustName": depositorName,
"CustID": patientID,
@ -319,7 +332,7 @@ class HabibWalletRepoImp implements HabibWalletRepo {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
CHECK_IF_PATIENT_ADMITTED,
ApiConsts.checkIfPatientAdmitted,
body: requestBody,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;

@ -557,7 +557,12 @@ class HabibWalletViewModel extends ChangeNotifier {
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result = await habibWalletRepo.HISCreateAdvancePayment(
paymentMethodName: paymentMethodName, paidAmount: paidAmount, paymentReference: paymentReference, patientID: patientID, projectID: projectID, depositorName: depositorName);
paymentMethodName: paymentMethodName,
paidAmount: paidAmount,
paymentReference: paymentReference,
patientID: patientID,
projectID: projectID,
depositorName: depositorName);
result.fold(
// (failure) async => await errorHandlerService.handleError(failure: failure),
@ -579,7 +584,8 @@ class HabibWalletViewModel extends ChangeNotifier {
);
}
Future<void> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference, Function(dynamic)? onSuccess, Function(String)? onError}) async {
Future<void> addAdvanceNumberRequest(
{required String advanceNumber, required String paymentReference, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await habibWalletRepo.addAdvanceNumberRequest(advanceNumber: advanceNumber, paymentReference: paymentReference);
result.fold(
@ -631,7 +637,8 @@ class HabibWalletViewModel extends ChangeNotifier {
lakumAccountInfo = LakumInquiryInformationResponseModel();
notifyListeners();
final result = await habibWalletRepo.getLakumAccountInformation(identificationNumber: getIt.get<AppState>().getAuthenticatedUser()!.patientIdentificationNo ?? "");
final result = await habibWalletRepo.getLakumAccountInformation(
identificationNumber: getIt.get<AppState>().getAuthenticatedUser()!.patientIdentificationNo ?? "");
result.fold(
// (failure) async => await errorHandlerService.handleError(failure: failure),

@ -215,28 +215,28 @@ class InvoiceListCard extends StatelessWidget {
iconSize: 14.h,
),
),
// if (getInvoicesListResponseModel.isAllowRefund == true) ...[
// SizedBox(width: 8.w),
// Expanded(
// child: CustomButton(
// text: LocaleKeys.requestRefund.tr(context: context),
// onPressed: () {
// _handleRefundInvoiceTap(context);
// },
// icon: AppAssets.refundIcon,
// iconColor: AppColors.caloriesCalculatorColor,
// backgroundColor: AppColors.blueColor.withValues(alpha: 0.14),
// borderColor: AppColors.primaryRedColor.withValues(alpha: 0.01),
// textColor: AppColors.caloriesCalculatorColor,
// fontSize: 14.f,
// fontWeight: FontWeight.w600,
// borderRadius: 12.r,
// padding: EdgeInsets.symmetric(horizontal: 10.w),
// height: 40.h,
// iconSize: 14.h,
// ),
// ),
// ]
if (getInvoicesListResponseModel.isAllowRefund == true) ...[
SizedBox(width: 8.w),
Expanded(
child: CustomButton(
text: LocaleKeys.requestRefund.tr(context: context),
onPressed: () {
_handleRefundInvoiceTap(context);
},
icon: AppAssets.refundIcon,
iconColor: AppColors.caloriesCalculatorColor,
backgroundColor: AppColors.blueColor.withValues(alpha: 0.14),
borderColor: AppColors.primaryRedColor.withValues(alpha: 0.01),
textColor: AppColors.caloriesCalculatorColor,
fontSize: 14.f,
fontWeight: FontWeight.w600,
borderRadius: 12.r,
padding: EdgeInsets.symmetric(horizontal: 10.w),
height: 40.h,
iconSize: 14.h,
),
),
]
],
),
],

@ -1,3 +1,4 @@
import 'dart:developer';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
@ -114,6 +115,7 @@ class _RefundRequestCreatePageState extends State<RefundRequestCreatePage> {
refundReason: !_canSelectIndividualProcedures ? "Inpatient/Package invoice" : null,
))
.toList();
_refundRequestViewModel.setProcedures(
procedures,
needsITGApproval: details.needITGApproval ?? false,

Loading…
Cancel
Save