diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f1ff92fe6..492bebe9e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -76,10 +76,13 @@ dependencies { implementation(projects.core.data) implementation(projects.core.datastore) implementation(projects.ui) + implementation(projects.feature.loan) implementation(projects.feature.registration) implementation(projects.feature.beneficiary) implementation(projects.feature.guarantor) + implementation(projects.feature.savings) + implementation("androidx.legacy:legacy-support-v4:1.0.0") diff --git a/app/src/main/java/org/mifos/mobile/ui/activities/SavingsAccountApplicationActivity.kt b/app/src/main/java/org/mifos/mobile/ui/activities/SavingsAccountApplicationActivity.kt index 391b29027..5b7051de8 100644 --- a/app/src/main/java/org/mifos/mobile/ui/activities/SavingsAccountApplicationActivity.kt +++ b/app/src/main/java/org/mifos/mobile/ui/activities/SavingsAccountApplicationActivity.kt @@ -5,7 +5,7 @@ import org.mifos.mobile.R import org.mifos.mobile.databinding.ActivitySavingsAccountApplicationBinding import org.mifos.mobile.ui.activities.base.BaseActivity import org.mifos.mobile.core.model.enums.SavingsAccountState -import org.mifos.mobile.ui.savings_account_application.SavingsAccountApplicationFragment.Companion.newInstance +import org.mifos.mobile.ui.savings_account.SavingsAccountApplicationFragment.Companion.newInstance /* * Created by saksham on 30/June/2018 diff --git a/app/src/main/java/org/mifos/mobile/ui/home/HomeOldFragment.kt b/app/src/main/java/org/mifos/mobile/ui/home/HomeOldFragment.kt index f3572a22a..4aef6b338 100644 --- a/app/src/main/java/org/mifos/mobile/ui/home/HomeOldFragment.kt +++ b/app/src/main/java/org/mifos/mobile/ui/home/HomeOldFragment.kt @@ -33,7 +33,7 @@ import org.mifos.mobile.ui.client_charge.ClientChargeComposeFragment import org.mifos.mobile.core.model.enums.AccountType import org.mifos.mobile.core.model.enums.ChargeType import org.mifos.mobile.ui.fragments.base.BaseFragment -import org.mifos.mobile.ui.savings_make_transfer.SavingsMakeTransferComposeFragment +import org.mifos.mobile.ui.savings_account.SavingsMakeTransferComposeFragment import org.mifos.mobile.ui.third_party_transfer.ThirdPartyTransferComposeFragment import org.mifos.mobile.ui.user_profile.UserProfileActivity import org.mifos.mobile.core.datastore.PreferencesHelper diff --git a/app/src/main/java/org/mifos/mobile/ui/loan_account/LoanAccountsDetailFragment.kt b/app/src/main/java/org/mifos/mobile/ui/loan_account/LoanAccountsDetailFragment.kt index 916eac651..095d090bb 100644 --- a/app/src/main/java/org/mifos/mobile/ui/loan_account/LoanAccountsDetailFragment.kt +++ b/app/src/main/java/org/mifos/mobile/ui/loan_account/LoanAccountsDetailFragment.kt @@ -25,11 +25,10 @@ import org.mifos.mobile.ui.loan_account_transaction.LoanAccountTransactionFragme import org.mifos.mobile.ui.loan_account_withdraw.LoanAccountWithdrawFragment import org.mifos.mobile.ui.loan_account_application.LoanApplicationFragment import org.mifos.mobile.ui.loan_repayment_schedule.LoanRepaymentScheduleFragment -import org.mifos.mobile.ui.savings_make_transfer.SavingsMakeTransferFragment import org.mifos.mobile.ui.fragments.base.BaseFragment import org.mifos.mobile.ui.loan_account_summary.LoanAccountSummaryFragment import org.mifos.mobile.ui.qr_code_display.QrCodeDisplayComposeFragment -import org.mifos.mobile.ui.savings_make_transfer.SavingsMakeTransferComposeFragment +import org.mifos.mobile.ui.savings_account.SavingsMakeTransferComposeFragment import org.mifos.mobile.utils.* import javax.inject.Inject diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsDetailFragment.kt b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsDetailFragment.kt index d7c84a6e7..f2ceb7564 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsDetailFragment.kt +++ b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsDetailFragment.kt @@ -16,19 +16,16 @@ import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.ui.activities.SavingsAccountContainerActivity import org.mifos.mobile.ui.activities.base.BaseActivity import org.mifos.mobile.ui.client_charge.ClientChargeComposeFragment -import org.mifos.mobile.ui.savings_account_transaction.SavingAccountsTransactionComposeFragment -import org.mifos.mobile.ui.savings_account_application.SavingsAccountApplicationFragment -import org.mifos.mobile.ui.savings_account_withdraw.SavingsAccountWithdrawFragment -import org.mifos.mobile.ui.savings_make_transfer.SavingsMakeTransferFragment import org.mifos.mobile.ui.fragments.base.BaseFragment import org.mifos.mobile.ui.qr_code_display.QrCodeDisplayComposeFragment -import org.mifos.mobile.ui.savings_make_transfer.SavingsMakeTransferComposeFragment import org.mifos.mobile.core.common.Network import org.mifos.mobile.core.datastore.PreferencesHelper import org.mifos.mobile.core.model.entity.accounts.savings.SavingsWithAssociations import org.mifos.mobile.core.model.enums.AccountType import org.mifos.mobile.core.model.enums.ChargeType import org.mifos.mobile.core.model.enums.SavingsAccountState +import org.mifos.mobile.feature.savings.savings_account.SavingAccountsDetailViewModel +import org.mifos.mobile.feature.savings.savings_account.SavingsAccountDetailScreen import org.mifos.mobile.utils.QrCodeGenerator import javax.inject.Inject diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionFragment.kt b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsTransactionFragment.kt similarity index 99% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionFragment.kt rename to app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsTransactionFragment.kt index d1191ddd3..71f05b2f6 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionFragment.kt +++ b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsTransactionFragment.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_transaction +package org.mifos.mobile.ui.savings_account import android.content.Intent import android.net.Uri @@ -42,6 +42,7 @@ import org.mifos.mobile.core.common.utils.ParcelableAndSerializableUtils.getChec import org.mifos.mobile.utils.StatusUtils import org.mifos.mobile.utils.Toaster import org.mifos.mobile.core.common.utils.getDatePickerDialog +import org.mifos.mobile.feature.savings.savings_account_transaction.SavingAccountsTransactionViewModel import java.time.Instant import javax.inject.Inject diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationFragment.kt b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountApplicationFragment.kt similarity index 92% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationFragment.kt rename to app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountApplicationFragment.kt index f70414837..e2e17c2ec 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationFragment.kt +++ b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountApplicationFragment.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_application +package org.mifos.mobile.ui.savings_account import android.os.Bundle import android.view.LayoutInflater @@ -16,6 +16,8 @@ import org.mifos.mobile.core.common.Constants import org.mifos.mobile.core.model.entity.accounts.savings.SavingsWithAssociations import org.mifos.mobile.core.common.utils.ParcelableAndSerializableUtils.getCheckedParcelable import org.mifos.mobile.core.common.utils.ParcelableAndSerializableUtils.getCheckedSerializable +import org.mifos.mobile.feature.savings.savings_account_application.SavingsAccountApplicationScreen +import org.mifos.mobile.feature.savings.savings_account_application.SavingsAccountApplicationViewModel /* * Created by saksham on 30/June/2018 diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingsAccountTransactionComposeFragment.kt b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountTransactionComposeFragment.kt similarity index 87% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingsAccountTransactionComposeFragment.kt rename to app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountTransactionComposeFragment.kt index 9c57916be..79e9217f0 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingsAccountTransactionComposeFragment.kt +++ b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountTransactionComposeFragment.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_transaction +package org.mifos.mobile.ui.savings_account import android.os.Bundle import android.view.LayoutInflater @@ -10,6 +10,8 @@ import org.mifos.mobile.core.ui.component.mifosComposeView import org.mifos.mobile.ui.activities.SavingsAccountContainerActivity import org.mifos.mobile.ui.fragments.base.BaseFragment import org.mifos.mobile.core.common.Constants +import org.mifos.mobile.feature.savings.savings_account_transaction.SavingAccountsTransactionViewModel +import org.mifos.mobile.feature.savings.savings_account_transaction.SavingsAccountTransactionScreen @AndroidEntryPoint diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_withdraw/SavingsAccountWithdrawFragment.kt b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountWithdrawFragment.kt similarity index 91% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_withdraw/SavingsAccountWithdrawFragment.kt rename to app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountWithdrawFragment.kt index d52d91b5d..7f6543f31 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_withdraw/SavingsAccountWithdrawFragment.kt +++ b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountWithdrawFragment.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_withdraw +package org.mifos.mobile.ui.savings_account import android.os.Bundle import android.view.LayoutInflater @@ -13,6 +13,8 @@ import org.mifos.mobile.ui.activities.SavingsAccountContainerActivity import org.mifos.mobile.ui.fragments.base.BaseFragment import org.mifos.mobile.core.model.entity.accounts.savings.SavingsWithAssociations import org.mifos.mobile.core.common.utils.ParcelableAndSerializableUtils.getCheckedParcelable +import org.mifos.mobile.feature.savings.savings_account_withdraw.SavingsAccountWithdrawScreen +import org.mifos.mobile.feature.savings.savings_account_withdraw.SavingsAccountWithdrawViewModel /* * Created by saksham on 02/July/2018 diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferComposeFragment.kt b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsMakeTransferComposeFragment.kt similarity index 94% rename from app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferComposeFragment.kt rename to app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsMakeTransferComposeFragment.kt index 9e74def24..0aee7de53 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferComposeFragment.kt +++ b/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsMakeTransferComposeFragment.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_make_transfer +package org.mifos.mobile.ui.savings_account import android.os.Bundle import android.view.LayoutInflater @@ -15,7 +15,9 @@ import org.mifos.mobile.ui.transfer_process.TransferProcessComposeFragment import org.mifos.mobile.core.model.entity.payload.TransferPayload import org.mifos.mobile.core.common.utils.DateHelper import org.mifos.mobile.core.common.utils.getTodayFormatted - +import org.mifos.mobile.feature.savings.savings_make_transfer.ReviewTransferPayload +import org.mifos.mobile.feature.savings.savings_make_transfer.SavingsMakeTransferScreen +import org.mifos.mobile.feature.savings.savings_make_transfer.SavingsMakeTransferViewModel @AndroidEntryPoint class SavingsMakeTransferComposeFragment : BaseFragment() { diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferFragment.kt b/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferFragment.kt deleted file mode 100644 index 51be6d7ac..000000000 --- a/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferFragment.kt +++ /dev/null @@ -1,432 +0,0 @@ -package org.mifos.mobile.ui.savings_make_transfer - -import dagger.hilt.android.AndroidEntryPoint -import org.mifos.mobile.ui.fragments.base.BaseFragment - -/** - * Created by Rajan Maurya on 10/03/17. - */ -@AndroidEntryPoint -class SavingsMakeTransferFragment : BaseFragment() { -// -// private var _binding: FragmentSavingsMakeTransferBinding? = null -// private val binding get() = _binding!! -// private val viewModel: SavingsMakeTransferViewModel by viewModels() -// private var transferPayload: TransferPayload? = null -// private var transferDate: String? = null -// private var toAccountOption: AccountOption? = null -// private var fromAccountOption: AccountOption? = null -// private var accountOptionsTemplate: AccountOptionsTemplate? = null -// private var transferType: String? = null -// private var payTo: String? = null -// private var payFrom: String? = null -// private var accountId: Long? = 0 -// private var outStandingBalance: Double? = 0.0 -// private var isLoanRepayment = false -// private var sweetUIErrorHandler: SweetUIErrorHandler? = null -// -// override fun onCreate(savedInstanceState: Bundle?) { -// super.onCreate(savedInstanceState) -// (activity as? BaseActivity)?.showToolbar() -// if (arguments != null) { -// accountId = arguments?.getLong(Constants.ACCOUNT_ID) -// transferType = arguments?.getString(Constants.TRANSFER_TYPE) -// if (arguments?.getBoolean(Constants.LOAN_REPAYMENT, false) == true) { -// isLoanRepayment = true -// outStandingBalance = arguments?.getDouble(Constants.OUTSTANDING_BALANCE) -// } -// } -// setHasOptionsMenu(true) -// } -// -// override fun onCreateView( -// inflater: LayoutInflater, -// container: ViewGroup?, -// savedInstanceState: Bundle?, -// ): View { -// _binding = FragmentSavingsMakeTransferBinding.inflate(inflater, container, false) -// setToolbarTitle(getString(R.string.transfer)) -// sweetUIErrorHandler = SweetUIErrorHandler(activity, binding.root) -// showUserInterface() -// if (savedInstanceState == null) { -// //viewModel.loanAccountTransferTemplate() -// } -// return binding.root -// } -// -// override fun onViewCreated(view: View, savedInstanceState: Bundle?) { -// super.onViewCreated(view, savedInstanceState) -// -// with(binding) { -// btnCancelTransfer.setOnClickListener { -// cancelTransfer() -// } -// -// btnReviewTransfer.setOnClickListener { -// reviewTransfer() -// } -// -// btnPayFrom.setOnClickListener { -// payFromSelected() -// } -// -// btnPayTo.setOnClickListener { -// payToSelected() -// } -// -// btnAmount.setOnClickListener { -// amountSet() -// } -// -// layoutError.btnTryAgain.setOnClickListener { -// onRetry() -// } -// } -// -//// viewLifecycleOwner.lifecycleScope.launch { -//// repeatOnLifecycle(Lifecycle.State.STARTED) { -//// viewModel.savingsMakeTransferUiState.collect { state -> -//// when (state) { -//// SavingsAccountUiState.Loading -> showProgress() -//// -//// is SavingsAccountUiState.ErrorMessage -> { -//// hideProgress() -//// showError(context?.getString(R.string.error_fetching_account_transfer_template)) -//// } -//// -//// is SavingsAccountUiState.ShowSavingsAccountTemplate -> { -//// hideProgress() -//// showSavingsAccountTemplate(state.accountOptionsTemplate) -//// } -//// -//// is SavingsAccountUiState.Initial -> {} -//// -//// else -> throw IllegalStateException("Unexpected state : $state") -//// } -//// } -//// } -//// } -// } -// -// override fun onSaveInstanceState(outState: Bundle) { -// super.onSaveInstanceState(outState) -// outState.putParcelable(Constants.TEMPLATE, accountOptionsTemplate) -// } -// -// override fun onActivityCreated(savedInstanceState: Bundle?) { -// super.onActivityCreated(savedInstanceState) -// if (savedInstanceState != null) { -// showSavingsAccountTemplate( -// savedInstanceState.getCheckedParcelable( -// AccountOptionsTemplate::class.java, -// Constants.TEMPLATE -// ) -// ) } -// } -// -// /** -// * Checks validation of `etRemark` and then opens [TransferProcessComposeFragment] for -// * initiating the transfer -// */ -// private fun reviewTransfer() { -// if (binding.etRemark.text.toString().trim { it <= ' ' } == "") { -// showToaster(getString(R.string.remark_is_mandatory)) -// return -// } -// transferPayload = TransferPayload() -// transferPayload?.fromAccountId = fromAccountOption?.accountId -// transferPayload?.fromClientId = fromAccountOption?.clientId -// transferPayload?.fromAccountType = fromAccountOption?.accountType?.id -// transferPayload?.fromOfficeId = fromAccountOption?.officeId -// transferPayload?.toOfficeId = toAccountOption?.officeId -// transferPayload?.toAccountId = toAccountOption?.accountId -// transferPayload?.toClientId = toAccountOption?.clientId -// transferPayload?.toAccountType = toAccountOption?.accountType?.id -// transferPayload?.transferDate = transferDate -// transferPayload?.transferAmount = binding.amountField.text.toString().toDouble() -// transferPayload?.transferDescription = binding.etRemark.text.toString() -// transferPayload?.fromAccountNumber = fromAccountOption?.accountNo -// transferPayload?.toAccountNumber = toAccountOption?.accountNo -// (activity as BaseActivity?)?.replaceFragment( -// TransferProcessComposeFragment.newInstance( -// transferPayload, -// TransferType.SELF, -// ), -// true, -// R.id.container, -// ) -// } -// -// /** -// * Cancels the transfer by popping current Fragment -// */ -// private fun cancelTransfer() { -// activity?.supportFragmentManager?.popBackStack() -// } -// -// private fun onRetry() { -// if (Network.isConnected(context)) { -// sweetUIErrorHandler?.hideSweetErrorLayoutUI( -// binding.llMakeTransfer, -// binding.layoutError.root, -// ) -// //viewModel.loanAccountTransferTemplate() -// } else { -// Toaster.show(binding.root, getString(R.string.internet_not_connected)) -// } -// } -// -// /** -// * Setting up basic components -// */ -// fun showUserInterface() { -// binding.processOne.setCurrentActive() -// binding.payFromField.setOnItemClickListener { _, _, position, _ -> -// toAccountOption = accountOptionsTemplate?.toAccountOptions?.get(position) -// payTo = toAccountOption?.accountNo -// println("paytofield item selected payTo:$payTo") -// updateDetails() -// } -// binding.payToField.setOnItemClickListener { _, _, position, _ -> -// fromAccountOption = accountOptionsTemplate?.fromAccountOptions?.get(position) -// payFrom = fromAccountOption?.accountNo -// println("payfrom item selected payFrom:$payFrom") -// updateDetails() -// } -// transferDate = DateHelper.getSpecificFormat( -// DateHelper.FORMAT_dd_MMMM_yyyy, -// getTodayFormatted(), -// ) -// if (isLoanRepayment) { -// binding.amountField.setText(outStandingBalance.toString()) -// binding.amountFieldWrapper.isFocusable = false -// } -// } -// -// private fun updateDetails() { -//// when (transferType) { -//// Constants.TRANSFER_PAY_TO -> { -//// setToolbarTitle(getString(R.string.deposit)) -//// toAccountOption = -//// viewModel.searchAccount(accountOptionsTemplate?.toAccountOptions, accountId) -//// binding.payToFieldWrapper.isEnabled = false -//// binding.processOne.setCurrentCompleted() -//// } -//// -//// Constants.TRANSFER_PAY_FROM -> { -//// setToolbarTitle(getString(R.string.transfer)) -//// fromAccountOption = -//// viewModel.searchAccount(accountOptionsTemplate?.fromAccountOptions, accountId) -//// binding.payFromFieldWrapper.isEnabled = false -//// binding.payFromFieldWrapper.visibility = View.VISIBLE -//// binding.processTwo.setCurrentCompleted() -//// } -//// } -// } -// -// /** -// * Provides with `accountOptionsTemplate` fetched from server which is used to update -// * `listPayFrom` and `listPayTo` -// * -// * @param accountOptionsTemplate Template for account transfer -// */ -// private fun showSavingsAccountTemplate(accountOptionsTemplate: AccountOptionsTemplate?) { -// this.accountOptionsTemplate = accountOptionsTemplate -//// binding.payToField.setAdapter( -//// AccountsSpinnerAdapter( -//// requireContext(), -//// viewModel.getAccountNumbers( -//// accountOptionsTemplate?.toAccountOptions, -//// false, -//// context?.getString(R.string.account_type_loan) -//// ), -//// ), -//// ) -//// binding.payFromField.setAdapter( -//// AccountsSpinnerAdapter( -//// requireContext(), -//// viewModel.getAccountNumbers( -//// accountOptionsTemplate?.toAccountOptions, -//// true, -//// context?.getString(R.string.account_type_loan) -//// ), -//// ), -//// ) -// } -// -// /** -// * Shows a {@link Snackbar} with `message` -// *f -// * @param message String to be shown -// */ -// private fun showToaster(message: String?) { -// Toaster.show(binding.root, message) -// } -// -// /** -// * It is called whenever any error occurs while executing a request -// * -// * @param message Error message that tells the user about the problem. -// */ -// fun showError(message: String?) { -// if (!Network.isConnected(context)) { -// sweetUIErrorHandler?.showSweetNoInternetUI( -// binding.llMakeTransfer, -// binding.layoutError.root, -// ) -// } else { -// sweetUIErrorHandler?.showSweetErrorUI( -// message, -// binding.llMakeTransfer, -// binding.layoutError.root, -// ) -// Toaster.show(binding.root, message) -// } -// } -// -// fun showProgress() { -// binding.llMakeTransfer.visibility = View.GONE -// showProgressBar() -// } -// -// fun hideProgress() { -// binding.llMakeTransfer.visibility = View.VISIBLE -// hideProgressBar() -// } -// -// /** -// * Callback for `spPayFrom` and `spPayTo` -// */ -// -// /** -// * Disables `spPayTo` [Spinner] and sets `pvOne` to completed and make -// * `pvTwo` active -// */ -// private fun payToSelected() { -// with(binding) { -// processOne.setCurrentCompleted() -// processTwo.setCurrentActive() -// btnPayTo.visibility = View.GONE -// btnPayFrom.visibility = View.VISIBLE -// payFromFieldWrapper.visibility = View.VISIBLE -// payToFieldWrapper.isEnabled = false -// } -// } -// -// /** -// * Checks validation of `spPayTo` [Spinner].

-// * Disables `spPayFrom` [Spinner] and sets `pvTwo` to completed and make -// * `pvThree` active -// */ -// private fun payFromSelected() { -// if (payTo == payFrom) { -// showToaster(getString(R.string.error_same_account_transfer)) -// return -// } -// with(binding) { -// processTwo.setCurrentCompleted() -// processThree.setCurrentActive() -// btnPayFrom.visibility = View.GONE -// amountFieldWrapper.visibility = View.VISIBLE -// btnAmount.visibility = View.VISIBLE -// payFromFieldWrapper.isEnabled = false -// } -// } -// -// /** -// * Checks validation of `etAmount` [EditText].

-// * Disables `etAmount` and sets `pvThree` to completed and make -// * `pvFour` active -// */ -// private fun amountSet() { -// if (binding.amountField.text.toString() == "") { -// showToaster(getString(R.string.enter_amount)) -// return -// } -// if (binding.amountField.text.toString() == ".") { -// showToaster(getString(R.string.invalid_amount)) -// return -// } -// if (binding.amountField.text.toString().toDouble() == 0.0) { -// showToaster(getString(R.string.amount_greater_than_zero)) -// return -// } -// with(binding) { -// processThree.setCurrentCompleted() -// processFour.setCurrentActive() -// btnAmount.visibility = View.GONE -// tvEnterRemark.visibility = View.GONE -// etRemark.visibility = View.VISIBLE -// llReview.visibility = View.VISIBLE -// amountFieldWrapper.isEnabled = false -// } -// } -// -// override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { -// super.onCreateOptionsMenu(menu, inflater) -// inflater.inflate(R.menu.menu_transfer, menu) -// Utils.setToolbarIconColor(activity, menu, R.color.white) -// } -// -// override fun onOptionsItemSelected(item: MenuItem): Boolean { -// if (item.itemId == R.id.menu_refresh_transfer) { -// val transaction = fragmentManager?.beginTransaction() -// val currFragment = activity?.supportFragmentManager -// ?.findFragmentById(R.id.container) -// if (currFragment != null) { -// transaction?.detach(currFragment) -// transaction?.attach(currFragment) -// } -// transaction?.commit() -// } -// return super.onOptionsItemSelected(item) -// } -// -// override fun onDestroyView() { -// super.onDestroyView() -// hideProgress() -// hideMifosProgressDialog() -// _binding = null -// } -// -// companion object { -// /** -// * Provides an instance of [SavingsMakeTransferFragment], use `transferType` as -// * `Constants.TRANSFER_PAY_TO` when we want to deposit and -// * `Constants.TRANSFER_PAY_FROM` when we want to make a transfer -// * -// * @param accountId Saving account Id -// * @param transferType Type of transfer i.e. `Constants.TRANSFER_PAY_TO` or -// * `Constants.TRANSFER_PAY_FROM` -// * @return Instance of [SavingsMakeTransferFragment] -// */ -// fun newInstance(accountId: Long?, transferType: String?): SavingsMakeTransferFragment { -// val transferFragment = SavingsMakeTransferFragment() -// val args = Bundle() -// if (accountId != null) args.putLong(Constants.ACCOUNT_ID, accountId) -// args.putString(Constants.TRANSFER_TYPE, transferType) -// transferFragment.arguments = args -// return transferFragment -// } -// -// fun newInstance( -// accountId: Long?, -// outstandingBalance: Double?, -// transferType: String?, -// ): SavingsMakeTransferFragment { -// val transferFragment = SavingsMakeTransferFragment() -// val args = Bundle() -// if (accountId != null) args.putLong(Constants.ACCOUNT_ID, accountId) -// args.putString(Constants.TRANSFER_TYPE, transferType) -// if (outstandingBalance != null) { -// args.putDouble( -// Constants.OUTSTANDING_BALANCE, -// outstandingBalance, -// ) -// } -// args.putBoolean(Constants.LOAN_REPAYMENT, true) -// transferFragment.arguments = args -// return transferFragment -// } -// } -} diff --git a/app/src/main/java/org/mifos/mobile/ui/update_password/UpdatePasswordScreen.kt b/app/src/main/java/org/mifos/mobile/ui/update_password/UpdatePasswordScreen.kt index 274ed281f..4ed9ef641 100644 --- a/app/src/main/java/org/mifos/mobile/ui/update_password/UpdatePasswordScreen.kt +++ b/app/src/main/java/org/mifos/mobile/ui/update_password/UpdatePasswordScreen.kt @@ -29,8 +29,8 @@ import org.mifos.mobile.R import org.mifos.mobile.core.ui.component.MifosProgressIndicator import org.mifos.mobile.core.ui.component.MifosTopBar import org.mifos.mobile.core.ui.theme.MifosMobileTheme -import org.mifos.mobile.ui.savings_account_withdraw.UiStatesParameterProvider import org.mifos.mobile.core.common.Network +import org.mifos.mobile.feature.savings.savings_account_withdraw.UiStatesParameterProvider import org.mifos.mobile.feature.registration.utils.RegistrationState diff --git a/app/src/main/java/org/mifos/mobile/utils/SymbolsUtils.kt b/core/common/src/main/java/org/mifos/mobile/core/common/utils/SymbolsUtils.kt similarity index 70% rename from app/src/main/java/org/mifos/mobile/utils/SymbolsUtils.kt rename to core/common/src/main/java/org/mifos/mobile/core/common/utils/SymbolsUtils.kt index 409684876..94d46c5b2 100644 --- a/app/src/main/java/org/mifos/mobile/utils/SymbolsUtils.kt +++ b/core/common/src/main/java/org/mifos/mobile/core/common/utils/SymbolsUtils.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.utils +package org.mifos.mobile.core.common.utils /** * Created by Rajan Maurya on 05/03/17. diff --git a/core/common/src/main/res/drawable/circular_background.xml b/core/common/src/main/res/drawable/circular_background.xml index b4f39d2e2..ed806b933 100644 --- a/core/common/src/main/res/drawable/circular_background.xml +++ b/core/common/src/main/res/drawable/circular_background.xml @@ -2,6 +2,6 @@ + android:width="25dp" + android:height="25dp" /> \ No newline at end of file diff --git a/feature/beneficiary/build.gradle.kts b/feature/beneficiary/build.gradle.kts index 025ffb95d..710d66ca7 100644 --- a/feature/beneficiary/build.gradle.kts +++ b/feature/beneficiary/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } android { - namespace = "org.mifos.mobile.feature.guarantor" + namespace = "org.mifos.mobile.feature.beneficiary" } dependencies { diff --git a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationContent.kt b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationContent.kt index 9ce3c9c1b..edb33238a 100644 --- a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationContent.kt +++ b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationContent.kt @@ -29,7 +29,7 @@ import org.mifos.mobile.core.ui.component.MifosDropDownTextField import org.mifos.mobile.core.ui.component.MifosOutlinedTextField import org.mifos.mobile.core.ui.component.MifosTextButton import org.mifos.mobile.core.ui.theme.MifosMobileTheme -import org.mifos.mobile.feature.guarantor.R +import org.mifos.mobile.feature.beneficiary.R @Composable fun BeneficiaryApplicationContent( diff --git a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationScreen.kt b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationScreen.kt index 37015c163..4d0ee0d95 100644 --- a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationScreen.kt +++ b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationScreen.kt @@ -23,7 +23,7 @@ import org.mifos.mobile.core.model.entity.beneficiary.Beneficiary import org.mifos.mobile.core.model.entity.beneficiary.BeneficiaryPayload import org.mifos.mobile.core.model.entity.templates.beneficiary.BeneficiaryTemplate import org.mifos.mobile.core.model.enums.BeneficiaryState -import org.mifos.mobile.feature.guarantor.R +import org.mifos.mobile.feature.beneficiary.R @Composable diff --git a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationViewModel.kt b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationViewModel.kt index bc06da0f6..6d7f0cb20 100644 --- a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationViewModel.kt +++ b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_application/BeneficiaryApplicationViewModel.kt @@ -13,7 +13,7 @@ import org.mifos.mobile.core.model.entity.beneficiary.BeneficiaryPayload import org.mifos.mobile.core.model.entity.beneficiary.BeneficiaryUpdatePayload import org.mifos.mobile.core.model.entity.templates.beneficiary.BeneficiaryTemplate import org.mifos.mobile.core.model.enums.BeneficiaryState -import org.mifos.mobile.feature.guarantor.R +import org.mifos.mobile.feature.beneficiary.R import javax.inject.Inject @HiltViewModel diff --git a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailContent.kt b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailContent.kt index ed4716470..8b5ccb4bf 100644 --- a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailContent.kt +++ b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailContent.kt @@ -17,7 +17,7 @@ import androidx.compose.ui.unit.dp import org.mifos.mobile.core.model.entity.beneficiary.Beneficiary import org.mifos.mobile.core.ui.component.MifosTitleDescSingleLineEqual import org.mifos.mobile.core.ui.theme.MifosMobileTheme -import org.mifos.mobile.feature.guarantor.R +import org.mifos.mobile.feature.beneficiary.R @Composable fun BeneficiaryDetailContent( diff --git a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailScreen.kt b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailScreen.kt index 67db6459f..765403d37 100644 --- a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailScreen.kt +++ b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailScreen.kt @@ -35,7 +35,7 @@ import org.mifos.mobile.core.model.entity.beneficiary.Beneficiary import org.mifos.mobile.core.ui.component.MifosAlertDialog import org.mifos.mobile.core.ui.component.MifosProgressIndicatorOverlay import org.mifos.mobile.core.ui.theme.MifosMobileTheme -import org.mifos.mobile.feature.guarantor.R +import org.mifos.mobile.feature.beneficiary.R @Composable fun BeneficiaryDetailScreen( diff --git a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailViewModel.kt b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailViewModel.kt index 6c1bcea5d..d2bf93e0e 100644 --- a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailViewModel.kt +++ b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_detail/BeneficiaryDetailViewModel.kt @@ -9,7 +9,7 @@ import kotlinx.coroutines.flow.catch import kotlinx.coroutines.launch import org.mifos.mobile.core.data.repositories.BeneficiaryRepository import org.mifos.mobile.core.model.entity.beneficiary.Beneficiary -import org.mifos.mobile.feature.guarantor.R +import org.mifos.mobile.feature.beneficiary.R import javax.inject.Inject @HiltViewModel diff --git a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_list/BeneficiaryListScreen.kt b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_list/BeneficiaryListScreen.kt index d3d944489..4489d38b0 100644 --- a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_list/BeneficiaryListScreen.kt +++ b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/beneficiary_list/BeneficiaryListScreen.kt @@ -31,7 +31,7 @@ import org.mifos.mobile.core.ui.component.MifosProgressIndicatorOverlay import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.core.common.Network import org.mifos.mobile.core.model.entity.beneficiary.Beneficiary -import org.mifos.mobile.feature.guarantor.R +import org.mifos.mobile.feature.beneficiary.R @Composable fun BeneficiaryListScreen( diff --git a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/BeneficiaryScreen.kt b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/BeneficiaryScreen.kt index f187bf22e..04bd23476 100644 --- a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/BeneficiaryScreen.kt +++ b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/BeneficiaryScreen.kt @@ -17,7 +17,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import org.mifos.mobile.core.ui.component.MifosTopBar import org.mifos.mobile.core.ui.theme.MifosMobileTheme -import org.mifos.mobile.feature.guarantor.R +import org.mifos.mobile.feature.beneficiary.R @RequiresApi(Build.VERSION_CODES.TIRAMISU) diff --git a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/BeneficiaryScreenIcons.kt b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/BeneficiaryScreenIcons.kt index be4736bac..1873011dc 100644 --- a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/BeneficiaryScreenIcons.kt +++ b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/BeneficiaryScreenIcons.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.mifos.mobile.core.ui.theme.MifosMobileTheme -import org.mifos.mobile.feature.guarantor.R +import org.mifos.mobile.feature.beneficiary.R import org.mifos.mobile.ui.beneficiary.presentation.RenderIconAndText @Composable diff --git a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/RenderIconAndText.kt b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/RenderIconAndText.kt index 66a61d4dd..430173002 100644 --- a/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/RenderIconAndText.kt +++ b/feature/beneficiary/src/main/java/org/mifos/mobile/feature/beneficiary/presentation/RenderIconAndText.kt @@ -19,7 +19,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.mifos.mobile.core.ui.theme.MifosMobileTheme -import org.mifos.mobile.feature.guarantor.R +import org.mifos.mobile.feature.beneficiary.R /** diff --git a/feature/loan/src/main/java/org/mifos/mobile/feature/loan/loan_repayment_schedule/LoanRepaymentScheduleViewModel.kt b/feature/loan/src/main/java/org/mifos/mobile/feature/loan/loan_repayment_schedule/LoanRepaymentScheduleViewModel.kt index 824f76f34..95086b8be 100644 --- a/feature/loan/src/main/java/org/mifos/mobile/feature/loan/loan_repayment_schedule/LoanRepaymentScheduleViewModel.kt +++ b/feature/loan/src/main/java/org/mifos/mobile/feature/loan/loan_repayment_schedule/LoanRepaymentScheduleViewModel.kt @@ -7,6 +7,7 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.catch import kotlinx.coroutines.launch +import kotlinx.coroutines.supervisorScope import org.mifos.mobile.core.data.repositories.LoanRepository import org.mifos.mobile.core.model.entity.accounts.loan.LoanWithAssociations import org.mifos.mobile.core.model.entity.templates.loans.LoanTemplate diff --git a/feature/loan/src/main/res/drawable/ic_check_circle_green_24px.xml b/feature/loan/src/main/res/drawable/ic_check_circle_green_24px.xml index e9c6a620c..f6880695d 100644 --- a/feature/loan/src/main/res/drawable/ic_check_circle_green_24px.xml +++ b/feature/loan/src/main/res/drawable/ic_check_circle_green_24px.xml @@ -14,7 +14,7 @@ android:name="tick" android:pathData="M6,11 l0,0 l0,0" android:strokeWidth="1" - android:strokeColor="@color/white" /> + android:strokeColor="#ffffff" /> \ No newline at end of file diff --git a/feature/savings/.gitignore b/feature/savings/.gitignore new file mode 100644 index 000000000..42afabfd2 --- /dev/null +++ b/feature/savings/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/feature/savings/build.gradle.kts b/feature/savings/build.gradle.kts new file mode 100644 index 000000000..685d49fff --- /dev/null +++ b/feature/savings/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + alias(libs.plugins.mifos.android.feature) + alias(libs.plugins.mifos.android.library.compose) + alias(libs.plugins.kotlin.parcelize) +} + +android { + namespace = "org.mifos.mobile.feature.savings" +} + +dependencies { + implementation(projects.ui) + implementation(projects.core.common) + implementation(projects.core.model) + implementation(projects.core.data) + + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.espresso.core) +} \ No newline at end of file diff --git a/feature/savings/consumer-rules.pro b/feature/savings/consumer-rules.pro new file mode 100644 index 000000000..e69de29bb diff --git a/feature/savings/proguard-rules.pro b/feature/savings/proguard-rules.pro new file mode 100644 index 000000000..481bb4348 --- /dev/null +++ b/feature/savings/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/feature/savings/src/androidTest/java/org/mifos/mobile/feature/savings/ExampleInstrumentedTest.kt b/feature/savings/src/androidTest/java/org/mifos/mobile/feature/savings/ExampleInstrumentedTest.kt new file mode 100644 index 000000000..1340d6e8b --- /dev/null +++ b/feature/savings/src/androidTest/java/org/mifos/mobile/feature/savings/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package org.mifos.mobile.feature.savings + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("org.mifos.mobile.feature.savings.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/feature/savings/src/main/AndroidManifest.xml b/feature/savings/src/main/AndroidManifest.xml new file mode 100644 index 000000000..a5918e68a --- /dev/null +++ b/feature/savings/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsDetailViewModel.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingAccountsDetailViewModel.kt similarity index 96% rename from app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsDetailViewModel.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingAccountsDetailViewModel.kt index 5a127ac1d..56b0490fa 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsDetailViewModel.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingAccountsDetailViewModel.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account +package org.mifos.mobile.feature.savings.savings_account import androidx.compose.runtime.State import androidx.compose.runtime.mutableStateOf @@ -8,7 +8,6 @@ import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.catch import kotlinx.coroutines.launch -import org.mifos.mobile.R import org.mifos.mobile.core.ui.theme.Blue import org.mifos.mobile.core.ui.theme.DepositGreen import org.mifos.mobile.core.ui.theme.LightYellow @@ -16,6 +15,7 @@ import org.mifos.mobile.core.ui.theme.RedLight import org.mifos.mobile.core.data.repositories.SavingsAccountRepository import org.mifos.mobile.core.model.entity.accounts.savings.SavingsWithAssociations import org.mifos.mobile.core.model.entity.accounts.savings.Status +import org.mifos.mobile.feature.savings.R import javax.inject.Inject @HiltViewModel diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountDetailContent.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingsAccountDetailContent.kt similarity index 98% rename from app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountDetailContent.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingsAccountDetailContent.kt index 707dba221..b0caeef30 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountDetailContent.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingsAccountDetailContent.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account +package org.mifos.mobile.feature.savings.savings_account import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -27,7 +27,6 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp -import org.mifos.mobile.R import org.mifos.mobile.core.model.entity.accounts.savings.SavingsWithAssociations import org.mifos.mobile.core.model.entity.accounts.savings.Status import org.mifos.mobile.core.ui.component.MifosLinkText @@ -35,7 +34,8 @@ import org.mifos.mobile.core.ui.component.MifosTextTitleDescDoubleLine import org.mifos.mobile.core.ui.component.MonitorListItemWithIcon import org.mifos.mobile.core.common.utils.CurrencyUtil import org.mifos.mobile.core.common.utils.DateHelper -import org.mifos.mobile.utils.SymbolsUtils +import org.mifos.mobile.core.common.utils.SymbolsUtils +import org.mifos.mobile.feature.savings.R @Composable fun SavingsAccountDetailContent( @@ -227,7 +227,7 @@ fun LastTransactionCard( OutlinedCard(modifier = Modifier.fillMaxWidth()) { Column(modifier = Modifier.padding(14.dp)) { MifosTextTitleDescDoubleLine( - title = stringResource(id = R.string.last_transaction), + title = stringResource(id = R.string.last_trans), descriptionStyle = MaterialTheme.typography.bodyLarge, description = if (isTransactionEmpty) { stringResource(id = R.string.no_transaction) diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountDetailScreen.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingsAccountDetailScreen.kt similarity index 95% rename from app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountDetailScreen.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingsAccountDetailScreen.kt index 0ab5c945f..0c780de75 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountDetailScreen.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingsAccountDetailScreen.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account +package org.mifos.mobile.feature.savings.savings_account import android.widget.Toast import androidx.compose.foundation.layout.Column @@ -8,13 +8,13 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview -import org.mifos.mobile.R import org.mifos.mobile.core.ui.component.EmptyDataView import org.mifos.mobile.core.ui.component.MifosProgressIndicator import org.mifos.mobile.core.ui.component.NoInternet import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.core.common.Network import org.mifos.mobile.core.model.entity.accounts.savings.SavingsWithAssociations +import org.mifos.mobile.feature.savings.R @Composable fun SavingsAccountDetailScreen( @@ -83,7 +83,6 @@ fun ErrorComponent( val context = LocalContext.current if (!Network.isConnected(context)) { NoInternet( - icon = R.drawable.ic_portable_wifi_off_black_24dp, error = R.string.no_internet_connection, isRetryEnabled = true, retry = retryConnection @@ -93,7 +92,6 @@ fun ErrorComponent( ).show() } else { EmptyDataView( - icon = R.drawable.ic_error_black_24dp, error = R.string.error_saving_account_details_loading ) Toast.makeText( diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountDetailTopBar.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingsAccountDetailTopBar.kt similarity index 96% rename from app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountDetailTopBar.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingsAccountDetailTopBar.kt index 47d3ba87d..18b6f1c6e 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account/SavingsAccountDetailTopBar.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account/SavingsAccountDetailTopBar.kt @@ -1,6 +1,5 @@ -package org.mifos.mobile.ui.savings_account +package org.mifos.mobile.feature.savings.savings_account -import androidx.compose.foundation.background import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.material.icons.filled.MoreVert @@ -21,8 +20,8 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview -import org.mifos.mobile.R import org.mifos.mobile.core.ui.theme.MifosMobileTheme +import org.mifos.mobile.feature.savings.R @OptIn(ExperimentalMaterial3Api::class) @Composable diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationContent.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_application/SavingsAccountApplicationContent.kt similarity index 98% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationContent.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_application/SavingsAccountApplicationContent.kt index cddd90f43..b77a8b79b 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationContent.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_application/SavingsAccountApplicationContent.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_application +package org.mifos.mobile.feature.savings.savings_account_application import android.content.Context import android.widget.Toast @@ -37,10 +37,10 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import org.mifos.mobile.R import org.mifos.mobile.core.model.entity.templates.savings.SavingsAccountTemplate import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.core.common.utils.getTodayFormatted +import org.mifos.mobile.feature.savings.R @Composable fun SavingsAccountApplicationContent( diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationScreen.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_application/SavingsAccountApplicationScreen.kt similarity index 95% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationScreen.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_application/SavingsAccountApplicationScreen.kt index 88d4f885b..846915aaf 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationScreen.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_application/SavingsAccountApplicationScreen.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_application +package org.mifos.mobile.feature.savings.savings_account_application import android.widget.Toast import androidx.compose.foundation.layout.Column @@ -13,7 +13,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview -import org.mifos.mobile.R import org.mifos.mobile.core.ui.component.EmptyDataView import org.mifos.mobile.core.ui.component.MifosProgressIndicator import org.mifos.mobile.core.ui.component.MifosTopBar @@ -22,6 +21,7 @@ import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.core.common.Network import org.mifos.mobile.core.model.entity.accounts.savings.SavingsWithAssociations import org.mifos.mobile.core.model.enums.SavingsAccountState +import org.mifos.mobile.feature.savings.R @Composable @@ -83,7 +83,6 @@ fun ErrorComponent(retryConnection: () -> Unit, errorMessage: String?) { val context = LocalContext.current if (!Network.isConnected(context)) { NoInternet( - icon = R.drawable.ic_portable_wifi_off_black_24dp, error = R.string.no_internet_connection, isRetryEnabled = true, retry = retryConnection @@ -92,7 +91,6 @@ fun ErrorComponent(retryConnection: () -> Unit, errorMessage: String?) { } else { EmptyDataView( modifier= Modifier.fillMaxSize(), - icon = R.drawable.ic_error_black_24dp, error = R.string.error_saving_account_details_loading, errorString = errorMessage ) diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationViewModel.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_application/SavingsAccountApplicationViewModel.kt similarity index 98% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationViewModel.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_application/SavingsAccountApplicationViewModel.kt index 16bd2c2e2..1a98e03b9 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_application/SavingsAccountApplicationViewModel.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_application/SavingsAccountApplicationViewModel.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_application +package org.mifos.mobile.feature.savings.savings_account_application import androidx.compose.runtime.State import androidx.compose.runtime.mutableStateOf @@ -7,7 +7,6 @@ import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.catch import kotlinx.coroutines.launch -import org.mifos.mobile.R import org.mifos.mobile.core.data.repositories.SavingsAccountRepository import org.mifos.mobile.core.datastore.PreferencesHelper import org.mifos.mobile.core.model.entity.accounts.savings.SavingsAccountApplicationPayload @@ -17,6 +16,7 @@ import org.mifos.mobile.core.model.entity.templates.savings.SavingsAccountTempla import org.mifos.mobile.core.model.enums.SavingsAccountState import org.mifos.mobile.core.common.utils.DateHelper import org.mifos.mobile.core.common.utils.getTodayFormatted +import org.mifos.mobile.feature.savings.R import javax.inject.Inject @HiltViewModel diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountTransactionContent.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountTransactionContent.kt similarity index 98% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountTransactionContent.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountTransactionContent.kt index a5316f33e..fd2e29946 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountTransactionContent.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountTransactionContent.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_transaction +package org.mifos.mobile.feature.savings.savings_account_transaction import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement @@ -25,11 +25,11 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import org.mifos.mobile.R import org.mifos.mobile.core.model.entity.accounts.savings.Transactions import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.core.common.utils.CurrencyUtil import org.mifos.mobile.core.common.utils.DateHelper +import org.mifos.mobile.feature.savings.R @Composable fun SavingsAccountTransactionContent( diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionFilterDialog.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountsTransactionFilterDialog.kt similarity index 99% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionFilterDialog.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountsTransactionFilterDialog.kt index 685f49cff..680053d2b 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionFilterDialog.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountsTransactionFilterDialog.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_transaction +package org.mifos.mobile.feature.savings.savings_account_transaction import androidx.compose.foundation.gestures.Orientation @@ -29,7 +29,6 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog -import org.mifos.mobile.R import org.mifos.mobile.core.ui.component.MifosCheckBox import org.mifos.mobile.core.ui.component.MifosIconTextButton import org.mifos.mobile.core.ui.component.MifosIcons @@ -37,6 +36,7 @@ import org.mifos.mobile.core.ui.component.MifosRadioButton import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.core.common.utils.DateHelper import org.mifos.mobile.core.common.utils.DateHelper.getDateAsStringFromLong +import org.mifos.mobile.feature.savings.R import java.time.Instant @Composable diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionScreen.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountsTransactionScreen.kt similarity index 98% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionScreen.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountsTransactionScreen.kt index a0b137f13..2aa0524a6 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionScreen.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountsTransactionScreen.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_transaction +package org.mifos.mobile.feature.savings.savings_account_transaction import androidx.compose.foundation.layout.Box @@ -21,7 +21,6 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle -import org.mifos.mobile.R import org.mifos.mobile.core.ui.component.EmptyDataView import org.mifos.mobile.core.ui.component.MFScaffold import org.mifos.mobile.core.ui.component.MifosErrorComponent @@ -31,6 +30,7 @@ import org.mifos.mobile.core.ui.component.MifosTopBar import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.core.common.Network import org.mifos.mobile.core.model.entity.accounts.savings.Transactions +import org.mifos.mobile.feature.savings.R import java.time.Instant @Composable diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionViewModel.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountsTransactionViewModel.kt similarity index 94% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionViewModel.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountsTransactionViewModel.kt index fdfb02fec..693871318 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionViewModel.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_transaction/SavingAccountsTransactionViewModel.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_transaction +package org.mifos.mobile.feature.savings.savings_account_transaction import android.os.Parcelable @@ -11,7 +11,6 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.catch import kotlinx.coroutines.launch import kotlinx.parcelize.Parcelize -import org.mifos.mobile.R import org.mifos.mobile.core.ui.theme.DepositGreen import org.mifos.mobile.core.ui.theme.GreenSuccess import org.mifos.mobile.core.ui.theme.RedLight @@ -19,13 +18,16 @@ import org.mifos.mobile.core.data.repositories.SavingsAccountRepository import org.mifos.mobile.core.model.entity.accounts.savings.TransactionType import org.mifos.mobile.core.model.entity.accounts.savings.Transactions import org.mifos.mobile.core.common.utils.DateHelper +import org.mifos.mobile.feature.savings.R import javax.inject.Inject @HiltViewModel class SavingAccountsTransactionViewModel @Inject constructor(private val savingsAccountRepositoryImp: SavingsAccountRepository) : ViewModel() { - private val _savingAccountsTransactionUiState = MutableStateFlow(SavingsAccountTransactionUiState.Loading) + private val _savingAccountsTransactionUiState = MutableStateFlow( + SavingsAccountTransactionUiState.Loading + ) val savingAccountsTransactionUiState: StateFlow get() = _savingAccountsTransactionUiState private var _transactionsList: List = mutableListOf() @@ -77,7 +79,8 @@ class SavingAccountsTransactionViewModel @Inject constructor(private val savings ) } else -> { - _savingAccountsTransactionUiState.value = SavingsAccountTransactionUiState.Success(transactionsList) + _savingAccountsTransactionUiState.value = + SavingsAccountTransactionUiState.Success(transactionsList) } } } @@ -90,7 +93,8 @@ class SavingAccountsTransactionViewModel @Inject constructor(private val savings ) { val typeFilteredList = filterSavingsAccountTransactionsByType(checkBoxFilters = checkBoxFilters) val dateAndTypeFilteredList = filterTransactionListByDate(transactions = typeFilteredList, startDate = startDate, endDate = endDate) - _savingAccountsTransactionUiState.value = SavingsAccountTransactionUiState.Success(dateAndTypeFilteredList) + _savingAccountsTransactionUiState.value = + SavingsAccountTransactionUiState.Success(dateAndTypeFilteredList) } private fun filterByDate(startDate: Long, endDate: Long) { diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_withdraw/SavingsAccountWithdrawScreen.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_withdraw/SavingsAccountWithdrawScreen.kt similarity index 98% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_withdraw/SavingsAccountWithdrawScreen.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_withdraw/SavingsAccountWithdrawScreen.kt index 95230fcce..16625947c 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_withdraw/SavingsAccountWithdrawScreen.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_withdraw/SavingsAccountWithdrawScreen.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_withdraw +package org.mifos.mobile.feature.savings.savings_account_withdraw import android.widget.Toast import androidx.compose.foundation.background @@ -28,7 +28,6 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle -import org.mifos.mobile.R import org.mifos.mobile.core.ui.component.MifosOutlinedTextField import org.mifos.mobile.core.ui.component.MifosProgressIndicator import org.mifos.mobile.core.ui.component.MifosTitleDescSingleLineEqual @@ -38,6 +37,7 @@ import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.core.common.Network import org.mifos.mobile.core.model.entity.accounts.savings.SavingsWithAssociations import org.mifos.mobile.core.common.utils.getTodayFormatted +import org.mifos.mobile.feature.savings.R @Composable @@ -106,7 +106,6 @@ fun ErrorComponent( val context = LocalContext.current if (!Network.isConnected(context)) { NoInternet( - icon = R.drawable.ic_portable_wifi_off_black_24dp, error = R.string.no_internet_connection, isRetryEnabled = false, ) diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_account_withdraw/SavingsAccountWithdrawViewModel.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_withdraw/SavingsAccountWithdrawViewModel.kt similarity index 93% rename from app/src/main/java/org/mifos/mobile/ui/savings_account_withdraw/SavingsAccountWithdrawViewModel.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_withdraw/SavingsAccountWithdrawViewModel.kt index a7e16928d..ca168116a 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_account_withdraw/SavingsAccountWithdrawViewModel.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_account_withdraw/SavingsAccountWithdrawViewModel.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_account_withdraw +package org.mifos.mobile.feature.savings.savings_account_withdraw import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope @@ -18,7 +18,9 @@ class SavingsAccountWithdrawViewModel @Inject constructor( private val savingsAccountRepositoryImp: SavingsAccountRepository ) : ViewModel() { val savingsAccountWithdrawUiState: StateFlow get() = _savingsAccountWithdrawUiState - private val _savingsAccountWithdrawUiState = MutableStateFlow(SavingsAccountWithdrawUiState.WithdrawUiReady) + private val _savingsAccountWithdrawUiState = MutableStateFlow( + SavingsAccountWithdrawUiState.WithdrawUiReady + ) val savingsWithAssociations: StateFlow get() = _savingsWithAssociations private var _savingsWithAssociations: MutableStateFlow = MutableStateFlow(null) diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferContent.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_make_transfer/SavingsMakeTransferContent.kt similarity index 96% rename from app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferContent.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_make_transfer/SavingsMakeTransferContent.kt index 4df86fe2c..aef4fe3f2 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferContent.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_make_transfer/SavingsMakeTransferContent.kt @@ -1,9 +1,5 @@ -package org.mifos.mobile.ui.savings_make_transfer +package org.mifos.mobile.feature.savings.savings_make_transfer -import android.util.Log -import android.widget.Toast -import androidx.compose.foundation.gestures.Orientation -import androidx.compose.foundation.gestures.scrollable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -35,12 +31,8 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.TextFieldValue -import androidx.compose.ui.text.input.VisualTransformation import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.tooling.preview.PreviewParameter -import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.unit.dp -import org.mifos.mobile.R import org.mifos.mobile.core.model.entity.templates.account.AccountOption import org.mifos.mobile.core.ui.component.MFStepProcess import org.mifos.mobile.core.ui.component.MifosDropDownDoubleTextField @@ -50,6 +42,7 @@ import org.mifos.mobile.core.ui.component.getStepState import org.mifos.mobile.core.ui.theme.DarkGray import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.core.ui.theme.Primary +import org.mifos.mobile.feature.savings.R @Composable fun SavingsMakeTransferContent( diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferScreen.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_make_transfer/SavingsMakeTransferScreen.kt similarity index 97% rename from app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferScreen.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_make_transfer/SavingsMakeTransferScreen.kt index 280eb6271..d236402eb 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferScreen.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_make_transfer/SavingsMakeTransferScreen.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_make_transfer +package org.mifos.mobile.feature.savings.savings_make_transfer import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize @@ -11,12 +11,12 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle -import org.mifos.mobile.R import org.mifos.mobile.core.ui.component.MFScaffold import org.mifos.mobile.core.ui.component.MifosErrorComponent import org.mifos.mobile.core.ui.component.MifosProgressIndicatorOverlay import org.mifos.mobile.core.ui.theme.MifosMobileTheme import org.mifos.mobile.core.common.Network +import org.mifos.mobile.feature.savings.R @Composable fun SavingsMakeTransferScreen( diff --git a/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferViewModel.kt b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_make_transfer/SavingsMakeTransferViewModel.kt similarity index 98% rename from app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferViewModel.kt rename to feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_make_transfer/SavingsMakeTransferViewModel.kt index 919aee655..d95542c37 100644 --- a/app/src/main/java/org/mifos/mobile/ui/savings_make_transfer/SavingsMakeTransferViewModel.kt +++ b/feature/savings/src/main/java/org/mifos/mobile/feature/savings/savings_make_transfer/SavingsMakeTransferViewModel.kt @@ -1,4 +1,4 @@ -package org.mifos.mobile.ui.savings_make_transfer +package org.mifos.mobile.feature.savings.savings_make_transfer import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope diff --git a/feature/savings/src/main/res/drawable/ic_assignment_turned_in_black_24dp.xml b/feature/savings/src/main/res/drawable/ic_assignment_turned_in_black_24dp.xml new file mode 100644 index 000000000..7aeaab097 --- /dev/null +++ b/feature/savings/src/main/res/drawable/ic_assignment_turned_in_black_24dp.xml @@ -0,0 +1,10 @@ + + + diff --git a/feature/savings/src/main/res/drawable/ic_charges.xml b/feature/savings/src/main/res/drawable/ic_charges.xml new file mode 100644 index 000000000..dc27ed8af --- /dev/null +++ b/feature/savings/src/main/res/drawable/ic_charges.xml @@ -0,0 +1,46 @@ + + + + + + + + + + diff --git a/feature/savings/src/main/res/drawable/ic_compare_arrows_black_24dp.xml b/feature/savings/src/main/res/drawable/ic_compare_arrows_black_24dp.xml new file mode 100644 index 000000000..a16bbb784 --- /dev/null +++ b/feature/savings/src/main/res/drawable/ic_compare_arrows_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/feature/savings/src/main/res/drawable/ic_qrcode_scan.xml b/feature/savings/src/main/res/drawable/ic_qrcode_scan.xml new file mode 100644 index 000000000..5b0e12ba0 --- /dev/null +++ b/feature/savings/src/main/res/drawable/ic_qrcode_scan.xml @@ -0,0 +1,9 @@ + + + diff --git a/feature/savings/src/main/res/drawable/triangular_green_view.xml b/feature/savings/src/main/res/drawable/triangular_green_view.xml new file mode 100644 index 000000000..3644ed67c --- /dev/null +++ b/feature/savings/src/main/res/drawable/triangular_green_view.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/feature/savings/src/main/res/drawable/triangular_red_view.xml b/feature/savings/src/main/res/drawable/triangular_red_view.xml new file mode 100644 index 000000000..66994c39a --- /dev/null +++ b/feature/savings/src/main/res/drawable/triangular_red_view.xml @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/feature/savings/src/main/res/values/strings.xml b/feature/savings/src/main/res/values/strings.xml new file mode 100644 index 000000000..1c73ba269 --- /dev/null +++ b/feature/savings/src/main/res/values/strings.xml @@ -0,0 +1,88 @@ + + + Active + Need Approval + Pending + Matured + Closed + Contact Us + 8000000000 + Nominal Interest Rate + Account Number + Account Balance + Total Deposits + %1$.2f %2$s + %1$s %2$s + Account Status + NA + Total Withdrawals + No withdrawals + Make Transfer + Deposit + Made on + No Transaction + %1$s %2$.2f + Last Transaction + Min. Required Bal. + Monitor + Transactions + View Transactions + Savings Charges + View Charges + QR Code + Share QR Code + View QR Code for this account + Approval Pending + No Internet Connection + Please make sure you are connected to internet + Error loading in saving accounts list + Error loading in saving accounts detail + + Update Savings Account + Withdraw Savings Account + Saving Account Details + Client Name + Submission Date + Submit + Select Product Id + Apply Savings Account + New Saving Account created successfully. + Saving Account Updated Successfully + Select all filters you want to apply + Filter Savings Accounts + Clear Filters + Cancel + Filter + Savings Account Transaction + No Transaction Found + Date + 4 Weeks + 3 Months + 6 Months + Dividend Payout + Withdrawal + Interest Posting + Savings Account Withdraw Successful + Withdrawal Date + Remark + %1$s cannot be blank + 1 + 2 + 3 + 4 + Enter Amount + Amount should be greater than zero + Pay To + Pay From + Select Account to Pay To + Select Account to Pay From + Required + Continue + Invalid Amount + Amount + Review + Enter Remarks for transfer + Transfer + + + \ No newline at end of file diff --git a/feature/savings/src/test/java/org/mifos/mobile/feature/savings/ExampleUnitTest.kt b/feature/savings/src/test/java/org/mifos/mobile/feature/savings/ExampleUnitTest.kt new file mode 100644 index 000000000..47d3bf4c4 --- /dev/null +++ b/feature/savings/src/test/java/org/mifos/mobile/feature/savings/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package org.mifos.mobile.feature.savings + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index d23864653..572875d79 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -32,3 +32,4 @@ include(":core:datastore") include(":feature:loan") include(":feature:beneficiary") include(":feature:registration") +include(":feature:savings") diff --git a/ui/src/main/java/org/mifos/mobile/core/ui/component/EmptyDataView.kt b/ui/src/main/java/org/mifos/mobile/core/ui/component/EmptyDataView.kt index 67e5df7bb..e04cf4b9d 100644 --- a/ui/src/main/java/org/mifos/mobile/core/ui/component/EmptyDataView.kt +++ b/ui/src/main/java/org/mifos/mobile/core/ui/component/EmptyDataView.kt @@ -12,8 +12,10 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.res.vectorResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp @@ -22,7 +24,7 @@ import androidx.compose.ui.unit.sp @Composable fun EmptyDataView( modifier: Modifier = Modifier.fillMaxSize(), - icon: Int, + icon: Int? = null, error: Int, errorString: String? = null, ) { @@ -35,7 +37,8 @@ fun EmptyDataView( modifier = Modifier .size(100.dp) .padding(bottom = 12.dp), - painter = painterResource(id = icon), + imageVector = if(icon != null) ImageVector.vectorResource(id = icon) + else MifosIcons.Error, contentDescription = null, tint = MaterialTheme.colorScheme.onSecondary ) diff --git a/ui/src/main/java/org/mifos/mobile/core/ui/component/MifosIcons.kt b/ui/src/main/java/org/mifos/mobile/core/ui/component/MifosIcons.kt index 7f37442dc..7785a6865 100644 --- a/ui/src/main/java/org/mifos/mobile/core/ui/component/MifosIcons.kt +++ b/ui/src/main/java/org/mifos/mobile/core/ui/component/MifosIcons.kt @@ -3,6 +3,7 @@ package org.mifos.mobile.core.ui.component import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Add import androidx.compose.material.icons.filled.Edit +import androidx.compose.material.icons.filled.Error import androidx.compose.material.icons.filled.FilterList import androidx.compose.material.icons.filled.FlashOff import androidx.compose.material.icons.filled.FlashOn @@ -17,4 +18,5 @@ object MifosIcons { val Add = Icons.Filled.Add val Search = Icons.Filled.Search val WifiOff = Icons.Filled.WifiOff + val Error = Icons.Filled.Error } \ No newline at end of file