|
|
@ -16,7 +16,6 @@ import android.view.WindowManager |
|
|
|
import android.widget.ArrayAdapter |
|
|
|
import android.widget.RadioButton |
|
|
|
import android.widget.TextView |
|
|
|
import androidx.core.content.ContextCompat |
|
|
|
import androidx.fragment.app.Fragment |
|
|
|
import androidx.fragment.app.activityViewModels |
|
|
|
import androidx.recyclerview.widget.GridLayoutManager |
|
|
@ -31,7 +30,6 @@ import com.nivesh.production.niveshfd.adapter.RecommendedBankListAdapter |
|
|
|
import com.nivesh.production.niveshfd.databinding.FragmentNiveshfdStepTwoBinding |
|
|
|
import com.nivesh.production.niveshfd.model.* |
|
|
|
import com.nivesh.production.niveshfd.ui.activity.NiveshFdMainActivity |
|
|
|
import com.nivesh.production.niveshfd.util.Common |
|
|
|
import com.nivesh.production.niveshfd.util.Common.Companion.commonErrorAutoCompleteMethod |
|
|
|
import com.nivesh.production.niveshfd.util.Common.Companion.commonErrorMethod |
|
|
|
import com.nivesh.production.niveshfd.util.Common.Companion.commonSpinnerErrorMethod |
|
|
@ -521,8 +519,9 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
binding.edtFirstName.text.toString().plus(" ") |
|
|
|
.plus(binding.edtMiddleName.text.toString()).plus(" ") |
|
|
|
.plus(binding.edtLastName.text.toString()), |
|
|
|
binding.edtMobileNumber.text.toString() |
|
|
|
, (activity as NiveshFdMainActivity).loginRole) |
|
|
|
binding.edtMobileNumber.text.toString(), |
|
|
|
(activity as NiveshFdMainActivity).loginRole |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -538,9 +537,12 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
|
|
|
|
binding.addBankDetail.setOnClickListener { |
|
|
|
if (bankListAdapter.itemCount == 5) { |
|
|
|
showDialogValidation(activity as NiveshFdMainActivity, getString(R.string.fiveAccountValidation)) |
|
|
|
showDialogValidation( |
|
|
|
activity as NiveshFdMainActivity, |
|
|
|
getString(R.string.fiveAccountValidation) |
|
|
|
) |
|
|
|
} else { |
|
|
|
showHideBankDetail() |
|
|
|
showHideBankDetail() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -652,7 +654,8 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
(activity as NiveshFdMainActivity).nomineeDetails.NomineePincode = 0 |
|
|
|
|
|
|
|
// Applicant Nominee Guardian Details |
|
|
|
(activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianSalutation = binding.spGuardianRelation.text.toString() |
|
|
|
(activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianSalutation = |
|
|
|
binding.spGuardianRelation.text.toString() |
|
|
|
(activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianName = |
|
|
|
binding.edtGuardianName.text.toString() |
|
|
|
if (binding.edtGuardianAge.text.toString().isEmpty()) { |
|
|
@ -687,7 +690,8 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
bankListAdapter.getSelected()?.AccountNumber |
|
|
|
(activity as NiveshFdMainActivity).fdBankDetails.BankName = |
|
|
|
bankListAdapter.getSelected()?.BankName |
|
|
|
(activity as NiveshFdMainActivity).fdBankDetails.PaymentMode = paymentModeAdapter.getSelected()?.Value |
|
|
|
(activity as NiveshFdMainActivity).fdBankDetails.PaymentMode = |
|
|
|
paymentModeAdapter.getSelected()?.Value |
|
|
|
|
|
|
|
(activity as NiveshFdMainActivity).createFDApplicantRequest.ApplicantDetails = |
|
|
|
(activity as NiveshFdMainActivity).applicantDetails |
|
|
@ -718,58 +722,71 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
} |
|
|
|
|
|
|
|
private fun checkFDCKYCApi() { |
|
|
|
if ((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CM_MOBILE?.isNotEmpty()!! && (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_DOB?.isNotEmpty()!! && binding.edtPANNumber.text.toString().isNotEmpty() && (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE?.isNotEmpty()!!) { |
|
|
|
val checkFDKYCRequest = CheckFDKYCRequest() |
|
|
|
checkFDKYCRequest.Mobile = binding.edtMobileNumber.text.toString() |
|
|
|
checkFDKYCRequest.DOB = binding.edtDOB.text.toString() |
|
|
|
checkFDKYCRequest.PAN = binding.edtPANNumber.text.toString() |
|
|
|
checkFDKYCRequest.NiveshClientCode = (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE.toString() |
|
|
|
(activity as NiveshFdMainActivity).viewModel.checkFDKYC(checkFDKYCRequest, token, activity as NiveshFdMainActivity) |
|
|
|
if ((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CM_MOBILE?.isNotEmpty()!! && (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_DOB?.isNotEmpty()!! && binding.edtPANNumber.text.toString() |
|
|
|
.isNotEmpty() && (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE?.isNotEmpty()!! |
|
|
|
) { |
|
|
|
val checkFDKYCRequest = CheckFDKYCRequest() |
|
|
|
checkFDKYCRequest.Mobile = binding.edtMobileNumber.text.toString() |
|
|
|
checkFDKYCRequest.DOB = binding.edtDOB.text.toString() |
|
|
|
checkFDKYCRequest.PAN = binding.edtPANNumber.text.toString() |
|
|
|
checkFDKYCRequest.NiveshClientCode = |
|
|
|
(activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE.toString() |
|
|
|
(activity as NiveshFdMainActivity).viewModel.checkFDKYC( |
|
|
|
checkFDKYCRequest, |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getFDKYCMutableData.observe(this) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->${response.data.toString()}") |
|
|
|
val getCodeResponse: GetCodeResponse = |
|
|
|
Gson().fromJson( |
|
|
|
response.data?.toString(), |
|
|
|
GetCodeResponse::class.java |
|
|
|
) |
|
|
|
getCodeResponse.Response.StatusCode.let { code -> |
|
|
|
when (code) { |
|
|
|
200 -> { |
|
|
|
// fdInvestmentDetails.CustomerType = "" |
|
|
|
} |
|
|
|
650 -> "" |
|
|
|
else -> { |
|
|
|
showDialogValidation( |
|
|
|
activity as NiveshFdMainActivity, |
|
|
|
getCodeResponse.Response.Errors[0].ErrorMessage |
|
|
|
) |
|
|
|
} |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->${response.data.toString()}") |
|
|
|
val getCodeResponse: GetCodeResponse = |
|
|
|
Gson().fromJson( |
|
|
|
response.data?.toString(), |
|
|
|
GetCodeResponse::class.java |
|
|
|
) |
|
|
|
getCodeResponse.Response.StatusCode.let { code -> |
|
|
|
when (code) { |
|
|
|
200 -> { |
|
|
|
// fdInvestmentDetails.CustomerType = "" |
|
|
|
} |
|
|
|
650 -> "" |
|
|
|
else -> { |
|
|
|
showDialogValidation( |
|
|
|
activity as NiveshFdMainActivity, |
|
|
|
getCodeResponse.Response.Errors[0].ErrorMessage |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
is Resource.Error -> { |
|
|
|
response.message?.let { message -> |
|
|
|
showDialogValidation(activity as NiveshFdMainActivity, message) |
|
|
|
} |
|
|
|
is Resource.Error -> { |
|
|
|
response.message?.let { message -> |
|
|
|
showDialogValidation(activity as NiveshFdMainActivity, message) |
|
|
|
} |
|
|
|
is Resource.Loading -> { |
|
|
|
} |
|
|
|
is Resource.Loading -> { |
|
|
|
|
|
|
|
} |
|
|
|
is Resource.DataError -> { |
|
|
|
} |
|
|
|
is Resource.DataError -> { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private fun createFDApi(data: CreateFDRequest) { |
|
|
|
ProgressUtil.showLoading(activity as NiveshFdMainActivity) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.createFDApi(data, token, activity as NiveshFdMainActivity) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getFDResponseMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.createFDApi( |
|
|
|
data, |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getFDResponseMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("createFDApi ", " response -->$response") |
|
|
@ -781,7 +798,8 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
createFDApplicationResponse.Response.StatusCode.let { code -> |
|
|
|
when (code) { |
|
|
|
200 -> { |
|
|
|
(activity as NiveshFdMainActivity).uniqueId = createFDApplicationResponse.Response.FDCreationDetailsResponse.UniqueId |
|
|
|
(activity as NiveshFdMainActivity).uniqueId = |
|
|
|
createFDApplicationResponse.Response.FDCreationDetailsResponse.UniqueId |
|
|
|
(activity as NiveshFdMainActivity).stepTwoApi() |
|
|
|
|
|
|
|
} |
|
|
@ -813,8 +831,13 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
|
|
|
|
private fun ifscCodeCheckApi(ifsc: String) { |
|
|
|
if (ifsc.length >= 10) { |
|
|
|
(activity as NiveshFdMainActivity).viewModel.ifscCodeApi(ifsc, activity as NiveshFdMainActivity) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getIfscCodeCheckMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.ifscCodeApi( |
|
|
|
ifsc, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getIfscCodeCheckMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("ifscCodeCheckApi ", " response -->$response") |
|
|
@ -884,7 +907,9 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
ifscCode, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getIfscCodeDetailsCheckMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getIfscCodeDetailsCheckMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
if (response.data.toString().isNotEmpty()) { |
|
|
@ -896,7 +921,7 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
binding.edtBankName.setText(getIFSCCodeResponse.IFSCCODEServiceResult[0].BnkDescr) |
|
|
|
binding.edtBankName.setSelection(binding.edtBankName.text.toString().length) |
|
|
|
binding.edtBankBranch.setText(getIFSCCodeResponse.IFSCCODEServiceResult[0].BankBranch) |
|
|
|
binding.edtBankBranch.setSelection( binding.edtBankBranch.text.toString().length) |
|
|
|
binding.edtBankBranch.setSelection(binding.edtBankBranch.text.toString().length) |
|
|
|
} |
|
|
|
} |
|
|
|
is Resource.Error -> { |
|
|
@ -917,8 +942,8 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
} |
|
|
|
|
|
|
|
private fun verifyAccountNo( |
|
|
|
bankAccount: String, Ifsc: String, name: String, phoneNumber: String |
|
|
|
,loginRole : Int) { |
|
|
|
bankAccount: String, Ifsc: String, name: String, phoneNumber: String, loginRole: Int |
|
|
|
) { |
|
|
|
|
|
|
|
val bankValidationApiRequest = BankValidationApiRequest() |
|
|
|
bankValidationApiRequest.BankAccountNo = bankAccount |
|
|
@ -933,7 +958,9 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.bankValidationApiMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.bankValidationApiMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("verifyAccountNo ", " response -->$response") |
|
|
@ -1056,7 +1083,7 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
binding.rvClientBankList.adapter = bankListAdapter |
|
|
|
} |
|
|
|
|
|
|
|
private fun datePicker(edtDOB: TextInputEditText, number : Int) { |
|
|
|
private fun datePicker(edtDOB: TextInputEditText, number: Int) { |
|
|
|
val year = cal.get(Calendar.YEAR) |
|
|
|
val month = cal.get(Calendar.MONTH) |
|
|
|
val day = cal.get(Calendar.DAY_OF_MONTH) |
|
|
@ -1070,14 +1097,16 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
.plus(dayOfMonth.toString()) |
|
|
|
) |
|
|
|
edtDOB.setSelection(edtDOB.text.toString().length) |
|
|
|
if (number == 2){ |
|
|
|
if (isMinor(years.toString().plus("-").plus(monthOfYear + 1).plus("-") |
|
|
|
.plus(dayOfMonth.toString())) |
|
|
|
){ |
|
|
|
guardianCodeVisibility(View.VISIBLE) |
|
|
|
}else{ |
|
|
|
guardianCodeVisibility(View.GONE) |
|
|
|
} |
|
|
|
if (number == 2) { |
|
|
|
if (isMinor( |
|
|
|
years.toString().plus("-").plus(monthOfYear + 1).plus("-") |
|
|
|
.plus(dayOfMonth.toString()) |
|
|
|
) |
|
|
|
) { |
|
|
|
guardianCodeVisibility(View.VISIBLE) |
|
|
|
} else { |
|
|
|
guardianCodeVisibility(View.GONE) |
|
|
|
} |
|
|
|
} |
|
|
|
}, year, month, day |
|
|
|
) |
|
|
@ -1103,7 +1132,11 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
getCodeRequest.Category = getString(R.string.salutationCategory) |
|
|
|
getCodeRequest.Language = getString(R.string.language) |
|
|
|
getCodeRequest.InputValue = "" |
|
|
|
(activity as NiveshFdMainActivity).viewModel.titleApi(getCodeRequest, token, activity as NiveshFdMainActivity) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.titleApi( |
|
|
|
getCodeRequest, |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getTitleMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
@ -1191,7 +1224,9 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getPaymentModeMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getPaymentModeMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("paymentModeApi ", " response -->$response") |
|
|
@ -1234,10 +1269,10 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
private fun setUpRecyclerViewPaymentMode(listOfPayMode: MutableList<GetCodes>) { |
|
|
|
|
|
|
|
observerViewModel.data.observe(viewLifecycleOwner) { |
|
|
|
val tempList= mutableListOf<GetCodes>() |
|
|
|
val tempList = mutableListOf<GetCodes>() |
|
|
|
tempList.addAll(listOfPayMode) |
|
|
|
val amountEntered:String = observerViewModel.data.value.toString() |
|
|
|
if( amountEntered.toDouble()>100000.0) { |
|
|
|
val amountEntered: String = observerViewModel.data.value.toString() |
|
|
|
if (amountEntered.toDouble() > 100000.0) { |
|
|
|
for (list in listOfPayMode) { |
|
|
|
if (list.Value == "UPI") { |
|
|
|
tempList.remove(list) |
|
|
@ -1334,7 +1369,9 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getRelationShipMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getRelationShipMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("relationShipApi ", " response -->$response") |
|
|
@ -1352,15 +1389,22 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
) |
|
|
|
binding.spNomineeRelation.setAdapter(adapter) |
|
|
|
|
|
|
|
val nomineeRelation = (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Nominees?.get(0)?.NomineeRelationship |
|
|
|
val nomineeRelation = |
|
|
|
(activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Nominees?.get( |
|
|
|
0 |
|
|
|
)?.NomineeRelationship |
|
|
|
if (nomineeRelation.isNullOrEmpty()) { |
|
|
|
binding.spNomineeRelation.setText(adapter.getItem(0)?.Label, |
|
|
|
false) |
|
|
|
}else{ |
|
|
|
binding.spNomineeRelation.setText( |
|
|
|
adapter.getItem(0)?.Label, |
|
|
|
false |
|
|
|
) |
|
|
|
} else { |
|
|
|
for (title in listOfRelationShip) { |
|
|
|
if (title.Label == nomineeRelation) { |
|
|
|
binding.spNomineeRelation.setText(title.Label , |
|
|
|
false) |
|
|
|
binding.spNomineeRelation.setText( |
|
|
|
title.Label, |
|
|
|
false |
|
|
|
) |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
@ -1411,7 +1455,9 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getMaritalStatusMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getMaritalStatusMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("maritalStatusApi ", " response -->$response") |
|
|
@ -1471,7 +1517,9 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getOccupationMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getOccupationMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("occupationApi ", " response -->$response") |
|
|
@ -1489,14 +1537,15 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
) |
|
|
|
binding.spOccupation.setAdapter(adapter) |
|
|
|
|
|
|
|
val occupationCode = (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_OCCUPATION_CODE |
|
|
|
val occupationCode = |
|
|
|
(activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_OCCUPATION_CODE |
|
|
|
if (occupationCode.isNullOrEmpty()) { |
|
|
|
|
|
|
|
binding.spOccupation.setText( |
|
|
|
adapter.getItem(0)?.Label, |
|
|
|
false |
|
|
|
) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
for (title in listOfOccupation) { |
|
|
|
if (title.Value == occupationCode) { |
|
|
|
binding.spOccupation.setText(title.Label, false) |
|
|
@ -1543,7 +1592,9 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getAnnualIncomeMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getAnnualIncomeMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("annualIncomeApi ", " response -->$response") |
|
|
@ -1593,8 +1644,13 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
} |
|
|
|
|
|
|
|
private fun stateListApi() { |
|
|
|
(activity as NiveshFdMainActivity).viewModel.stateApi(token, activity as NiveshFdMainActivity) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getStateMasterMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.stateApi( |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getStateMasterMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("stateListApi ", " response -->$response") |
|
|
@ -1680,8 +1736,14 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
cityRequest.HOCode = "" |
|
|
|
cityRequest.Source = getString(R.string.source) |
|
|
|
cityRequest.APP_Web = getString(R.string.app) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.cityListApi(cityRequest, token, activity as NiveshFdMainActivity) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getCityListMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.cityListApi( |
|
|
|
cityRequest, |
|
|
|
token, |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getCityListMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("cityListApi ", " response -->$response") |
|
|
@ -1744,8 +1806,14 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
|
|
|
|
private fun apiForEligibleBankList() { |
|
|
|
ProgressUtil.showLoading(activity as NiveshFdMainActivity) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.bankListApi(token,getString(R.string.language), activity as NiveshFdMainActivity) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getFDBankListMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as NiveshFdMainActivity).viewModel.bankListApi( |
|
|
|
token, |
|
|
|
getString(R.string.language), |
|
|
|
activity as NiveshFdMainActivity |
|
|
|
) |
|
|
|
(activity as NiveshFdMainActivity).viewModel.getFDBankListMutableData.observe( |
|
|
|
viewLifecycleOwner |
|
|
|
) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("apiForEligibleBankList ", " response -->$response") |
|
|
@ -1836,10 +1904,9 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
) |
|
|
|
} else if (binding.edtDOB.text.toString().isEmpty()) { // EditText |
|
|
|
commonErrorMethod(binding.edtDOB, binding.tlDOB, getString(R.string.emptyDOB)) |
|
|
|
}else if (isMinor(binding.edtDOB.text.toString())) { // EditText |
|
|
|
} else if (isMinor(binding.edtDOB.text.toString())) { // EditText |
|
|
|
commonErrorMethod(binding.edtDOB, binding.tlDOB, getString(R.string.minorApplicant)) |
|
|
|
} |
|
|
|
else if (binding.edtPANNumber.text.toString().isEmpty()) { // EditText |
|
|
|
} else if (binding.edtPANNumber.text.toString().isEmpty()) { // EditText |
|
|
|
commonErrorMethod( |
|
|
|
binding.edtPANNumber, |
|
|
|
binding.tlPanNumber, |
|
|
|