From 7c50ad7d56372d9c77f7037f496a5b4198349fd8 Mon Sep 17 00:00:00 2001 From: Saman Waqar Date: Thu, 26 Mar 2026 10:32:48 +0500 Subject: [PATCH] locacode added missing locacode added correct assets uncommented API code --- lib/app/core/constants/app_assets.dart | 2 +- lib/app/models/GLACCAddMoneyRequestModel.dart | 7 +- .../controllers/add_money_otp_controller.dart | 15 ++- .../internal_transaction_controller.dart | 119 +++++++++--------- .../controllers/notifications_controller.dart | 26 ++-- 5 files changed, 97 insertions(+), 72 deletions(-) diff --git a/lib/app/core/constants/app_assets.dart b/lib/app/core/constants/app_assets.dart index 7454051..e3ac247 100644 --- a/lib/app/core/constants/app_assets.dart +++ b/lib/app/core/constants/app_assets.dart @@ -101,7 +101,7 @@ class AppAssets { static const ic_sort = "assets/$ORGANIZATION/icons/ic_sort.png"; static const ic_featured = "assets/$ORGANIZATION/icons/ic_featured.svg"; static const ic_congratulations = "assets/$ORGANIZATION/icons/ic_congratulations.svg"; - static const ic_correct_icon = "assets/$ORGANIZATION/icons/ic_correct_icon.svg"; + static const ic_correct_icon = "assets/$ORGANIZATION/icons/ic_congratulation.svg"; static const ic_arrow = "assets/$ORGANIZATION/icons/ic_arrow.svg"; diff --git a/lib/app/models/GLACCAddMoneyRequestModel.dart b/lib/app/models/GLACCAddMoneyRequestModel.dart index ee7d1e1..fa19579 100644 --- a/lib/app/models/GLACCAddMoneyRequestModel.dart +++ b/lib/app/models/GLACCAddMoneyRequestModel.dart @@ -1,5 +1,6 @@ class GLACCAddMoneyRequestModel { String porOrgacode = ""; + String plcLocacode=""; String pctCstycode = ""; String channelCode = ""; String cmpCustcode = ""; @@ -22,6 +23,7 @@ class GLACCAddMoneyRequestModel { GLACCAddMoneyRequestModel({ this.porOrgacode = "", + this.plcLocacode="", this.pctCstycode = "", this.channelCode = "", this.cmpCustcode = "", @@ -45,6 +47,7 @@ class GLACCAddMoneyRequestModel { GLACCAddMoneyRequestModel.empty() : this.porOrgacode = "", + this.plcLocacode="", this.pctCstycode = "", this.channelCode = "", this.cmpCustcode = "", @@ -67,12 +70,13 @@ class GLACCAddMoneyRequestModel { @override String toString() { - return 'GLACCAddMoneyRequestModel{porOrgacode: $porOrgacode, pctCstycode: $pctCstycode, channelCode: $channelCode, cmpCustcode: $cmpCustcode, drPcaGlaccode: $drPcaGlaccode, drPcaGlacdesc: $drPcaGlacdesc, crMbmBkmsnumber: $crMbmBkmsnumber, crMbmBkmstitle: $crMbmBkmstitle, crPcrCurrcode: $crPcrCurrcode, crPcrCurrdesc: $crPcrCurrdesc, crPcrCurrshort: $crPcrCurrshort, sgtGntrnarration: $sgtGntrnarration, dmpProdCode: $dmpProdCode, transType: $transType, notificationId: $notificationId, transMode: $transMode, sgtGntramtfc: $sgtGntramtfc, otdTrancomment: $otdTrancomment, obpPincode: $obpPincode, pinType: $pinType}'; + return 'GLACCAddMoneyRequestModel{porOrgacode: $porOrgacode,plcLocacode:$plcLocacode, pctCstycode: $pctCstycode, channelCode: $channelCode, cmpCustcode: $cmpCustcode, drPcaGlaccode: $drPcaGlaccode, drPcaGlacdesc: $drPcaGlacdesc, crMbmBkmsnumber: $crMbmBkmsnumber, crMbmBkmstitle: $crMbmBkmstitle, crPcrCurrcode: $crPcrCurrcode, crPcrCurrdesc: $crPcrCurrdesc, crPcrCurrshort: $crPcrCurrshort, sgtGntrnarration: $sgtGntrnarration, dmpProdCode: $dmpProdCode, transType: $transType, notificationId: $notificationId, transMode: $transMode, sgtGntramtfc: $sgtGntramtfc, otdTrancomment: $otdTrancomment, obpPincode: $obpPincode, pinType: $pinType}'; } Map toMap() { return { 'porOrgacode': this.porOrgacode, + 'plcLocacode':this.plcLocacode, 'pctCstycode': this.pctCstycode, 'channelCode': this.channelCode, 'cmpCustcode': this.cmpCustcode, @@ -98,6 +102,7 @@ class GLACCAddMoneyRequestModel { factory GLACCAddMoneyRequestModel.fromMap(Map map) { return GLACCAddMoneyRequestModel( porOrgacode: map['porOrgacode'] ?? "", + plcLocacode: map['plcLocacode'] ?? "", pctCstycode: map['pctCstycode'] ?? "", channelCode: map['channelCode'] ?? "", cmpCustcode: map['cmpCustcode'] ?? "", diff --git a/lib/app/modules/add_money/controllers/add_money_otp_controller.dart b/lib/app/modules/add_money/controllers/add_money_otp_controller.dart index ea93242..e38edd7 100644 --- a/lib/app/modules/add_money/controllers/add_money_otp_controller.dart +++ b/lib/app/modules/add_money/controllers/add_money_otp_controller.dart @@ -6,10 +6,13 @@ import 'package:timer_count_down/timer_controller.dart'; import '../../../core/config/server_response.dart'; import '../../../core/constants/app_contants.dart'; import '../../../core/data/repositories/app_repositories.dart'; +import '../../../core/enums/request_constants.dart'; +import '../../../core/utils/SessionCache.dart'; import '../../../custom_widgets/custom_dialog.dart'; import '../../../custom_widgets/custom_toasty.dart'; import '../../../models/GLACCAddMoneyRequestModel.dart'; import '../../../models/evaluated_cuency_model.dart'; +import '../../../models/resend_otp_usend.dart'; import '../../../routes/app_pages.dart'; import '../../general_ledger/controllers/general_ledger_controller.dart'; @@ -53,6 +56,7 @@ class AddMoneyOTPController extends GetxController { return; } transactionSubmitRequestModel; + transactionSubmitRequestModel.plcLocacode = "0010"; transactionSubmitRequestModel.pinType = "TRAN"; transactionSubmitRequestModel.obpPincode = pinPutController.text; sendTransaction(); @@ -78,12 +82,21 @@ class AddMoneyOTPController extends GetxController { } void resenOtp() async { - // if (!isResend.value) { Fluttertoast.showToast(msg: "Please wait for 1 minute"); return; } + var responce = await repository.resendOtpUsend(ResendOtpUsendModel( + channelCode: RequestConstants.channelCode, + porOrgacode: RequestConstants.porOrgacode, + email: SessionCache.instance.userInfo.cmpUserId, + cmpCustcode: SessionCache.instance.userInfo.cmpCustcode, + isOtpRequired: false, + pctCstycode: SessionCache.instance.userInfo.pctCstycode, + pinType: 'C_TRANPIN', + )); + isResend.value = false; countdownController.restart(); Fluttertoast.showToast(msg: "OTP successfully send to your email address"); diff --git a/lib/app/modules/internal_account_transaction/controllers/internal_transaction_controller.dart b/lib/app/modules/internal_account_transaction/controllers/internal_transaction_controller.dart index 0f34b33..c234aec 100644 --- a/lib/app/modules/internal_account_transaction/controllers/internal_transaction_controller.dart +++ b/lib/app/modules/internal_account_transaction/controllers/internal_transaction_controller.dart @@ -1,14 +1,21 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import '../../../core/config/server_response.dart'; +import '../../../core/constants/app_contants.dart'; import '../../../core/data/repositories/app_repositories.dart'; +import '../../../core/enums/request_constants.dart'; import '../../../core/utils/SessionCache.dart'; +import '../../../core/utils/logs_utils.dart'; import '../../../custom_widgets/Fields/field_validations.dart'; import '../../../custom_widgets/Fields/input_field.dart'; import '../../../custom_widgets/custom_dropdown.dart'; import '../../../custom_widgets/custom_toasty.dart'; import '../../../models/DepositAccountResponse.dart'; import '../../../models/ExchangeRate.dart'; +import '../../../models/SendTransactionStep1ResponseModel.dart'; +import '../../../models/TransactionPinRequestModel.dart'; +import '../../../models/TransactionSubmitRequestModel.dart'; import '../../../routes/app_pages.dart'; @@ -115,62 +122,62 @@ class InternalAccountTransController extends GetxController { /// Send Transaction function Future sendTransaction() async { - // if (!validate()) { - // Toasty.error("Please input and then proceed"); - // return; - // } - // - // TransactionSubmitRequestModel transactionSubmitRequestModel = TransactionSubmitRequestModel( - // porOrgacode: RequestConstants.porOrgacode, - // pctCstycode: RequestConstants.pctCstycode, - // channelCode: RequestConstants.channelCode, - // cmpCustcode: SessionCache.instance.userInfo.cmpCustcode, - // drMbmBkmsnumber: selectedFromAccount.value.mbmBkmsnumber, - // drMbmBkmstitle: selectedFromAccount.value.mbmBkmstitle, - // drPcrCurrcode: selectedFromAccount.value.pcrCurrcode, - // drPcrCurrdesc: selectedFromAccount.value.pcrCurrdesc, - // drPcrCurrshort: selectedFromAccount.value.pcrCurrshort, - // crMbmBkmsnumber: selectedToAccount.value.mbmBkmsnumber, - // crMbmBkmstitle: selectedToAccount.value.mbmBkmstitle, - // crPcrCurrcode: selectedExchangeRate!.pcrCurrcode, - // crPcrCurrdesc: selectedExchangeRate!.pcrCurrdesc, - // crPcrCurrshort: selectedExchangeRate!.pcrCurrshort, - // sgtGntrnarration: "", - // dmpProdCode: selectedFromAccount.value.dmpProdcode, - // transType: "DR", - // notificationId: "", - // transMode: "Online", - // sgtGntramtfc: double.parse(sendingAmountField.getCustomText().isEmpty ? "0.0" : sendingAmountField.getCustomText()), - // otdTrancomment: messageField.getCustomText(), - // isOtpRequired: false, - // cmpRefcode: referenceCodeField.getCustomText(), - // ); - // - // dp("********************>>>>>>>>>>>>******************", transactionSubmitRequestModel); - // TransactionPinRequestModel transactionPinRequestModel = TransactionPinRequestModel( - // porOrgacode: RequestConstants.porOrgacode, - // pctCstycode: RequestConstants.pctCstycode, - // channelCode: RequestConstants.channelCode, - // cmpCustcode: SessionCache.instance.userInfo.cmpCustcode, - // email: SessionCache.instance.userInfo.cmpUserId, - // pinType: "TRAN", - // transPincode: userTransactionPinField.getCustomText(), - // isOtpRequired: false, - // ); - // - // ServerResponse response = await repository.sendTransactionStep1(transactionPinRequestModel); - // if (response.isError) { - // Toasty.error(response.errorMsg); - // return; - // } - // SendTransactionStep1ResponseModel step1responseModel = SendTransactionStep1ResponseModel.fromMap(response.response); - // transactionSubmitRequestModel.notificationId = step1responseModel.notificationId.toString(); - Get.toNamed(Routes.INTERNAL_TRANSACTION_OPT); - // arguments: { - // AppConstants.SEND_TRANS_STEP1_DATA: transactionSubmitRequestModel, - // AppConstants.INTERNAL_TRANSACTION_PIN_REQUEST: transactionPinRequestModel, - // AppConstants.EXCHANGE_RATE: exchangeRateField.getCustomText(), - // }); + if (!validate()) { + Toasty.error("Please input and then proceed"); + return; + } + + TransactionSubmitRequestModel transactionSubmitRequestModel = TransactionSubmitRequestModel( + porOrgacode: RequestConstants.porOrgacode, + pctCstycode: RequestConstants.pctCstycode, + channelCode: RequestConstants.channelCode, + cmpCustcode: SessionCache.instance.userInfo.cmpCustcode, + drMbmBkmsnumber: selectedFromAccount.value.mbmBkmsnumber, + drMbmBkmstitle: selectedFromAccount.value.mbmBkmstitle, + drPcrCurrcode: selectedFromAccount.value.pcrCurrcode, + drPcrCurrdesc: selectedFromAccount.value.pcrCurrdesc, + drPcrCurrshort: selectedFromAccount.value.pcrCurrshort, + crMbmBkmsnumber: selectedToAccount.value.mbmBkmsnumber, + crMbmBkmstitle: selectedToAccount.value.mbmBkmstitle, + crPcrCurrcode: selectedExchangeRate!.pcrCurrcode, + crPcrCurrdesc: selectedExchangeRate!.pcrCurrdesc, + crPcrCurrshort: selectedExchangeRate!.pcrCurrshort, + sgtGntrnarration: "", + dmpProdCode: selectedFromAccount.value.dmpProdcode, + transType: "DR", + notificationId: "", + transMode: "Online", + sgtGntramtfc: double.parse(sendingAmountField.getCustomText().isEmpty ? "0.0" : sendingAmountField.getCustomText()), + otdTrancomment: messageField.getCustomText(), + isOtpRequired: false, + cmpRefcode: referenceCodeField.getCustomText(), + ); + + dp("********************>>>>>>>>>>>>******************", transactionSubmitRequestModel); + TransactionPinRequestModel transactionPinRequestModel = TransactionPinRequestModel( + porOrgacode: RequestConstants.porOrgacode, + pctCstycode: RequestConstants.pctCstycode, + channelCode: RequestConstants.channelCode, + cmpCustcode: SessionCache.instance.userInfo.cmpCustcode, + email: SessionCache.instance.userInfo.cmpUserId, + pinType: "TRAN", + transPincode: userTransactionPinField.getCustomText(), + isOtpRequired: false, + ); + + ServerResponse response = await repository.sendTransactionStep1(transactionPinRequestModel); + if (response.isError) { + Toasty.error(response.errorMsg); + return; + } + SendTransactionStep1ResponseModel step1responseModel = SendTransactionStep1ResponseModel.fromMap(response.response); + transactionSubmitRequestModel.notificationId = step1responseModel.notificationId.toString(); + Get.toNamed(Routes.INTERNAL_TRANSACTION_OPT, + arguments: { + AppConstants.SEND_TRANS_STEP1_DATA: transactionSubmitRequestModel, + AppConstants.INTERNAL_TRANSACTION_PIN_REQUEST: transactionPinRequestModel, + AppConstants.EXCHANGE_RATE: exchangeRateField.getCustomText(), + }); } void clearTransaction() { diff --git a/lib/app/modules/notifications/controllers/notifications_controller.dart b/lib/app/modules/notifications/controllers/notifications_controller.dart index 5b69a03..8ea7065 100644 --- a/lib/app/modules/notifications/controllers/notifications_controller.dart +++ b/lib/app/modules/notifications/controllers/notifications_controller.dart @@ -63,19 +63,19 @@ class NotificationsController extends GetxController { void onInit() { // - // for (int i = 0; i < SessionCache.instance.depositAccountList.length; i++) { - // DepositAccount depositAccount = - // SessionCache.instance.depositAccountList.elementAt(i); - // - // allDepositAccounts.add( - // DropDown( - // i.toString(), - // "${depositAccount.mbmBkmstitle} - ${depositAccount.mbmBkmsnumber}", - // depositAccount), - // ); - // } - - // selectedDepositAccount.value = allDepositAccounts.first.data; + for (int i = 0; i < SessionCache.instance.depositAccountList.length; i++) { + DepositAccount depositAccount = + SessionCache.instance.depositAccountList.elementAt(i); + + allDepositAccounts.add( + DropDown( + i.toString(), + "${depositAccount.mbmBkmstitle} - ${depositAccount.mbmBkmsnumber}", + depositAccount), + ); + } + + selectedDepositAccount.value = allDepositAccounts.first.data; super.onInit(); } -- 2.32.0