├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── test.json
│ │ │ ├── scanCard.json
│ │ │ ├── entries.json
│ │ │ ├── depositAccount.json
│ │ │ ├── plannedPaymentPage.json
│ │ │ ├── command.json
│ │ │ ├── identification.json
│ │ │ ├── customer.json
│ │ │ ├── loanAccount.json
│ │ │ ├── loanAccounts.json
│ │ │ └── products.json
│ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── bg_about.png
│ │ │ │ ├── mifos_logo_new.png
│ │ │ │ ├── round_corner.xml
│ │ │ │ ├── notification_circle.xml
│ │ │ │ ├── ic_filter_list_black_24dp.xml
│ │ │ │ ├── ic_add_white_24dp.xml
│ │ │ │ ├── launcher_background.xml
│ │ │ │ ├── ic_keyboard_arrow_right_black_24dp.xml
│ │ │ │ ├── ic_show_chart_black_24dp.xml
│ │ │ │ ├── review_circle_bg.xml
│ │ │ │ ├── ic_delete_black_24dp.xml
│ │ │ │ ├── ic_close_black_24dp.xml
│ │ │ │ ├── ic_info_black_24dp.xml
│ │ │ │ ├── ic_compare_arrows_black_24dp.xml
│ │ │ │ ├── ic_account_balance_black_24dp.xml
│ │ │ │ ├── ic_check_circle_black_24dp.xml
│ │ │ │ ├── ic_person_black_24dp.xml
│ │ │ │ ├── ic_logout.xml
│ │ │ │ ├── ic_payment_black_24dp.xml
│ │ │ │ ├── ic_label_black_24dp.xml
│ │ │ │ ├── ic_hourglass_empty_black_24dp.xml
│ │ │ │ ├── ic_done_all_black_24dp.xml
│ │ │ │ ├── ic_notifications.xml
│ │ │ │ ├── ic_access_time_black_24dp.xml
│ │ │ │ ├── ic_edit_black_24dp.xml
│ │ │ │ ├── ic_surveys_48px.xml
│ │ │ │ ├── ic_search_black_24dp.xml
│ │ │ │ ├── ic_lock_black_24dp.xml
│ │ │ │ ├── ic_password_black_24dp.xml
│ │ │ │ ├── ic_lock_open_black_24dp.xml
│ │ │ │ ├── ic_account_balance_wallet_black_24dp.xml
│ │ │ │ ├── ic_beneficiaries_48px.xml
│ │ │ │ ├── ic_border_color_black_24dp.xml
│ │ │ │ ├── ic_help_black_24dp.xml
│ │ │ │ ├── ic_supervisor_account_black_24dp.xml
│ │ │ │ ├── ic_products_black_24dp.xml
│ │ │ │ ├── ic_share_black_24dp.xml
│ │ │ │ ├── ic_monetization_on_black_24dp.xml
│ │ │ │ ├── ic_sentiment_dissatisfied_black_24dp.xml
│ │ │ │ └── ic_settings.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── values
│ │ │ │ ├── Validations.xml
│ │ │ │ ├── ids.xml
│ │ │ │ ├── styles_linear.xml
│ │ │ │ ├── attr.xml
│ │ │ │ ├── styles_frame.xml
│ │ │ │ ├── styles_view.xml
│ │ │ │ ├── styles_text.xml
│ │ │ │ └── styles_toolbar.xml
│ │ │ ├── menu
│ │ │ │ ├── menu_identification_card.xml
│ │ │ │ ├── menu_loan_account_details.xml
│ │ │ │ ├── menu_main.xml
│ │ │ │ ├── menu_customer_profile.xml
│ │ │ │ ├── menu_product_search.xml
│ │ │ │ ├── menu_transactions_search.xml
│ │ │ │ ├── menu_identification_search.xml
│ │ │ │ └── menu_account.xml
│ │ │ ├── layout
│ │ │ │ ├── globalcontainer.xml
│ │ │ │ ├── activity_global_container.xml
│ │ │ │ ├── fragment_settings.xml
│ │ │ │ ├── toolbar.xml
│ │ │ │ ├── activity_toolbar_container.xml
│ │ │ │ ├── layout_bottom_content.xml
│ │ │ │ ├── fragment_view_scan_card.xml
│ │ │ │ ├── layout_collapsing_header_view.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── fragment_recent_transactions.xml
│ │ │ │ ├── fragment_customer_activities.xml
│ │ │ │ ├── fragment_product.xml
│ │ │ │ ├── fragment_identification_list.xml
│ │ │ │ ├── activity_customer_profile.xml
│ │ │ │ ├── row_checkbox.xml
│ │ │ │ ├── activity_view_scan_card.xml
│ │ │ │ ├── action_bar_notification_layout.xml
│ │ │ │ ├── activity_loan_application.xml
│ │ │ │ ├── fragment_accounts.xml
│ │ │ │ ├── activity_debt_income_report.xml
│ │ │ │ ├── fragment_client_accounts.xml
│ │ │ │ ├── bottom_sheet_filter_accounts.xml
│ │ │ │ ├── nav_drawer_header.xml
│ │ │ │ └── activity_privacy_policy.xml
│ │ │ ├── drawable-v24
│ │ │ │ ├── circular_bg.xml
│ │ │ │ ├── ic_arrow_drop_down_black_24dp.xml
│ │ │ │ ├── ic_arrow_drop_up_black_24dp.xml
│ │ │ │ ├── circle_bg_tap.xml
│ │ │ │ ├── circle_bg_idle.xml
│ │ │ │ ├── ic_smartphone_black_24dp.xml
│ │ │ │ ├── ic_email_black_24dp.xml
│ │ │ │ ├── ic_task_black_24dp.xml
│ │ │ │ ├── ic_description_black_24dp.xml
│ │ │ │ ├── ic_event_black_24dp.xml
│ │ │ │ ├── ic_place_black_24dp.xml
│ │ │ │ ├── ic_perm_contact_calendar_black_24dp.xml
│ │ │ │ ├── ic_phone_black_24dp.xml
│ │ │ │ ├── ic_autorenew_black_24dp.xml
│ │ │ │ ├── ic_person_outline_black_24dp.xml
│ │ │ │ ├── ic_people_black_24dp.xml
│ │ │ │ ├── ic_attach_money_black_24dp.xml
│ │ │ │ ├── ic_cake_black_24dp.xml
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ └── kotlin
│ │ │ └── org
│ │ │ └── mifos
│ │ │ └── mobile
│ │ │ └── cn
│ │ │ ├── data
│ │ │ ├── models
│ │ │ │ ├── TestModel.kt
│ │ │ │ ├── product
│ │ │ │ │ ├── InterestBasis.kt
│ │ │ │ │ ├── BalanceRange.kt
│ │ │ │ │ ├── InterestRange.kt
│ │ │ │ │ ├── ProductPage.kt
│ │ │ │ │ └── Product.kt
│ │ │ │ ├── CheckboxStatus.kt
│ │ │ │ ├── payment
│ │ │ │ │ ├── ChargeName.kt
│ │ │ │ │ ├── CostComponent.kt
│ │ │ │ │ ├── PlannedPayment.kt
│ │ │ │ │ └── PlannedPaymentPage.kt
│ │ │ │ ├── accounts
│ │ │ │ │ ├── loan
│ │ │ │ │ │ ├── TermRange.kt
│ │ │ │ │ │ ├── LoanAccountPage.kt
│ │ │ │ │ │ ├── AccountAssignment.kt
│ │ │ │ │ │ ├── CreditWorthinessFactor.kt
│ │ │ │ │ │ ├── PaymentCycle.kt
│ │ │ │ │ │ ├── LoanParameters.kt
│ │ │ │ │ │ ├── CreditWorthinessSnapshot.kt
│ │ │ │ │ │ └── LoanAccount.kt
│ │ │ │ │ └── deposit
│ │ │ │ │ │ └── DepositAccount.kt
│ │ │ │ ├── customer
│ │ │ │ │ ├── CustomerPage.kt
│ │ │ │ │ ├── AccountEntriesPage.kt
│ │ │ │ │ ├── Country.kt
│ │ │ │ │ ├── identification
│ │ │ │ │ │ ├── ScanCard.kt
│ │ │ │ │ │ ├── ExpirationDate.kt
│ │ │ │ │ │ └── Identification.kt
│ │ │ │ │ ├── Translations.kt
│ │ │ │ │ ├── AccountEntry.kt
│ │ │ │ │ ├── Command.kt
│ │ │ │ │ ├── DateOfBirth.kt
│ │ │ │ │ ├── Address.kt
│ │ │ │ │ └── ContactDetail.kt
│ │ │ │ └── Authentication.kt
│ │ │ ├── services
│ │ │ │ ├── AnonymousService.kt
│ │ │ │ ├── AuthService.kt
│ │ │ │ ├── IndividualLendingService.kt
│ │ │ │ ├── DepositService.kt
│ │ │ │ └── LoanService.kt
│ │ │ ├── remote
│ │ │ │ ├── EndPoints.kt
│ │ │ │ ├── BaseUrl.kt
│ │ │ │ └── MifosInterceptor.kt
│ │ │ ├── local
│ │ │ │ ├── PreferenceKey.kt
│ │ │ │ └── DatabaseHelperCustomer.kt
│ │ │ ├── datamanager
│ │ │ │ ├── DataManagerLoan.kt
│ │ │ │ ├── DataManagerDepositDetails.kt
│ │ │ │ ├── DataManagerIndividualLending.kt
│ │ │ │ └── DataManagerAuth.kt
│ │ │ ├── dbmodel
│ │ │ │ └── LoanResponse.kt
│ │ │ ├── databasehelper
│ │ │ │ └── DataBaseHelperLoan.kt
│ │ │ └── DataManagerLoanDetails.kt
│ │ │ ├── enums
│ │ │ └── AccountType.kt
│ │ │ ├── injection
│ │ │ ├── ActivityContext.kt
│ │ │ ├── ApplicationContext.kt
│ │ │ ├── ConfigPersistent.kt
│ │ │ ├── PerActivity.kt
│ │ │ ├── module
│ │ │ │ ├── ActivityModule.kt
│ │ │ │ └── ApplicationModule.kt
│ │ │ └── component
│ │ │ │ ├── ConfigPersistentComponent.kt
│ │ │ │ └── ApplicationComponent.kt
│ │ │ ├── ui
│ │ │ ├── mifos
│ │ │ │ ├── loanApplication
│ │ │ │ │ ├── CreditWorthinessSource.kt
│ │ │ │ │ ├── loanActivity
│ │ │ │ │ │ ├── LoanApplicationContract.kt
│ │ │ │ │ │ └── LoanApplicationPresenter.kt
│ │ │ │ │ ├── loanDetails
│ │ │ │ │ │ └── LoanDetailsContract.kt
│ │ │ │ │ ├── OnNavigationBarListener.kt
│ │ │ │ │ ├── loancosigner
│ │ │ │ │ │ └── LoanCosignerFragment.kt
│ │ │ │ │ └── LoanDebtIncome
│ │ │ │ │ │ └── LoanDebtIncomeFragment.kt
│ │ │ │ ├── customerProfile
│ │ │ │ │ └── CustomerProfileContract.kt
│ │ │ │ ├── login
│ │ │ │ │ └── LoginContract.kt
│ │ │ │ ├── aboutus
│ │ │ │ │ └── AboutUsActivity.kt
│ │ │ │ ├── customerDepositDetails
│ │ │ │ │ └── CustomerDepositDetailsContracts.kt
│ │ │ │ ├── customerLoanDetails
│ │ │ │ │ └── CustomerLoanDetailsContracts.kt
│ │ │ │ ├── customerActivities
│ │ │ │ │ ├── CustomerAcitivitesContracts.kt
│ │ │ │ │ └── CustomerActivitiesActivity.kt
│ │ │ │ ├── identificationlist
│ │ │ │ │ ├── IdentificationsActivity.kt
│ │ │ │ │ └── IdentificationsContract.kt
│ │ │ │ ├── customerDetails
│ │ │ │ │ ├── CustomerDetailsActivity.kt
│ │ │ │ │ └── CustomerDetailsContract.kt
│ │ │ │ ├── products
│ │ │ │ │ └── ProductContracts.kt
│ │ │ │ ├── accounts
│ │ │ │ │ └── AccountsContract.kt
│ │ │ │ ├── plannedPlayment
│ │ │ │ │ ├── PlannedPaymentActivity.kt
│ │ │ │ │ └── PlannedPaymentContract.kt
│ │ │ │ ├── identificationdetails
│ │ │ │ │ └── IdentificationDetailsContract.kt
│ │ │ │ ├── recentTransactions
│ │ │ │ │ └── RecentTransactionsContracts.kt
│ │ │ │ ├── launcher
│ │ │ │ │ └── LauncherActivity.kt
│ │ │ │ └── settings
│ │ │ │ │ └── SettingsFragment.kt
│ │ │ ├── utils
│ │ │ │ ├── glideutils
│ │ │ │ │ └── MifosGlideModule.kt
│ │ │ │ ├── RxBus.kt
│ │ │ │ ├── DataBus.kt
│ │ │ │ ├── Utils.kt
│ │ │ │ ├── ProgressBarHandler.kt
│ │ │ │ ├── RxEvent.kt
│ │ │ │ ├── ConstantKeys.kt
│ │ │ │ └── ScrollFabBehaviour.kt
│ │ │ ├── base
│ │ │ │ ├── MvpView.kt
│ │ │ │ ├── Presenter.kt
│ │ │ │ ├── BaseActivityCallback.kt
│ │ │ │ ├── OnItemClickListener.kt
│ │ │ │ └── BasePresenter.kt
│ │ │ ├── adapter
│ │ │ │ ├── ViewPagerAdapter.kt
│ │ │ │ ├── DebtIncomeReportAdapter.kt
│ │ │ │ └── LoanApplicationStepAdapter.kt
│ │ │ └── views
│ │ │ │ └── HeaderView.kt
│ │ │ ├── exceptions
│ │ │ ├── NoConnectivityException.kt
│ │ │ └── ExceptionStatusCode.kt
│ │ │ ├── local
│ │ │ └── MifosCnDatabase.kt
│ │ │ ├── fakesource
│ │ │ └── FakeJsonName.kt
│ │ │ └── MifosApplication.kt
│ ├── commonTest
│ │ └── kotlin
│ │ │ └── org
│ │ │ └── mifos
│ │ │ └── mobile
│ │ │ └── cn
│ │ │ ├── FakeJsonName.kt
│ │ │ ├── FakeRemoteDataSource.kt
│ │ │ └── TestDataFactory.kt
│ ├── test
│ │ └── java
│ │ │ └── org
│ │ │ └── mifos
│ │ │ └── mobile
│ │ │ └── cn
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── org
│ │ └── mifos
│ │ └── mobile
│ │ └── cn
│ │ └── ExampleInstrumentedTest.kt
└── proguard-rules.pro
├── settings.gradle
├── renovate.json
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── config
└── quality
│ ├── findbugs
│ └── android-exclude-filter.xml
│ └── pmd
│ └── pmd-ruleset.xml
├── .github
├── PULL_REQUEST_TEMPLATE.md
└── ISSUE_TEMPLATE.md
├── .travis.yml
├── gradle.properties
├── .gitignore
├── COMMIT_STYLE.md
└── README.md
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/app/src/main/resources/test.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | }
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "config:base"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/resources/scanCard.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "description": "description",
4 | "identifier": "identifier"
5 | }
6 | ]
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/drawable/bg_about.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/mifos_logo_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/drawable/mifos_logo_new.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openMF/mifos-mobile-cn/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/TestModel.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models
2 |
3 | /**
4 | * @author Rajan Maurya
5 | * On 29/05/18.
6 | */
7 | data class TestModel (val data: String)
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/product/InterestBasis.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.product
2 |
3 | enum class InterestBasis {
4 |
5 | CURRENT_BALANCE,
6 | BEGINNING_BALANCE
7 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/Validations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 5
5 | 6
6 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/services/AnonymousService.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.services
2 |
3 |
4 | /**
5 | * @author Rajan Maurya
6 | * On 22/01/18.
7 | */
8 | interface AnonymousService {
9 |
10 | }
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_identification_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_loan_account_details.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/commonTest/kotlin/org/mifos/mobile/cn/FakeJsonName.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn
2 |
3 | /**
4 | * @author Rajan Maurya
5 | * On 30/04/18.
6 | */
7 | object FakeJsonName {
8 |
9 | var TEST_JSON = "test.json"
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/enums/AccountType.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.enums
2 |
3 | /**
4 | * @author Manish Kumar
5 | * @since 08/July/2018
6 | */
7 | enum class AccountType {
8 |
9 | LOAN ,
10 | DEPOSIT
11 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/injection/ActivityContext.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.injection
2 |
3 | import javax.inject.Qualifier
4 |
5 | @Qualifier
6 | @Retention(AnnotationRetention.RUNTIME)
7 | annotation class ActivityContext
8 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/injection/ApplicationContext.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.injection
2 |
3 | import javax.inject.Qualifier
4 |
5 | @Qualifier
6 | @Retention(AnnotationRetention.RUNTIME)
7 | annotation class ApplicationContext
8 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/loanApplication/CreditWorthinessSource.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.loanApplication
2 |
3 | enum class CreditWorthinessSource {
4 |
5 | DEBT,
6 |
7 | INCOME,
8 |
9 | EDIT_DEBT,
10 |
11 | EDIT_INCOME
12 | }
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jun 12 21:01:44 IST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/CheckboxStatus.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models
2 |
3 | /**
4 | * @author Manish Kumar
5 | * @since 13/July/2018
6 | */
7 |
8 | data class CheckboxStatus(var status: String?, var color: Int) {
9 |
10 | var isChecked: Boolean = false
11 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/globalcontainer.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/round_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_global_container.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/exceptions/NoConnectivityException.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.exceptions
2 |
3 | import java.io.IOException
4 |
5 | class NoConnectivityException : IOException() {
6 |
7 | override fun getLocalizedMessage(): String {
8 | return "No connectivity exception"
9 | }
10 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/notification_circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/payment/ChargeName.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.payment
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class ChargeName (
6 | @SerializedName("identifier") var identifier: String? = null,
7 | @SerializedName("name") var name: String? = null
8 | )
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/accounts/loan/TermRange.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.accounts.loan
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class TermRange(
6 | @SerializedName("temporalUnit") var temporalUnit: String?,
7 | @SerializedName("maximum") var maximum: Double?
8 | )
9 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/product/BalanceRange.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.product
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class BalanceRange (
6 | @SerializedName("minimum") var minimum: Double? = null,
7 | @SerializedName("maximum") var maximum: Double? = null
8 | )
9 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/product/InterestRange.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.product
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class InterestRange (
6 | @SerializedName("minimum") var minimum: Double? = null,
7 | @SerializedName("maximum") var maximum: Double? = null
8 | )
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/circular_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/payment/CostComponent.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.payment
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class CostComponent (
6 | @SerializedName("chargeIdentifier") var chargeIdentifier: String? = null,
7 | @SerializedName("amount") var amount: Double? = null
8 | )
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/utils/glideutils/MifosGlideModule.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.utils.glideutils
2 |
3 | import com.bumptech.glide.annotation.GlideModule
4 | import com.bumptech.glide.module.AppGlideModule
5 |
6 | /**
7 | * @author Rajan Maurya
8 | * On 18/05/18.
9 | */
10 | @GlideModule
11 | class MifosGlideModule : AppGlideModule()
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_filter_list_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/injection/ConfigPersistent.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.injection
2 |
3 | import javax.inject.Scope
4 |
5 | /**
6 | * A scoping annotation to permit dependencies conform to the life of the
7 | * [@ConfigPersistentComponent]
8 | */
9 | @MustBeDocumented
10 | @Scope
11 | @Retention(AnnotationRetention.RUNTIME)
12 | annotation class ConfigPersistent
13 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/base/MvpView.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.base
2 |
3 | /**
4 | * Base interface that any class that wants to act as a View in the MVP (Model View Presenter)
5 | * pattern must implement. Generally this interface will be extended by a more specific interface
6 | * that then usually will be implemented by an Activity or Fragment.
7 | */
8 | interface MvpView
9 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/base/Presenter.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.base
2 |
3 | /**
4 | * Every presenter in the app must either implement this interface or extend BasePresenter
5 | * indicating the MvpView type that wants to be attached with.
6 | */
7 | interface Presenter {
8 |
9 | fun attachView(mvpView: V)
10 |
11 | fun detachView()
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles_linear.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_arrow_drop_down_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_arrow_drop_up_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attr.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | -
7 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/product/ProductPage.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.product
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class ProductPage (
6 | @SerializedName("elements") val elements: List? = null,
7 | @SerializedName("totalPages") val totalPages: Int? = null,
8 | @SerializedName("totalElements") val totalElements: Long? = null
9 | )
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/injection/PerActivity.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.injection
2 |
3 | import javax.inject.Scope
4 |
5 | /**
6 | * A scoping annotation to permit objects whose lifetime should
7 | * conform to the life of the Activity to be memorised in the
8 | * correct component.
9 | */
10 | @MustBeDocumented
11 | @Scope
12 | @Retention(AnnotationRetention.RUNTIME)
13 | annotation class PerActivity
14 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/CustomerPage.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class CustomerPage(
6 | @SerializedName("customers") var customers: List? = null,
7 | @SerializedName("totalPages") var totalPages: Int? = null,
8 | @SerializedName("totalElements") var totalElements: Long? = null
9 | )
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileContract.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.customerProfile
2 |
3 | import org.mifos.mobile.cn.ui.base.MvpView
4 |
5 | interface CustomerProfileContract {
6 |
7 | interface View: MvpView{
8 | fun checkWriteExternalStoragePermission();
9 |
10 | fun requestPermission();
11 |
12 | fun loadCustomerPortrait();
13 | }
14 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_keyboard_arrow_right_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/circle_bg_tap.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_show_chart_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/review_circle_bg.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/AccountEntriesPage.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class AccountEntriesPage (
6 | @SerializedName("accountEntries") val entries:List?=null,
7 | @SerializedName("totalPages") val totalPages: Int? = null,
8 | @SerializedName("totalElements") val totalElements: Long? = null
9 | )
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/accounts/loan/LoanAccountPage.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.accounts.loan
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class LoanAccountPage(
6 | @SerializedName("elements") var loanAccounts: List? = null,
7 | @SerializedName("totalPages") var totalPages: Int? = null,
8 | @SerializedName("totalElements") var totalElements: Long? = null
9 | )
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/circle_bg_idle.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_delete_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_smartphone_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_email_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_close_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_info_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_customer_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/test/java/org/mifos/mobile/cn/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/accounts/loan/AccountAssignment.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.accounts.loan
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class AccountAssignment (
6 | @SerializedName("designator") var designator: String? = null,
7 | @SerializedName("accountIdentifier") var accountIdentifier: String? = null,
8 | @SerializedName("ledgerIdentifier") var ledgerIdentifier: String? = null
9 | )
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/Country.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | /**
6 | * @author Rajan Maurya
7 | * On 26/07/17.
8 | */
9 |
10 | data class Country(
11 | @SerializedName("translations") var translations: Translations,
12 | @SerializedName("name") var name: String,
13 | @SerializedName("alpha2Code") var alphaCode: String
14 | )
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/identification/ScanCard.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer.identification
2 |
3 | import android.os.Parcelable
4 |
5 | import com.google.gson.annotations.SerializedName
6 | import kotlinx.android.parcel.Parcelize
7 |
8 | @Parcelize
9 | data class ScanCard(
10 | @SerializedName("description") var description: String,
11 | @SerializedName("identifier") var identifier: String
12 | ) : Parcelable
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_compare_arrows_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/base/BaseActivityCallback.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.base
2 |
3 | import androidx.appcompat.widget.Toolbar
4 |
5 | interface BaseActivityCallback {
6 |
7 | fun getToolbar(): Toolbar
8 |
9 | fun showJusticeProgressDialog(message: String)
10 |
11 | fun showTabLayout(show: Boolean)
12 |
13 | fun setToolbarTitle(toolbarTitle: String)
14 |
15 | fun hideJusticeProgressDialog()
16 |
17 | fun logout()
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_task_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_account_balance_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/accounts/loan/CreditWorthinessFactor.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.accounts.loan
2 |
3 | import android.os.Parcelable
4 | import com.google.gson.annotations.SerializedName
5 | import kotlinx.android.parcel.Parcelize
6 |
7 | @Parcelize
8 | data class CreditWorthinessFactor(
9 | @SerializedName("description") var description: String? = null,
10 | @SerializedName("amount") var amount: Double? = null
11 | ) : Parcelable
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check_circle_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_person_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_logout.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles_frame.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_payment_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/Translations.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer
2 |
3 | /**
4 | * @author Rajan Maurya
5 | * On 26/07/17.
6 | */
7 | class Translations {
8 | internal var br: String? = null
9 | internal var En: String? = null
10 | internal var From: String? = null
11 | internal var Is: String? = null
12 | internal var Fr: String? = null
13 | internal var ja: String? = null
14 | internal var It: String? = null
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_label_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_product_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/config/quality/findbugs/android-exclude-filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_hourglass_empty_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_transactions_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/identification/ExpirationDate.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer.identification
2 |
3 | import android.os.Parcelable
4 | import com.google.gson.annotations.SerializedName
5 | import kotlinx.android.parcel.Parcelize
6 |
7 |
8 | @Parcelize
9 | data class ExpirationDate(
10 | @SerializedName("year") var year: Int? = null,
11 | @SerializedName("month") var month: Int? = null,
12 | @SerializedName("day") var day: Int? = null
13 | ) : Parcelable
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_description_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_done_all_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_identification_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_event_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_place_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notifications.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_access_time_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/payment/PlannedPayment.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.payment
2 |
3 | import com.google.gson.annotations.SerializedName
4 | import java.util.ArrayList
5 |
6 | data class PlannedPayment (
7 | @SerializedName("interestRate") var interestRate: Double? = null,
8 | @SerializedName("costComponents") var costComponents: List = ArrayList(),
9 | @SerializedName("remainingPrincipal") var remainingPrincipal: Double? = null,
10 | @SerializedName("date") var date: String? = null
11 | )
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_edit_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/resources/entries.json:
--------------------------------------------------------------------------------
1 | [ {
2 | "type" : "CREDIT",
3 | "transactionDate" : "2018-06-13T09:37:11.508Z",
4 | "message" : "Message 0",
5 | "amount" : 5.0,
6 | "balance" : -5.0
7 | }, {
8 | "type" : "CREDIT",
9 | "transactionDate" : "2018-06-13T09:37:11.508Z",
10 | "message" : "Message 1",
11 | "amount" : 5.0,
12 | "balance" : -10.0
13 | }, {
14 | "type" : "CREDIT",
15 | "transactionDate" : "2018-06-13T09:37:11.509Z",
16 | "message" : "Message 2",
17 | "amount" : 5.0,
18 | "balance" : -15.0
19 | }
20 | ]
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Issue Fix
2 | Fixes #Issue_Number
3 |
4 | ## Screenshots
5 |
6 |
7 | ## Description
8 |
9 |
10 | ##
11 |
12 |
13 | - [ ] Run the unit tests with `./gradlew check` to make sure you didn't break anything
14 |
15 | - [ ] If you have multiple commits please combine them into one commit by squashing them.
16 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/payment/PlannedPaymentPage.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.payment
2 |
3 | import com.google.gson.annotations.SerializedName
4 | import java.util.ArrayList
5 |
6 | data class PlannedPaymentPage (
7 | @SerializedName("chargeNames") var chargeNames: List = ArrayList(),
8 | @SerializedName("elements") var elements: List = ArrayList(),
9 | @SerializedName("totalPages") var totalPages: Int? = null,
10 | @SerializedName("totalElements") var totalElements: Long? = null
11 | )
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/local/MifosCnDatabase.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.local
2 |
3 | import com.raizlabs.android.dbflow.annotation.Database
4 |
5 | /**
6 | * @author Manish Kumar
7 | * @since 31/July/2018
8 | */
9 |
10 | @Database(name = MifosCnDatabase.NAME, version = MifosCnDatabase.VERSION, foreignKeyConstraintsEnforced = true)
11 | class MifosCnDatabase {
12 | companion object {
13 | // database name will be Mifos.db
14 | const val NAME = "MifosCn"
15 | //Always Increase the Version Number
16 | const val VERSION = 1
17 | }
18 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_surveys_48px.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/accounts/loan/PaymentCycle.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.accounts.loan
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class PaymentCycle (
6 | @SerializedName("temporalUnit") var temporalUnit: String? = null,
7 | @SerializedName("period") var period: Int? = null,
8 | @SerializedName("alignmentDay") var alignmentDay: Int? = null,
9 | @SerializedName("alignmentWeek") var alignmentWeek: Int? = null,
10 | @SerializedName("alignmentMonth") var alignmentMonth: Int? = null
11 | )
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_perm_contact_calendar_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_phone_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/remote/EndPoints.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.remote
2 |
3 | object EndPoints {
4 |
5 | /*
6 | * API End Paths
7 | * <- This section manage the different type of end points
8 | */
9 | const val API_AUTH_PATH = "/customer"
10 | const val API_IDENTITY_PATH = "/identity/v1"
11 | const val API_CUSTOMER_PATH = "/api/customer/v1"
12 | const val API_DEPOSIT_PATH = "/api/deposit/v1"
13 | const val API_PORTFOLIO_PATH = "/api/portfolio/v1"
14 | const val API_ACCOUNTING_PATH = "/api/accounting/v1"
15 | const val API_TELLER_PATH = "/api/teller/v1"
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_lock_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_password_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/AccountEntry.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer
2 |
3 | import android.os.Parcelable
4 | import com.google.gson.annotations.SerializedName
5 | import kotlinx.android.parcel.Parcelize
6 |
7 |
8 | @Parcelize
9 | data class AccountEntry (
10 | @SerializedName("type") val type: String,
11 | @SerializedName("transactionDate") val transactionDate: String? = null,
12 | @SerializedName("message") val message: String?=null,
13 | @SerializedName("amount") val amount : Double?=null,
14 | @SerializedName("balance") val balance: Double?=null
15 | ): Parcelable
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/utils/RxBus.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.utils
2 |
3 | import io.reactivex.Observable
4 | import io.reactivex.subjects.PublishSubject
5 |
6 | // Use object so we have a singleton instance
7 | object RxBus {
8 |
9 | private val publisher = PublishSubject.create()
10 |
11 | fun publish(event: Any) {
12 | publisher.onNext(event)
13 | }
14 |
15 | // Listen should return an Observable and not the publisher
16 | // Using ofType we filter only events that match that class type
17 | fun listen(eventType: Class): Observable = publisher.ofType(eventType)
18 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_lock_open_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/services/AuthService.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.services
2 |
3 | import io.reactivex.Observable
4 | import org.mifos.mobile.cn.data.models.Authentication
5 | import org.mifos.mobile.cn.data.remote.EndPoints
6 | import retrofit2.http.POST
7 |
8 | /**
9 | * @author Rajan Maurya
10 | * On 22/01/18.
11 | */
12 | interface AuthService {
13 |
14 | /*@GET("/authentication")
15 | fun login(loginRequest: LoginRequest): Observable*/
16 | @POST(EndPoints.API_IDENTITY_PATH + "/token?grant_type=refresh_token")
17 | abstract fun refreshToken(): Observable
18 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/utils/DataBus.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.utils
2 |
3 | import io.reactivex.Observable
4 | import io.reactivex.subjects.PublishSubject
5 |
6 | // Use object so we have a singleton instance
7 | object DataBus {
8 |
9 | private val publisher = PublishSubject.create()
10 |
11 | fun publish(event: Any) {
12 | publisher.onNext(event)
13 | }
14 |
15 | // Listen should return an Observable and not the publisher
16 | // Using ofType we filter only events that match that class type
17 | fun listen(eventType: Class): Observable = publisher.ofType(eventType)
18 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_autorenew_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_account_balance_wallet_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/loanApplication/loanActivity/LoanApplicationContract.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.loanApplication.loanActivity
2 |
3 | import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount
4 | import org.mifos.mobile.cn.ui.base.MvpView
5 |
6 | /**
7 | * @author Manish Kumar
8 | * @since 01/August/2018
9 | */
10 | class LoanApplicationContract {
11 |
12 | interface View : MvpView {
13 | fun applicationCreatedSuccessfully()
14 | fun showError(message: String)
15 | }
16 |
17 | interface Presenter {
18 | fun createLoan(loanAccount: LoanAccount)
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/login/LoginContract.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.login
2 |
3 | import org.mifos.mobile.cn.ui.base.MvpView
4 |
5 | interface LoginContract {
6 | interface View : MvpView {
7 | //TODO:edit this for access tokens and other user data
8 | fun showUserLoginSuccessfully()
9 |
10 | fun showUserLoginUnSuccessfully()
11 |
12 | fun showError(errorMessage: String)
13 |
14 | fun showProgress()
15 |
16 | fun hideProgress()
17 | }
18 |
19 | interface Presenter {
20 |
21 | fun login(username: String, password: String)
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_beneficiaries_48px.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/commonTest/kotlin/org/mifos/mobile/cn/FakeRemoteDataSource.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn
2 |
3 | import org.mifos.mobile.cn.TestDataFactory
4 |
5 | /**
6 | * FakeRemoteDataSource is reading the local json files into the java object using gson.
7 | * Created by Rajan Maurya on 25/6/17.
8 | */
9 | class FakeRemoteDataSource {
10 |
11 | companion object {
12 |
13 | private val testDataFactory = TestDataFactory()
14 |
15 | /*fun getTestJson(): TestJson {
16 | return testDataFactory.convertJsonToDataObject(object : TypeToken() {
17 | }, FakeJsonName.TEST_JSON)
18 | }*/
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_person_outline_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/exceptions/ExceptionStatusCode.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.exceptions
2 |
3 | import retrofit2.HttpException
4 |
5 | /**
6 | * @author Rajan Maurya
7 | * On 07/05/18.
8 | */
9 | object ExceptionStatusCode {
10 |
11 | fun isHttp401Error(throwable: Throwable): Boolean {
12 | return (throwable as HttpException).code() == 401
13 | }
14 |
15 | fun isHttp500Error(throwable: Throwable): Boolean {
16 | return (throwable as HttpException).code() == 500
17 | }
18 | fun isHttp403Error(throwable: Throwable): Boolean{
19 | return (throwable as HttpException).code() == 403
20 | }
21 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_border_color_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_help_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/resources/depositAccount.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "customerIdentifier": "customerIdentifier",
4 | "productIdentifier": "productIdentifier",
5 | "accountIdentifier": "accountIdentifier",
6 | "beneficiaries": [
7 | "beneficiaries:1",
8 | "beneficiaries:2"
9 | ],
10 | "state": "CREATED",
11 | "balance": 245.50
12 | },
13 | {
14 | "customerIdentifier": "customerIdentifier",
15 | "productIdentifier": "productIdentifier",
16 | "accountIdentifier": "accountIdentifier",
17 | "beneficiaries": [
18 | "beneficiaries:1",
19 | "beneficiaries:2"
20 | ],
21 | "state": "CREATED",
22 | "balance": 245.50
23 | }
24 | ]
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/local/PreferenceKey.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.local
2 |
3 | object PreferenceKey {
4 |
5 | const val PREF_ICOMMIT = "preferences_icommit"
6 |
7 | const val PREF_KEY_ACCESS_TOKEN = "PREF_KEY_ACCESS_TOKEN"
8 |
9 | const val PREF_KEY_LOGIN_STATUS = "PREF_KEY_LOGIN_STATUS"
10 |
11 | const val PREF_KEY_USER_NAME = "PREF_KEY_USER_NAME"
12 |
13 | //TODO:remove this while implementing API
14 | const val PREF_KEY_PASSWORD = "PREF_KEY_PASSWORD"
15 |
16 | const val PREF_KEY_REFRESH_ACCESS_TOKEN = "PREF_KEY_REFRESH_ACCESS_TOKEN"
17 |
18 | const val PREF_KEY_SIGNED_IN_USER = "PREF_KEY_SIGNED_IN_USER"
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_people_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/accounts/loan/LoanParameters.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.accounts.loan
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class LoanParameters(
6 | @SerializedName("customerIdentifier") var customerIdentifier: String? = null,
7 | @SerializedName("creditWorthinessSnapshots") var creditWorthinessSnapshots:
8 | List? = null,
9 | @SerializedName("maximumBalance") var maximumBalance: Double? = null,
10 | @SerializedName("termRange") var termRange: TermRange? = null,
11 | @SerializedName("paymentCycle") var paymentCycle: PaymentCycle? = null
12 | )
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/Authentication.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models
2 |
3 | import android.os.Parcelable
4 | import com.google.gson.annotations.SerializedName
5 | import kotlinx.android.parcel.Parcelize
6 |
7 | @Parcelize
8 | data class Authentication(
9 | @SerializedName("tokenType") var tokenType: String,
10 | @SerializedName("accessToken") var accessToken: String,
11 | @SerializedName("accessTokenExpiration") var accessTokenExpiration: String,
12 | @SerializedName("refreshTokenExpiration") var refreshTokenExpiration: String,
13 | @SerializedName("passwordExpiration") var passwordExpiration: String
14 | ) : Parcelable
15 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/aboutus/AboutUsActivity.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.aboutus
2 |
3 | import android.os.Bundle
4 | import kotlinx.android.synthetic.main.globalcontainer.*
5 | import org.mifos.mobile.cn.R
6 | import org.mifos.mobile.cn.ui.base.MifosBaseActivity
7 |
8 | class AboutUsActivity: MifosBaseActivity() {
9 |
10 | override fun onCreate(savedInstanceState: Bundle?) {
11 | super.onCreate(savedInstanceState)
12 | setContentView(R.layout.activity_toolbar_container)
13 | setToolbarTitle(getString(R.string.about_us))
14 | showBackButton()
15 | replaceFragment(AboutUsFragment.newInstance(),false,R.id.container)
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_supervisor_account_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_toolbar_container.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
10 |
11 |
12 |
13 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: android
2 | jdk: oraclejdk8
3 | sudo: required
4 | android:
5 | components:
6 | - tools
7 | - extra-android-support
8 | - extra-google-google_play_services
9 | - extra-android-m2repository
10 | - extra-google-m2repository
11 | - build-tools-28.0.3
12 | - android-28
13 | - android-22
14 | - sys-img-armeabi-v7a-android-22
15 | - platform-tools
16 |
17 |
18 |
19 | before_script:
20 | - echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
21 | - emulator -avd test -no-skin -no-audio -no-window &
22 | - android-wait-for-emulator
23 | - adb shell input keyevent 82 &
24 |
25 | script: "./gradlew build connectedAndroidTest --stacktrace"
26 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/datamanager/DataManagerLoan.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.datamanager
2 |
3 | import io.reactivex.Observable
4 | import org.mifos.mobile.cn.data.databasehelper.DataBaseHelperLoan
5 | import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount
6 | import javax.inject.Inject
7 | import javax.inject.Singleton
8 |
9 | /**
10 | * @author Manish Kumar
11 | * @since 31/July/2018
12 | */
13 |
14 | @Singleton
15 | class DataManagerLoan @Inject constructor(var databBaseHelperLoan: DataBaseHelperLoan) {
16 |
17 | fun saveLoanResponse(loanAccount: LoanAccount) :Observable {
18 | return databBaseHelperLoan.saveLoanResponse(loanAccount)
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_bottom_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/injection/module/ActivityModule.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.injection.module
2 |
3 | import android.app.Activity
4 | import android.content.Context
5 | import dagger.Module
6 | import dagger.Provides
7 | import org.mifos.mobile.cn.injection.ActivityContext
8 | import org.mifos.mobile.cn.injection.PerActivity
9 |
10 |
11 | @Module
12 | class ActivityModule(private val activity: Activity) {
13 |
14 | @Provides
15 | @PerActivity
16 | internal fun provideActivity(): Activity {
17 | return activity
18 | }
19 |
20 | @Provides
21 | @PerActivity
22 | @ActivityContext
23 | internal fun providesContext(): Context {
24 | return activity
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerDepositDetails/CustomerDepositDetailsContracts.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.customerDepositDetails
2 |
3 | import org.mifos.mobile.cn.data.models.accounts.deposit.DepositAccount
4 | import org.mifos.mobile.cn.ui.base.MvpView
5 |
6 | interface CustomerDepositDetailsContracts {
7 | interface View : MvpView {
8 | abstract fun showDepositDetails(customerDepositAccounts: DepositAccount)
9 |
10 | abstract fun showProgressbar()
11 |
12 | abstract fun hideProgressbar()
13 |
14 | abstract fun showError(message: String)
15 | }
16 |
17 | interface Presenter {
18 | fun fetchDepositAccountDetails(accountIdentifier: String)
19 | }
20 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/styles_view.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
13 |
14 |
17 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerLoanDetails/CustomerLoanDetailsContracts.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.customerLoanDetails
2 |
3 | import androidx.lifecycle.LiveData
4 | import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount
5 | import org.mifos.mobile.cn.ui.base.MvpView
6 |
7 | interface CustomerLoanDetailsContracts {
8 | interface View : MvpView {
9 |
10 | fun showLoanAccountDetails(loanAccount: LoanAccount)
11 |
12 | fun showProgressbar()
13 |
14 | fun hideProgressbar()
15 |
16 | fun showError(message: String)
17 | }
18 |
19 | interface Presenter {
20 |
21 | fun fetchCustomerLoanDetails(productIdentifier: String, caseIdentifier: String)
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_attach_money_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_products_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
12 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/accounts/loan/CreditWorthinessSnapshot.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.accounts.loan
2 |
3 | import android.os.Parcelable
4 | import com.google.gson.annotations.SerializedName
5 | import kotlinx.android.parcel.Parcelize
6 | import java.util.ArrayList
7 |
8 | @Parcelize
9 | data class CreditWorthinessSnapshot(
10 | @SerializedName("forCustomer") var forCustomer: String? = null,
11 | @SerializedName("incomeSources") var incomeSources: List =
12 | ArrayList(),
13 | @SerializedName("assets") var assets: List = ArrayList(),
14 | @SerializedName("debts") var debts: List = ArrayList()
15 | ) : Parcelable
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/fakesource/FakeJsonName.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.fakesource
2 |
3 | /**
4 | * @author Rajan Maurya
5 | * On 30/04/18.
6 | */
7 | object FakeJsonName {
8 |
9 | var TEST_JSON = "test.json"
10 | var PRODUCTS = "products.json"
11 | var LOAN_ACCOUNTS = "loanAccount.json"
12 | var DEPOSIT_ACCOUNTS = "depositAccount.json"
13 | var CUSTOMER = "customer.json"
14 | var CUSTOMER_COMMANDS = "command.json"
15 | val IDENTIFICATIONS = "identification.json"
16 | val SCAN_CARDS = "scanCard.json"
17 | val PRODUCT_PAGE = "productPage.json";
18 | val ENTRIES = "entries.json"
19 | val LOAN_ACCOUNT = "loanAccounts.json"
20 | val PLANNED_PAYMENT_PAGE = "plannedPaymentPage.json"
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerActivities/CustomerAcitivitesContracts.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.customerActivities
2 |
3 | import org.mifos.mobile.cn.data.models.customer.Command
4 | import org.mifos.mobile.cn.ui.base.MvpView
5 |
6 | interface CustomerAcitivitesContracts {
7 | interface View : MvpView {
8 |
9 | fun showUserInterface()
10 |
11 | fun showCustomerCommands(commands: List)
12 |
13 | fun showEmptyCommands(message: String)
14 |
15 | fun showRecyclerView(status: Boolean)
16 |
17 | fun showProgressbar()
18 |
19 | fun hideProgressbar()
20 | }
21 | interface Presenter{
22 | fun fetchCustomerCommands(customerIdentifier: String)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/org/mifos/mobile/cn/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn
2 |
3 | import androidx.test.InstrumentationRegistry
4 | import androidx.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("org.mifos.mobile.cn", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_share_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_view_scan_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/resources/plannedPaymentPage.json:
--------------------------------------------------------------------------------
1 | {
2 | "chargeNames": [
3 | {
4 | "identifier": "identifier",
5 | "name": "name"
6 | }
7 | ],
8 | "elements": [
9 | {
10 | "interestRate": 5.10,
11 | "costComponents": [
12 | {
13 | "chargeIdentifier": "chargeIdentifier",
14 | "amount": 4500.75
15 | }
16 | ],
17 | "remainingPrincipal": 3400,
18 | "date": "date"
19 | },
20 | {
21 | "interestRate": 5.10,
22 | "costComponents": [
23 | {
24 | "chargeIdentifier": "chargeIdentifier",
25 | "amount": 4500.75
26 | }
27 | ],
28 | "remainingPrincipal": 3400,
29 | "date": "date"
30 | }
31 | ],
32 | "totalPages": 1,
33 | "totalElements": 1
34 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/base/OnItemClickListener.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.base
2 |
3 | import android.view.View
4 |
5 | /**
6 | * A click listener for items.
7 | */
8 | interface OnItemClickListener {
9 |
10 | /**
11 | * Called when an item is clicked.
12 | *
13 | * @param childView View of the item that was clicked.
14 | * @param position Position of the item that was clicked.
15 | */
16 | fun onItemClick(childView: View, position: Int)
17 |
18 | /**
19 | * Called when an item is long pressed.
20 | *
21 | * @param childView View of the item that was long pressed.
22 | * @param position Position of the item that was long pressed.
23 | */
24 | fun onItemLongPress(childView: View, position: Int)
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerActivities/CustomerActivitiesActivity.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.customerActivities
2 |
3 | import android.os.Bundle
4 | import org.mifos.mobile.cn.R
5 | import org.mifos.mobile.cn.ui.base.MifosBaseActivity
6 | import org.mifos.mobile.cn.ui.utils.ConstantKeys
7 |
8 | class CustomerActivitiesActivity: MifosBaseActivity() {
9 | override fun onCreate(savedInstanceState: Bundle?) {
10 | super.onCreate(savedInstanceState)
11 | setContentView(R.layout.activity_toolbar_container)
12 |
13 | val identifier : String = intent.extras.getString(ConstantKeys.CUSTOMER_IDENTIFIER)
14 | replaceFragment(CustomerActivitiesFragment.newInstance(identifier),false,R.id.container)
15 | showBackButton()
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/remote/BaseUrl.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.remote
2 |
3 | import org.mifos.mobile.cn.BuildConfig
4 |
5 | /**
6 | * @author Rajan Maurya
7 | * On 22/01/18.
8 | */
9 | object BaseUrl {
10 |
11 | private const val PROTOCOL_HTTPS = "http://"
12 | private const val API_TEST_ENDPOINT = "example.com"
13 | private const val API_PRODUCTION_ENDPOINT = "example.com"
14 | private const val PORT = "8000"
15 | // "/" in the last of the base url always
16 |
17 | val defaultBaseUrl: String
18 | get() = "$PROTOCOL_HTTPS$apiEndpoint:$PORT"
19 |
20 | val apiEndpoint: String
21 | get() = if (BuildConfig.DEBUG) {
22 | API_TEST_ENDPOINT
23 | } else {
24 | API_PRODUCTION_ENDPOINT
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/identificationlist/IdentificationsActivity.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.identificationlist
2 |
3 | import android.os.Bundle
4 | import org.mifos.mobile.cn.R
5 | import org.mifos.mobile.cn.ui.base.MifosBaseActivity
6 | import org.mifos.mobile.cn.ui.utils.ConstantKeys
7 |
8 | class IdentificationsActivity: MifosBaseActivity() {
9 | override fun onCreate(savedInstanceState: Bundle?) {
10 | super.onCreate(savedInstanceState)
11 | setContentView(R.layout.activity_toolbar_container)
12 |
13 | val identifier : String = intent.extras.getString(ConstantKeys.CUSTOMER_IDENTIFIER)
14 |
15 | replaceFragment(IdentificationsFragment.newInstance(identifier) , false, R.id.container)
16 |
17 | showBackButton()
18 | }
19 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | android.enableJetifier=true
10 | android.useAndroidX=true
11 | org.gradle.jvmargs=-Xmx1536m
12 | # When configured, Gradle will run in incubating parallel mode.
13 | # This option should only be used with decoupled projects. More details, visit
14 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
15 | # org.gradle.parallel=true
16 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/Command.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class Command(
6 | @SerializedName("action") var action: Action? = null,
7 | @SerializedName("comment") var comment: String? = null,
8 | @SerializedName("createdOn") var createdOn: String? = null,
9 | @SerializedName("createdBy") var createdBy: String? = null
10 | ) {
11 | enum class Action {
12 |
13 | @SerializedName("ACTIVATE")
14 | ACTIVATE,
15 |
16 | @SerializedName("LOCK")
17 | LOCK,
18 |
19 | @SerializedName("UNLOCK")
20 | UNLOCK,
21 |
22 | @SerializedName("CLOSE")
23 | CLOSE,
24 |
25 | @SerializedName("REOPEN")
26 | REOPEN
27 | }
28 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_monetization_on_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/DateOfBirth.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer
2 |
3 | import android.os.Parcelable
4 | import com.google.gson.annotations.SerializedName
5 | import com.raizlabs.android.dbflow.annotation.PrimaryKey
6 | import com.raizlabs.android.dbflow.annotation.Table
7 | import com.raizlabs.android.dbflow.structure.BaseModel
8 | import kotlinx.android.parcel.Parcelize
9 | import org.mifos.mobile.cn.local.MifosCnDatabase
10 |
11 | @Parcelize
12 | @Table(database = MifosCnDatabase::class, allFields = true)
13 | data class DateOfBirth(
14 | @SerializedName("year") var year: Int? = null,
15 | @SerializedName("month") var month: Int? = null,
16 | @SerializedName("day") var day: Int? = null
17 | ) : BaseModel(), Parcelable {
18 | @PrimaryKey(autoincrement = true)
19 | var id: Long? = null
20 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/injection/component/ConfigPersistentComponent.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.injection.component
2 |
3 | import dagger.Component
4 | import org.mifos.mobile.cn.injection.ConfigPersistent
5 | import org.mifos.mobile.cn.injection.module.ActivityModule
6 |
7 | /**
8 | * A dagger component that will live during the lifecycle of an Activity but it won't
9 | * be destroy during configuration changes. Check [@MifosBaseActivity] to see how this components
10 | * survives configuration changes.
11 | * Use the [ConfigPersistent] scope to annotate dependencies that need to survive
12 | * configuration changes (for example Presenters).
13 | */
14 | @ConfigPersistent
15 | @Component(dependencies = [ApplicationComponent::class])
16 | interface ConfigPersistentComponent {
17 | fun activityComponent(activityModule: ActivityModule): ActivityComponent
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/resources/command.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "action": "ACTIVATE",
4 | "comment": "comment",
5 | "createdOn": "createdOn",
6 | "createdBy": "createdBy"
7 | },
8 | {
9 | "action": "LOCK",
10 | "comment": "comment",
11 | "createdOn": "createdOn",
12 | "createdBy": "createdBy"
13 | },
14 | {
15 | "action": "UNLOCK",
16 | "comment": "comment",
17 | "createdOn": "createdOn",
18 | "createdBy": "createdBy"
19 | },
20 | {
21 | "action": "REOPEN",
22 | "comment": "comment",
23 | "createdOn": "createdOn",
24 | "createdBy": "createdBy"
25 | },
26 | {
27 | "action": "CLOSE",
28 | "comment": "comment",
29 | "createdOn": "createdOn",
30 | "createdBy": "createdBy"
31 | },
32 | {
33 | "action": "ACTIVATE",
34 | "comment": "comment",
35 | "createdOn": "createdOn",
36 | "createdBy": "createdBy"
37 | }
38 | ]
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerDetails/CustomerDetailsActivity.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.customerDetails
2 |
3 | import android.os.Bundle
4 | import org.mifos.mobile.cn.R
5 | import org.mifos.mobile.cn.ui.base.MifosBaseActivity
6 | import org.mifos.mobile.cn.ui.utils.ConstantKeys
7 |
8 | class CustomerDetailsActivity: MifosBaseActivity() {
9 | var customerDetailsFragment= CustomerDetailsFragment
10 |
11 |
12 | override fun onCreate(savedInstanceState: Bundle?) {
13 | super.onCreate(savedInstanceState)
14 | setContentView(R.layout.activity_toolbar_container)
15 | supportActionBar!!.hide()
16 |
17 | val identifier : String = intent.extras.getString(ConstantKeys.CUSTOMER_IDENTIFIER)
18 | replaceFragment(CustomerDetailsFragment.newInstance(identifier),false,R.id.container)
19 | showBackButton()
20 |
21 | }
22 |
23 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/styles_text.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
12 |
13 |
16 |
17 |
22 |
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the ART/Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 | out/
15 |
16 | # Gradle files
17 | .gradle/
18 | build/
19 |
20 | # Local configuration file (sdk path, etc)
21 | local.properties
22 |
23 | # Proguard folder generated by Eclipse
24 | proguard/
25 |
26 | # Log Files
27 | *.log
28 |
29 | # Android Studio Navigation editor temp files
30 | .navigation/
31 |
32 | # Android Studio captures folder
33 | captures/
34 |
35 | # Intellij
36 | *.iml
37 | .idea
38 | .idea/workspace.xml
39 | .idea/tasks.xml
40 | .idea/gradle.xml
41 | .idea/dictionaries
42 | .idea/libraries
43 |
44 | # Keystore files
45 | *.jks
46 |
47 | # External native build folder generated in Android Studio 2.2 and later
48 | .externalNativeBuild
49 |
50 | # Google Services (e.g. APIs or Firebase)
51 | google-services.json
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/identification/Identification.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer.identification
2 |
3 | import android.os.Parcelable
4 |
5 | import com.google.gson.annotations.SerializedName
6 | import kotlinx.android.parcel.Parcelize
7 |
8 |
9 | @Parcelize
10 | data class Identification(
11 | @SerializedName("type") var type: String? = "",
12 | @SerializedName("number") var number: String? = "",
13 | @SerializedName("expirationDate") var expirationDate: ExpirationDate? = null,
14 | @SerializedName("issuer") var issuer: String? = "",
15 | @SerializedName("createdBy") var createdBy: String? = "",
16 | @SerializedName("createdOn") var createdOn: String? = "",
17 | @SerializedName("lastModifiedBy") var lastModifiedBy: String? = "",
18 | @SerializedName("lastModifiedOn") var lastModifiedOn: String? = ""
19 | ) : Parcelable
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_sentiment_dissatisfied_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Summary
2 |
3 |
4 |
5 | ## Steps to reproduce
6 |
7 |
8 |
9 | ## Expected behaviour
10 |
11 |
12 |
13 | ## Observed behaviour
14 |
15 |
16 |
17 | ## Logcat for the issue
18 |
19 |
20 |
21 | ## Device and Android version
22 |
23 |
27 |
28 | ## Screenshots
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/products/ProductContracts.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.products
2 |
3 | import androidx.lifecycle.LiveData
4 | import org.mifos.mobile.cn.data.models.product.Product
5 | import org.mifos.mobile.cn.data.models.product.ProductPage
6 | import org.mifos.mobile.cn.ui.base.MvpView
7 |
8 | interface ProductContracts {
9 | interface View : MvpView {
10 | fun showUserInterface()
11 |
12 | fun showProduct(products: LiveData)
13 |
14 | fun showEmptyProduct()
15 |
16 | fun showRecyclerView(status: Boolean)
17 |
18 | fun showProgressbar()
19 |
20 | fun hideProgressbar()
21 |
22 | fun searchedProduct(products: List)
23 |
24 | }
25 |
26 | interface Presenter {
27 |
28 | fun getProductsPage()
29 |
30 |
31 | fun searchProduct(products: List, identifier: String)
32 | }
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/accounts/AccountsContract.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.accounts
2 |
3 | /**
4 | * @author Manish Kumar
5 | * @since 09/July/2018
6 | */
7 | import org.mifos.mobile.cn.data.models.accounts.deposit.DepositAccount
8 | import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount
9 | import org.mifos.mobile.cn.ui.base.MvpView
10 |
11 | interface AccountsContract {
12 |
13 | interface View : MvpView {
14 |
15 | fun showLoanAccounts(loanAccounts: List)
16 | fun showDepositAccounts(depositAccounts: List)
17 | fun showEmptyAccounts(feature: String)
18 | fun showError(message: String)
19 | fun showProgress()
20 | fun hideProgress()
21 | }
22 |
23 | interface Presenter {
24 |
25 | //TODO: edit this while setting up fakeDB
26 | fun loadLoanAccounts()
27 | fun loadDepositAccounts()
28 |
29 | }
30 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/services/IndividualLendingService.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.services
2 |
3 | import io.reactivex.Observable
4 | import org.mifos.mobile.cn.data.models.payment.PlannedPaymentPage
5 | import org.mifos.mobile.cn.data.remote.EndPoints
6 | import retrofit2.http.GET
7 | import retrofit2.http.Path
8 | import retrofit2.http.Query
9 |
10 | interface IndividualLendingService {
11 | @GET(EndPoints.API_PORTFOLIO_PATH
12 | + "/individuallending/products/{productidentifier}"
13 | + "/cases/{caseidentifier}/plannedpayments")
14 | fun getPaymentScheduleForCase(
15 | @Path("productidentifier") productIdentifier: String,
16 | @Path("caseidentifier") caseIdentifier: String,
17 | @Query("pageIndex") pageIndex: Int?,
18 | @Query("size") size: Int?,
19 | @Query("initialDisbursalDate") initialDisbursalDate: String): Observable
20 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/plannedPlayment/PlannedPaymentActivity.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.plannedPlayment
2 |
3 | import android.os.Bundle
4 | import org.mifos.mobile.cn.R
5 | import org.mifos.mobile.cn.ui.base.MifosBaseActivity
6 | import org.mifos.mobile.cn.ui.utils.ConstantKeys
7 |
8 | class PlannedPaymentActivity: MifosBaseActivity() {
9 |
10 | override fun onCreate(savedInstanceState: Bundle?) {
11 | super.onCreate(savedInstanceState)
12 | setContentView(R.layout.activity_toolbar_container)
13 | supportActionBar!!.hide()
14 | val productIdentifier = intent.extras.getString(
15 | ConstantKeys.PRODUCT_IDENTIFIER)
16 | val caseIdentifier = intent.extras.getString(ConstantKeys.CASE_IDENTIFIER)
17 | replaceFragment(PlannedPaymentFragment.newInstance(productIdentifier, caseIdentifier),
18 | false, R.id.container)
19 |
20 | showBackButton()
21 | }
22 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_cake_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/local/DatabaseHelperCustomer.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.local
2 |
3 | import com.raizlabs.android.dbflow.sql.language.SQLite.select
4 | import org.mifos.mobile.cn.data.models.customer.Customer
5 | import org.mifos.mobile.cn.data.models.customer.Customer_Table
6 |
7 | import javax.inject.Inject
8 |
9 |
10 | class DatabaseHelperCustomer @Inject constructor(){
11 |
12 | fun fetchCustomer(identifier: String): io.reactivex.Observable {
13 | return io.reactivex.Observable.defer {
14 | var customer = select()
15 | .from(Customer::class.java)
16 | .where(Customer_Table.identifier.eq(identifier))
17 | .querySingle()
18 | if (customer == null)
19 | customer = Customer()
20 | //else it will throw exception and will not go in the flatMap
21 | io.reactivex.Observable.just(customer)
22 | }
23 |
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/identificationlist/IdentificationsContract.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.identificationlist
2 |
3 | import org.mifos.mobile.cn.data.models.customer.identification.Identification
4 | import org.mifos.mobile.cn.ui.base.MvpView
5 |
6 | interface IdentificationsContract {
7 | interface Views : MvpView{
8 | fun showUserInterface()
9 |
10 | fun showIdentification(identifications: List)
11 |
12 | fun showProgressbar()
13 |
14 | fun hideProgressbar()
15 |
16 | fun showRecyclerView(status: Boolean)
17 |
18 | fun showEmptyIdentifications()
19 |
20 | fun showMessage(message: String)
21 |
22 | fun searchedIdentifications(identification: List)
23 |
24 | }
25 | interface Presenter{
26 | fun fetchIdentifications(customerIdentifier: String)
27 | fun searchIdentifications(identificationList: List, query: String)
28 | }
29 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/identificationdetails/IdentificationDetailsContract.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.identificationdetails
2 |
3 | import org.mifos.mobile.cn.data.models.customer.identification.Identification
4 | import org.mifos.mobile.cn.data.models.customer.identification.ScanCard
5 | import org.mifos.mobile.cn.ui.base.MvpView
6 |
7 | interface IdentificationDetailsContract {
8 | interface View : MvpView{
9 | fun fetchIdentificationScanCard()
10 |
11 | fun showUserInterface()
12 |
13 | fun initializeRecyclerView()
14 |
15 | fun showScanCards(scanCards: List)
16 |
17 | fun showRecyclerView(status: Boolean)
18 |
19 | fun showScansStatus(message: String)
20 |
21 |
22 | fun hideProgressDialog()
23 |
24 | fun showError(message: String)
25 | }
26 | interface Presenter{
27 | fun fetchIdentificationScanCards(customerIdentifier: String, identificationNumber: String)
28 |
29 | }
30 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerDetails/CustomerDetailsContract.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.customerDetails
2 |
3 |
4 | import org.mifos.mobile.cn.data.models.customer.ContactDetail
5 | import org.mifos.mobile.cn.data.models.customer.Customer
6 | import org.mifos.mobile.cn.ui.base.MvpView
7 |
8 | interface CustomerDetailsContract {
9 |
10 | interface View: MvpView{
11 |
12 | fun showUserInterface()
13 |
14 | fun showCustomerDetails(customer : Customer)
15 |
16 | fun showContactDetails(contactDetail : ContactDetail)
17 |
18 | fun showToolbarTitleSubtitle(title: String, subtitle: String)
19 |
20 | fun loadCustomerPortrait()
21 |
22 | fun showProgressbar()
23 |
24 | fun hideProgressbar()
25 |
26 | fun getCustomerStatus(): Customer.State
27 |
28 | fun showError(errorMessage : String)
29 |
30 | }
31 | interface Presenter{
32 | fun loadCustomerDetails(identifier: String)
33 |
34 |
35 | }
36 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/recentTransactions/RecentTransactionsContracts.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.recentTransactions
2 |
3 | import org.intellij.lang.annotations.Identifier
4 | import org.mifos.mobile.cn.data.models.customer.AccountEntriesPage
5 | import org.mifos.mobile.cn.data.models.customer.AccountEntry
6 | import org.mifos.mobile.cn.ui.base.MvpView
7 |
8 | interface RecentTransactionsContracts {
9 |
10 | interface View: MvpView{
11 |
12 | fun showUserInterface()
13 |
14 | fun showAccountEntries(entries: List)
15 |
16 | fun showEmptyEntries()
17 |
18 | fun showRecyclerView(status: Boolean)
19 |
20 | fun showProgressbar()
21 |
22 | fun hideProgressbar()
23 |
24 | fun searchedTransaction(transactions: List)
25 |
26 | }
27 |
28 | interface Presenter{
29 | fun getEntriesPage()
30 |
31 | fun searchTransaction(transactionList: List,type: String)
32 | }
33 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/adapter/ViewPagerAdapter.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.adapter
2 |
3 | import androidx.fragment.app.Fragment
4 | import androidx.fragment.app.FragmentManager
5 | import androidx.fragment.app.FragmentPagerAdapter
6 | import java.util.ArrayList
7 |
8 | /**
9 | * @author Manish Kumar
10 | * @since 8/6/18
11 | */
12 |
13 | class ViewPagerAdapter(manager: FragmentManager) : FragmentPagerAdapter(manager) {
14 | private val mFragmentList = ArrayList()
15 | private val mFragmentTitleList = ArrayList()
16 |
17 | override fun getItem(position: Int): Fragment {
18 | return mFragmentList[position]
19 | }
20 |
21 | override fun getCount(): Int {
22 | return mFragmentList.size
23 | }
24 |
25 | fun addFragment(fragment: Fragment, title: String) {
26 | mFragmentList.add(fragment)
27 | mFragmentTitleList.add(title)
28 | }
29 |
30 | override fun getPageTitle(position: Int): CharSequence? {
31 | return mFragmentTitleList[position]
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_collapsing_header_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
18 |
19 |
20 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
14 |
15 |
20 |
21 |
24 |
--------------------------------------------------------------------------------
/app/src/main/resources/identification.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "type": "type1",
4 | "number": "number1",
5 | "expirationDate": {
6 | "year": 1985,
7 | "month": 11,
8 | "day": 27
9 | },
10 | "issuer": "issuer1",
11 | "createdBy": "createdBy",
12 | "createdOn": "createdOn",
13 | "lastModifiedBy": "lastModifiedBy",
14 | "lastModifiedOn": "lastModifiedOn"
15 | },
16 |
17 | {
18 | "type": "type2",
19 | "number": "number2",
20 | "expirationDate": {
21 | "year": 1985,
22 | "month": 11,
23 | "day": 27
24 | },
25 | "issuer": "issuer2",
26 | "createdBy": "createdBy",
27 | "createdOn": "createdOn",
28 | "lastModifiedBy": "lastModifiedBy",
29 | "lastModifiedOn": "lastModifiedOn"
30 | },
31 |
32 | {
33 | "type": "type3",
34 | "number": "number3",
35 | "expirationDate": {
36 | "year": 1985,
37 | "month": 11,
38 | "day": 27
39 | },
40 | "issuer": "issuer3",
41 | "createdBy": "createdBy",
42 | "createdOn": "createdOn",
43 | "lastModifiedBy": "lastModifiedBy",
44 | "lastModifiedOn": "lastModifiedOn"
45 | }
46 | ]
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_recent_transactions.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
19 |
20 |
21 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_customer_activities.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
19 |
20 |
21 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/Address.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer
2 |
3 | import android.os.Parcelable
4 | import com.google.gson.annotations.SerializedName
5 | import com.raizlabs.android.dbflow.annotation.ConflictAction
6 | import com.raizlabs.android.dbflow.annotation.PrimaryKey
7 | import com.raizlabs.android.dbflow.annotation.Table
8 | import com.raizlabs.android.dbflow.structure.BaseModel
9 | import kotlinx.android.parcel.Parcelize
10 | import org.mifos.mobile.cn.local.MifosCnDatabase
11 |
12 | @Parcelize
13 | @Table(name = "Address", database = MifosCnDatabase::class, allFields = true, insertConflict =
14 | ConflictAction.REPLACE)
15 | data class Address(
16 | @PrimaryKey
17 | @SerializedName("street") var street: String? = null,
18 | @PrimaryKey
19 | @SerializedName("city") var city: String? = null,
20 | @PrimaryKey
21 | @SerializedName("region") var region: String? = null,
22 | @SerializedName("postalCode") var postalCode: String? = null,
23 | @SerializedName("countryCode") var countryCode: String? = null,
24 | @SerializedName("country") var country: String? = null
25 | ) : BaseModel(), Parcelable
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_product.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
20 |
21 |
22 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/services/DepositService.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.services
2 |
3 | import io.reactivex.Completable
4 | import io.reactivex.Observable
5 | import org.mifos.mobile.cn.data.models.accounts.deposit.DepositAccount
6 | import org.mifos.mobile.cn.data.remote.EndPoints
7 | import retrofit2.http.*
8 |
9 | interface DepositService {
10 |
11 | @GET(EndPoints.API_DEPOSIT_PATH + "/instances")
12 | abstract fun fetchCustomersDeposits(
13 | @Query("customer") customerIdentifier: String): Observable>
14 |
15 | @GET(EndPoints.API_DEPOSIT_PATH + "/instances/{accountIdentifier}")
16 | abstract fun fetchCustomerDepositDetails(
17 | @Path("accountIdentifier") accountIdentifier: String): Observable
18 |
19 | @POST(EndPoints.API_DEPOSIT_PATH + "/instances")
20 | abstract fun createDepositAccount(@Body depositAccount: DepositAccount): Completable
21 |
22 | @PUT(EndPoints.API_DEPOSIT_PATH + "/instances/{accountIdentifier}")
23 | abstract fun updateDepositAccount(
24 | @Path("accountIdentifier") accountIdentifier: String,
25 | @Body depositAccount: DepositAccount): Completable
26 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/loanApplication/loanDetails/LoanDetailsContract.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.loanApplication.loanDetails
2 |
3 | import org.mifos.mobile.cn.data.models.product.Product
4 | import org.mifos.mobile.cn.ui.base.MvpView
5 |
6 | interface LoanDetailsContract {
7 |
8 | interface View : MvpView {
9 |
10 | fun showUserInterface()
11 |
12 | fun showProducts(products: List)
13 |
14 | fun setComponentsValidations(product: Product)
15 |
16 | fun showEmptyProducts()
17 |
18 | fun showProgress()
19 |
20 | fun hideProgress()
21 |
22 | fun showError(message: String)
23 |
24 | fun validateShortName(): Boolean
25 |
26 | fun validateTerm(): Boolean
27 |
28 | fun validatePrincipalAmount(): Boolean
29 |
30 | fun validateRepay(): Boolean
31 | }
32 |
33 | interface Presenter {
34 |
35 | fun fetchProducts()
36 |
37 | fun filterProducts(products: List): List
38 |
39 | fun setProductPositionAndValidateViews(position: Int?)
40 |
41 | fun getCurrentTermUnitType(unitTypes: List, unitType: String): List
42 | }
43 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/utils/Utils.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.utils
2 |
3 | import android.content.Context
4 | import android.graphics.PorterDuff
5 | import android.view.Menu
6 | import androidx.core.content.ContextCompat
7 | import com.google.gson.Gson
8 | import com.google.gson.reflect.TypeToken
9 | import java.util.*
10 |
11 | /**
12 | * @author Rajan Maurya
13 | * On 28/05/18.
14 | */
15 | class Utils {
16 |
17 | companion object {
18 | fun getPrecision(aDouble: Double?): String {
19 | return String.format(Locale.ENGLISH, "%.2f", aDouble)
20 | }
21 |
22 | fun getStringToPoJo(listModel: TypeToken, jsonName: String): T {
23 | return Gson().fromJson(jsonName, listModel.type)
24 | }
25 |
26 | fun setToolbarIconColor(context: Context, menu: Menu, color: Int) {
27 | for (i in 0 until menu.size()) {
28 | val drawable = menu.getItem(i).icon
29 | if (drawable != null) {
30 | drawable.mutate()
31 | drawable.setColorFilter(
32 | ContextCompat.getColor(context, color), PorterDuff.Mode.SRC_IN)
33 | }
34 | }
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/dbmodel/LoanResponse.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.dbmodel
2 |
3 | import android.os.Parcelable
4 | import com.raizlabs.android.dbflow.annotation.Column
5 | import com.raizlabs.android.dbflow.annotation.PrimaryKey
6 | import com.raizlabs.android.dbflow.annotation.Table
7 | import com.raizlabs.android.dbflow.structure.BaseModel
8 | import kotlinx.android.parcel.IgnoredOnParcel
9 | import kotlinx.android.parcel.Parcelize
10 | import org.mifos.mobile.cn.local.MifosCnDatabase
11 |
12 | /**
13 | * @author Manish Kumar
14 | * @since 31/July/2018
15 | */
16 |
17 | @Parcelize
18 | @Table(name = "LoanResponse", database = MifosCnDatabase::class)
19 | data class LoanResponse(
20 | @Column var identifier: String? = null,
21 | @Column var productIdentifier: String? = null,
22 | @Column var parameters: String? = null,
23 | @Column var currentState: String? = null,
24 | @Column var createdOn: String? = null,
25 | @Column var createdBy: String? = null,
26 | @Column var lastModifiedOn: String? = null,
27 | @Column var lastModifiedBy: String? = null
28 |
29 | ) : Parcelable, BaseModel() {
30 | @PrimaryKey(autoincrement = true)
31 | @IgnoredOnParcel
32 | var id: Long = 0
33 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/injection/module/ApplicationModule.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.injection.module
2 |
3 | import android.app.Application
4 | import android.content.Context
5 | import dagger.Module
6 | import dagger.Provides
7 | import org.mifos.mobile.cn.data.local.PreferencesHelper
8 | import org.mifos.mobile.cn.injection.ApplicationContext
9 | import org.mifos.mobile.cn.data.remote.BaseApiManager
10 | import javax.inject.Singleton
11 |
12 | /**
13 | * Provide application-level dependencies.
14 | */
15 | @Module
16 | class ApplicationModule(val application: Application) {
17 |
18 | @Provides
19 | @Singleton
20 | internal fun provideApplication(): Application {
21 | return application
22 | }
23 |
24 | @Provides
25 | @Singleton
26 | @ApplicationContext
27 | internal fun provideContext(): Context {
28 | return application
29 | }
30 |
31 | @Provides
32 | @Singleton
33 | internal fun providePreferencesHelper(@ApplicationContext context: Context): PreferencesHelper {
34 | return PreferencesHelper(context)
35 | }
36 |
37 | @Provides
38 | @Singleton
39 | internal fun provideBaseApiManager(): BaseApiManager {
40 | return BaseApiManager(application)
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/databasehelper/DataBaseHelperLoan.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.databasehelper
2 |
3 | import io.reactivex.Observable
4 | import org.mifos.mobile.cn.data.dbmodel.LoanResponse
5 | import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount
6 | import javax.inject.Inject
7 |
8 |
9 | /**
10 | * @author Manish Kumar
11 | * @since 31/July/2018
12 | */
13 | class DataBaseHelperLoan @Inject constructor() {
14 |
15 | fun saveLoanResponse(loanAccount: LoanAccount): Observable {
16 | return Observable.defer {
17 | val loanResponse = LoanResponse()
18 | loanResponse.createdBy = loanAccount.createdBy
19 | loanResponse.createdOn = loanAccount.createdOn
20 | loanResponse.lastModifiedOn = loanAccount.lastModifiedOn
21 | loanResponse.lastModifiedBy = loanAccount.lastModifiedBy
22 | loanResponse.identifier = loanAccount.identifier
23 | loanResponse.parameters = loanAccount.parameters
24 | loanResponse.currentState = loanAccount.currentState?.name
25 | loanResponse.productIdentifier = loanAccount.productIdentifier
26 | loanResponse.save()
27 | return@defer Observable.just(LoanAccount())
28 | }
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/datamanager/DataManagerDepositDetails.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.datamanager
2 |
3 | import io.reactivex.Observable
4 | import io.reactivex.ObservableSource
5 | import io.reactivex.functions.Function
6 | import org.mifos.mobile.cn.data.local.PreferencesHelper
7 | import org.mifos.mobile.cn.data.models.accounts.deposit.DepositAccount
8 | import org.mifos.mobile.cn.data.remote.BaseApiManager
9 | import org.mifos.mobile.cn.fakesource.FakeRemoteDataSource
10 | import javax.inject.Inject
11 | import javax.inject.Singleton
12 |
13 | @Singleton
14 | class DataManagerDepositDetails @Inject constructor(private var baseApiManager: BaseApiManager, preferencesHelper: PreferencesHelper, dataManagerAuth: DataManagerAuth) :
15 | MifosBaseDataManager(dataManagerAuth, preferencesHelper) {
16 |
17 | fun getCustomerDepositAccountDetails(
18 | accountIdentifier: String): Observable {
19 | return authenticatedObservableApi(baseApiManager.getDepositApi()
20 | .fetchCustomerDepositDetails(accountIdentifier))
21 | .onErrorResumeNext(
22 | Function> { Observable.just(FakeRemoteDataSource.getCustomerDepositAccounts()[0]) })
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/accounts/deposit/DepositAccount.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.accounts.deposit
2 |
3 | import android.os.Parcelable
4 | import com.google.gson.annotations.SerializedName
5 | import kotlinx.android.parcel.Parcelize
6 | import java.util.ArrayList
7 |
8 | @Parcelize
9 | data class DepositAccount(
10 | @SerializedName("customerIdentifier") var customerIdentifier: String? = null,
11 | @SerializedName("productIdentifier") var productIdentifier: String? = null,
12 | @SerializedName("accountIdentifier") var accountIdentifier: String? = null,
13 | @SerializedName("beneficiaries") var beneficiaries: List = ArrayList(),
14 | @SerializedName("state") var state: State? = null,
15 | @SerializedName("balance") var balance: Double? = null
16 | ) : Parcelable {
17 |
18 | enum class State {
19 |
20 | @SerializedName("CREATED")
21 | CREATED,
22 |
23 | @SerializedName("PENDING")
24 | PENDING,
25 |
26 | @SerializedName("APPROVED")
27 | APPROVED,
28 |
29 | @SerializedName("ACTIVE")
30 | ACTIVE,
31 |
32 | @SerializedName("LOCKED")
33 | LOCKED,
34 |
35 | @SerializedName("CLOSED")
36 | CLOSED
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_identification_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/plannedPlayment/PlannedPaymentContract.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.plannedPlayment
2 |
3 | import org.mifos.mobile.cn.data.models.payment.PlannedPayment
4 | import org.mifos.mobile.cn.ui.base.MvpView
5 |
6 | interface PlannedPaymentContract {
7 | interface View : MvpView {
8 |
9 | fun fetchPlannedPayment()
10 |
11 | fun showUserInterface()
12 |
13 | fun showPlannedPayment(plannedPayments: List)
14 |
15 | fun showMorePlannedPayments(plannedPayments: List)
16 |
17 | fun showEmptyPayments(message: String)
18 |
19 | fun showRecyclerView(visible: Boolean)
20 |
21 | fun showProgressbar()
22 |
23 | fun hideProgressbar()
24 |
25 | fun showMessage(message: String)
26 | }
27 |
28 | interface Presenter {
29 |
30 | fun fetchPlannedPayment(productIdentifier: String, caseIdentifier: String,
31 | pageIndex: Int?, initialDisbursalDate: String, loadmore: Boolean?)
32 |
33 | fun fetchPlannedPayment(productIdentifier: String, caseIdentifier: String,
34 | pageIndex: Int?, initialDisbursalDate: String)
35 |
36 | fun showPlannedPayment(customers: List)
37 | }
38 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_customer_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
14 |
15 |
25 |
26 |
27 |
28 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/row_checkbox.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
18 |
19 |
26 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/loanApplication/OnNavigationBarListener.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.loanApplication
2 |
3 | import org.mifos.mobile.cn.data.models.accounts.loan.CreditWorthinessSnapshot
4 | import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount
5 | import org.mifos.mobile.cn.data.models.accounts.loan.PaymentCycle
6 | import org.mifos.mobile.cn.data.models.accounts.loan.TermRange
7 |
8 | interface OnNavigationBarListener {
9 | interface LoanDetailsData {
10 | fun setLoanDetails(currentState: LoanAccount.State, identifier: String,
11 | productIdentifier: String, maximumBalance: Double?, paymentCycle: PaymentCycle,
12 | termRange: TermRange, selectedProduct: String)
13 | }
14 |
15 | interface ReviewLoan {
16 | val loanAccount: LoanAccount
17 | val selectedProduct: String
18 | val creditWorthinessSnapshot: List
19 | }
20 |
21 | interface LoanDebtIncomeData {
22 | fun setDebtIncome(debtIncome: CreditWorthinessSnapshot)
23 | }
24 |
25 | interface LoanCoSignerData {
26 | fun setCoSignerDebtIncome(coSignerDebtIncome: CreditWorthinessSnapshot)
27 |
28 | fun showProgressbar(message: String)
29 |
30 | fun hideProgressbar()
31 | }
32 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/views/HeaderView.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.views
2 |
3 | import android.annotation.TargetApi
4 | import android.content.Context
5 | import android.os.Build
6 | import android.util.AttributeSet
7 | import android.view.View
8 | import android.widget.LinearLayout
9 | import android.widget.TextView
10 | import kotlinx.android.synthetic.main.layout_collapsing_header_view.view.*
11 |
12 | open class HeaderView : LinearLayout {
13 | constructor(context: Context?) : super(context)
14 | constructor(context: Context?,attrs:AttributeSet):super(context,attrs)
15 | constructor(context: Context?,attrs: AttributeSet,defStyleAttrs:Int):super(context,attrs,defStyleAttrs)
16 | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
17 | constructor(context: Context?,attrs: AttributeSet,defStyleAttrs:Int,defStyleRes:Int):super(context,attrs,defStyleAttrs,defStyleRes)
18 |
19 | fun bindTo(title:String){bindTo(title," ")}
20 |
21 | fun bindTo(title: String, subtitle: String){
22 | hideOrSetText(header_view_title,title)
23 | hideOrSetText(header_view_sub_title,subtitle)
24 | }
25 |
26 | private fun hideOrSetText(tv: TextView, text: String?) {
27 | if (text == null || text == "") {
28 | tv.visibility = View.GONE
29 | } else {
30 | tv.text = text
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/utils/ProgressBarHandler.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.utils
2 |
3 | import android.R.attr
4 | import android.R.id
5 | import android.app.Activity
6 | import android.content.Context
7 | import android.view.Gravity
8 | import android.view.View
9 | import android.view.ViewGroup
10 | import android.widget.ProgressBar
11 | import android.widget.RelativeLayout
12 | import android.widget.RelativeLayout.LayoutParams
13 |
14 |
15 | /**
16 | * @author Rajan Maurya
17 | */
18 | class ProgressBarHandler constructor(context: Context) {
19 |
20 | private val progressBar: ProgressBar
21 |
22 | init {
23 |
24 | val layout = (context as Activity).findViewById(id.content).rootView as ViewGroup
25 |
26 | progressBar = ProgressBar(context, null, attr.progressBarStyleInverse)
27 | progressBar.isIndeterminate = true
28 |
29 | val params = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
30 |
31 | val relativeLayout = RelativeLayout(context)
32 |
33 | relativeLayout.gravity = Gravity.CENTER
34 | relativeLayout.addView(progressBar)
35 |
36 | layout.addView(relativeLayout, params)
37 |
38 | hide()
39 | }
40 |
41 | fun show() {
42 | progressBar.visibility = View.VISIBLE
43 | }
44 |
45 | fun hide() {
46 | progressBar.visibility = View.INVISIBLE
47 | }
48 | }
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_account.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/resources/customer.json:
--------------------------------------------------------------------------------
1 | {
2 | "identifier": "identifier",
3 | "type": "type",
4 | "givenName": "givenName",
5 | "middleName": "middleName",
6 | "surname": "surname",
7 | "dateOfBirth": {
8 | "year": 1985,
9 | "month": 11,
10 | "day": 27
11 | },
12 | "member": false,
13 | "accountBeneficiary": "accountBeneficiary",
14 | "referenceCustomer": "referenceCustomer",
15 | "assignedOffice": "assignedOffice",
16 | "assignedEmployee": "assignedEmployee",
17 | "address": {
18 | "street": "street",
19 | "city": "city",
20 | "region": "region",
21 | "postalCode": "postalCode",
22 | "countryCode": "countryCode",
23 | "country": "country"
24 | },
25 | "contactDetails": [
26 | {
27 | "type": "EMAIL",
28 | "group": "BUSINESS",
29 | "value": "email",
30 | "preferenceLevel": 1,
31 | "validated": false
32 | },
33 | {
34 | "type": "PHONE",
35 | "group": "BUSINESS",
36 | "value": "phone",
37 | "preferenceLevel": 1,
38 | "validated": false
39 | },
40 | {
41 | "type": "MOBILE",
42 | "group": "BUSINESS",
43 | "value": "mobile",
44 | "preferenceLevel": 1,
45 | "validated": false
46 | }
47 | ],
48 | "currentState": "ACTIVE",
49 | "createdBy": "createdBy",
50 | "createdOn": "createdOn",
51 | "lastModifiedBy": "lastModifiedBy",
52 | "lastModifiedOn": "lastModifiedOn"
53 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/remote/MifosInterceptor.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.remote
2 |
3 | import android.content.Context
4 | import androidx.annotation.NonNull
5 | import android.text.TextUtils
6 | import okhttp3.Interceptor
7 | import okhttp3.Response
8 | import org.mifos.mobile.cn.MifosApplication
9 | import org.mifos.mobile.cn.data.local.PreferencesHelper
10 | import org.mifos.mobile.cn.injection.ApplicationContext
11 | import java.io.IOException
12 | import javax.inject.Inject
13 |
14 | class MifosInterceptor @Inject constructor(@ApplicationContext context: Context) : Interceptor {
15 |
16 | @Inject
17 | lateinit var preferencesHelper: PreferencesHelper
18 |
19 | init {
20 | MifosApplication.get(context).getComponent().inject(this)
21 | }
22 |
23 | companion object {
24 | val HEADER_ACCESS_TOKEN = "access_token"
25 | }
26 |
27 | @Throws(IOException::class)
28 | override fun intercept(@NonNull chain: Interceptor.Chain): Response {
29 | val chainRequest = chain.request()
30 | val builder = chainRequest.newBuilder()
31 |
32 | val accessToken = preferencesHelper.accessToken
33 |
34 | if (!TextUtils.isEmpty(accessToken)) {
35 | builder.header(HEADER_ACCESS_TOKEN, preferencesHelper.accessToken)
36 | }
37 |
38 | val request = builder.build()
39 | return chain.proceed(request)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/utils/RxEvent.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.utils
2 |
3 | import org.mifos.mobile.cn.data.models.CheckboxStatus
4 | import org.mifos.mobile.cn.data.models.accounts.loan.*
5 |
6 | /**
7 | * @author Manish Kumar
8 | * @since 25/July/2018
9 | */
10 | class RxEvent {
11 |
12 | //Bottom sheet event (Loan Details)
13 | data class AddDebt(val creditWorthinessFactor: CreditWorthinessFactor)
14 |
15 | data class EditDebt(val creditWorthinessFactor: CreditWorthinessFactor, val position: Int)
16 | data class AddIncome(val creditWorthinessFactor: CreditWorthinessFactor)
17 | data class EditIncome(val creditWorthinessFactor: CreditWorthinessFactor, val position: Int)
18 |
19 |
20 | //Navigation event (Loan Details)
21 | data class SetLoanDetails(var currentState: LoanAccount.State, var identifier: String,
22 | var productIdentifier: String, var maximumBalance: Double,
23 | var paymentCycle: PaymentCycle, var termRange: TermRange)
24 |
25 | data class SetDebtIncome(val debtIncome: CreditWorthinessSnapshot)
26 | data class SetCoSignerDebtIncome(val coSignerDebtIncome: CreditWorthinessSnapshot)
27 |
28 |
29 | //Filter accounts events (Accounts Filter)
30 | data class GetCurrentFilterList(val checkboxStatus: List)
31 | data class SetStatusModelList(val statusModelList: List)
32 |
33 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/launcher/LauncherActivity.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.launcher
2 |
3 | import android.content.Intent
4 | import android.os.Bundle
5 | import org.mifos.mobile.cn.data.local.PreferencesHelper
6 | import org.mifos.mobile.cn.ui.base.MifosBaseActivity
7 | import org.mifos.mobile.cn.ui.mifos.login.LoginActivity
8 | import org.mifos.mobile.cn.ui.mifos.passcode.PasscodeActivity
9 | import org.mifos.mobile.cn.ui.utils.ConstantKeys
10 | import javax.inject.Inject
11 |
12 | /**
13 | * @author Manish Kumar
14 | * On 31/05/18.
15 | */
16 |
17 | class LauncherActivity : MifosBaseActivity() {
18 |
19 | @Inject
20 | internal lateinit var preferencesHelper: PreferencesHelper
21 |
22 | override fun onCreate(savedInstanceState: Bundle?) {
23 | super.onCreate(savedInstanceState)
24 | activityComponent.inject(this)
25 | //route to different page
26 | if (preferencesHelper.loginStatus) {
27 | startActivity(PasscodeActivity::class.java)
28 | } else {
29 | startActivity(LoginActivity::class.java)
30 | }
31 | }
32 |
33 | private fun startActivity(aClass: Class<*>) {
34 | val intent = Intent(this, aClass)
35 | if(aClass.equals(PasscodeActivity::class.java)) {
36 | intent.putExtra(ConstantKeys.INITIAL_LOGIN, true)
37 | }
38 | startActivity(intent)
39 | finish()
40 | }
41 |
42 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_view_scan_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
22 |
23 |
24 |
25 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/DataManagerLoanDetails.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data
2 |
3 | import androidx.lifecycle.LiveData
4 | import io.reactivex.Observable
5 | import io.reactivex.ObservableSource
6 | import io.reactivex.functions.Function
7 | import org.mifos.mobile.cn.data.datamanager.DataManagerAuth
8 | import org.mifos.mobile.cn.data.datamanager.MifosBaseDataManager
9 | import org.mifos.mobile.cn.data.local.PreferencesHelper
10 | import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount
11 | import org.mifos.mobile.cn.data.remote.BaseApiManager
12 | import org.mifos.mobile.cn.fakesource.FakeRemoteDataSource
13 | import javax.inject.Inject
14 | import javax.inject.Singleton
15 |
16 | @Singleton
17 | class DataManagerLoanDetails @Inject constructor(private var baseApiManager: BaseApiManager, preferencesHelper: PreferencesHelper, dataManagerAuth: DataManagerAuth):
18 | MifosBaseDataManager(dataManagerAuth,preferencesHelper){
19 |
20 | fun fetchCustomerLoanDetails(
21 | productIdentifier: String, caseIdentifier: String): Observable{
22 | return authenticatedObservableApi(baseApiManager.getLoanApi()
23 | .fetchCustomerLoanDetails(productIdentifier, caseIdentifier))
24 | .onErrorResumeNext(
25 | Function> { Observable.just(FakeRemoteDataSource.getLoanAccountsJson()[0])})
26 | }
27 | }
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/action_bar_notification_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
18 |
19 |
32 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/injection/component/ApplicationComponent.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.injection.component
2 |
3 | import android.app.Application
4 | import android.content.Context
5 | import dagger.Component
6 | import org.mifos.mobile.cn.MifosApplication
7 | import org.mifos.mobile.cn.data.DataManagerLoanDetails
8 | import org.mifos.mobile.cn.data.databasehelper.DataBaseHelperLoan
9 | import org.mifos.mobile.cn.data.datamanager.*
10 | import org.mifos.mobile.cn.data.local.PreferencesHelper
11 | import org.mifos.mobile.cn.data.remote.MifosInterceptor
12 | import org.mifos.mobile.cn.injection.ApplicationContext
13 | import org.mifos.mobile.cn.injection.module.ApplicationModule
14 | import javax.inject.Singleton
15 |
16 | @Singleton
17 | @Component(modules = [ApplicationModule::class])
18 | interface ApplicationComponent {
19 |
20 | @ApplicationContext
21 | fun context(): Context
22 |
23 | fun application(): Application
24 | fun preferencesHelper(): PreferencesHelper
25 |
26 | fun dataManagerAuth(): DataManagerAuth
27 | fun dataManagerLoan(): DataManagerLoan
28 | fun databaseHelperLoan(): DataBaseHelperLoan
29 | fun dataManagerCustomer(): DataManagerCustomer
30 | fun dataManagerLoanDetails(): DataManagerLoanDetails
31 | fun dataManagerIndividualLending():DataManagerIndividualLending
32 | fun dataManagerDepositDetails():DataManagerDepositDetails
33 |
34 |
35 | fun inject(fineractInterceptor: MifosInterceptor)
36 | fun inject(fineractApplication: MifosApplication)
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_loan_application.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
10 |
11 |
12 |
13 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingsFragment.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.settings
2 |
3 | import android.content.Context
4 | import android.net.Uri
5 | import android.os.Bundle
6 | import androidx.fragment.app.Fragment
7 | import android.view.LayoutInflater
8 | import android.view.View
9 | import android.view.ViewGroup
10 | import org.mifos.mobile.cn.R
11 |
12 | // TODO: Rename parameter arguments, choose names that match
13 | // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
14 | private const val ARG_PARAM1 = "param1"
15 | private const val ARG_PARAM2 = "param2"
16 |
17 | /**
18 | * A simple [Fragment] subclass.
19 | * Activities that contain this fragment must implement the
20 | * [SettingsFragment.OnFragmentInteractionListener] interface
21 | * to handle interaction events.
22 | * Use the [SettingsFragment.newInstance] factory method to
23 | * create an instance of this fragment.
24 | */
25 | class SettingsFragment : Fragment() {
26 |
27 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
28 | savedInstanceState: Bundle?): View? {
29 | // Inflate the layout for this fragment
30 | return inflater.inflate(R.layout.fragment_settings, container, false)
31 | }
32 |
33 | companion object {
34 | fun newInstance(): SettingsFragment {
35 | val fragment = SettingsFragment()
36 | val args = Bundle()
37 | fragment.arguments = args
38 | return fragment
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_accounts.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
19 |
20 |
28 |
29 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/datamanager/DataManagerIndividualLending.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.datamanager
2 |
3 | import androidx.lifecycle.LiveData
4 | import io.reactivex.Observable
5 | import io.reactivex.ObservableSource
6 | import io.reactivex.functions.Function
7 | import org.mifos.mobile.cn.data.local.PreferencesHelper
8 | import org.mifos.mobile.cn.data.models.payment.PlannedPaymentPage
9 | import org.mifos.mobile.cn.data.remote.BaseApiManager
10 | import org.mifos.mobile.cn.fakesource.FakeRemoteDataSource
11 | import javax.inject.Inject
12 | import javax.inject.Singleton
13 |
14 | @Singleton
15 | class DataManagerIndividualLending @Inject constructor(private var baseApiManager: BaseApiManager, preferencesHelper: PreferencesHelper, dataManagerAuth:DataManagerAuth):
16 | MifosBaseDataManager(dataManagerAuth,preferencesHelper) {
17 |
18 | fun getPaymentScheduleForCase(productIdentifier: String,
19 | caseIdentifier: String, pageIndex: Int?, size: Int?, initialDisbursalDate: String): Observable {
20 | return authenticatedObservableApi(baseApiManager
21 | .getIndividualLendingService().getPaymentScheduleForCase(
22 | productIdentifier, caseIdentifier, pageIndex, size, initialDisbursalDate))
23 | .onErrorResumeNext(
24 | Function> {
25 | Observable.just(
26 | FakeRemoteDataSource.getPlannedPaymentPage().value)
27 | })
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/app/src/commonTest/kotlin/org/mifos/mobile/cn/TestDataFactory.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn
2 |
3 | import com.google.gson.Gson
4 | import com.google.gson.reflect.TypeToken
5 | import com.google.gson.stream.JsonReader
6 | import java.io.InputStreamReader
7 |
8 | class TestDataFactory {
9 |
10 | /**
11 | * Note : This Generic Method DeSerialize Both Object and List Type Json in POJO
12 | *
13 | *
14 | * Note : Do Not use Array [] in POJO classes for of any element initialization,
15 | * Use Instead ArrayList.
16 | *
17 | * @param listModel Class of the List Model
18 | * @param jsonName Name of the Json in resources
19 | * @param return type
20 | * @return Return the List of the listModel by Deserializing the Json of resources
21 | * @Example of Deserializing List Type Json
22 | *
23 | *
24 | * TestDataFactory mTestDataFactory = new TestDataFactory();
25 | *
26 | *
27 | * List */
35 | fun convertJsonToDataObject(listModel: TypeToken, jsonName: String): T {
36 | val inputStream = javaClass.classLoader.getResourceAsStream(jsonName)
37 | val jsonReader = JsonReader(InputStreamReader(inputStream))
38 | return Gson().fromJson(jsonReader, listModel.type)
39 | }
40 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/services/LoanService.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.services
2 |
3 | import io.reactivex.Completable
4 | import io.reactivex.Observable
5 | import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount
6 | import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccountPage
7 | import org.mifos.mobile.cn.data.models.product.ProductPage
8 | import org.mifos.mobile.cn.data.remote.EndPoints
9 | import retrofit2.http.*
10 |
11 | interface LoanService {
12 | @GET(EndPoints.API_PORTFOLIO_PATH + "/individuallending/customers/{customeridentifier}/cases")
13 | fun fetchCustomerLoanAccounts(
14 | @Path("customeridentifier") customerIdentifier: String,
15 | @Query("pageIndex") pageIndex: Int?,
16 | @Query("size") size: Int?): Observable
17 |
18 | @GET(EndPoints.API_PORTFOLIO_PATH + "/products/{productidentifier}/cases/{caseidentifier}")
19 | fun fetchCustomerLoanDetails(
20 | @Path("productidentifier") productIdentifier: String,
21 | @Path("caseidentifier") caseIdentifier: String): Observable
22 |
23 | @GET(EndPoints.API_PORTFOLIO_PATH + "/products/")
24 | fun getProducts(
25 | @Query("pageIndex") pageIndex: Int?,
26 | @Query("size") size: Int?,
27 | @Query("includeDisabled") includeDisabled: Boolean?): Observable
28 |
29 | @POST(EndPoints.API_PORTFOLIO_PATH + "/products/{productidentifier}/cases/")
30 | fun createLoan(
31 | @Path("productidentifier") productidentifier: String,
32 | @Body loanAccount: LoanAccount): Completable
33 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_debt_income_report.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
22 |
23 |
27 |
28 |
29 |
30 |
35 |
36 |
--------------------------------------------------------------------------------
/COMMIT_STYLE.md:
--------------------------------------------------------------------------------
1 | # Git Commit Message Style Guide
2 |
3 | ## Commit Messages
4 |
5 | ### Message Structure
6 | A commit messages consists of three distinct parts separated by a blank line: the title, an optional body and an optional footer. The layout looks like this:
7 |
8 | type: subject
9 |
10 | body
11 |
12 | footer
13 |
14 | ***
15 |
16 | The title consists of the type of the message and subject.
17 |
18 | ### The Type
19 | The type is contained within the title and can be one of these types:
20 |
21 | * **feat:** a new feature
22 | * **fix:** a bug fix
23 | * **docs:** changes to documentation
24 | * **style:** formatting, missing semi colons, etc; no code change
25 | * **refactor:** refactoring production code
26 | * **test:** adding tests, refactoring test; no production code change
27 | * **chore:** updating build tasks, package manager configs, etc; no production code change
28 |
29 | ### The Subject
30 | Subjects should be no greater than 50 characters, should begin with a capital letter and do not end with a period.
31 |
32 | Use an imperative tone to describe what a commit does, rather than what it did. For example, use change; not changed or changes.
33 |
34 | ### The Body
35 | Not all commits are complex enough to warrant a body, therefore it is optional and only used when a commit requires a bit of explanation and context. Use the body to explain the what and why of a commit, not the how.
36 |
37 | When writing a body, the blank line between the title and the body is required and you should limit the length of each line to no more than 72 characters.
38 |
39 | ### The Footer
40 | The footer is optional and is used to reference issue tracker IDs.
41 |
42 | ***
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/product/Product.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.product
2 |
3 | import com.google.gson.annotations.SerializedName
4 | import org.mifos.mobile.cn.data.models.accounts.loan.AccountAssignment
5 | import org.mifos.mobile.cn.data.models.accounts.loan.TermRange
6 | import java.util.ArrayList
7 |
8 |
9 | data class Product (
10 | @SerializedName("identifier") var identifier: String? = null,
11 | @SerializedName("name") var name: String? = null,
12 | @SerializedName("termRange") var termRange: TermRange? = null,
13 | @SerializedName("balanceRange") var balanceRange: BalanceRange? = null,
14 | @SerializedName("interestRange") var interestRange: InterestRange? = null,
15 | @SerializedName("interestBasis") var interestBasis: InterestBasis? = null,
16 | @SerializedName("patternPackage") var patternPackage: String? = null,
17 | @SerializedName("description") var description: String? = null,
18 | @SerializedName("currencyCode") var currencyCode: String? = null,
19 | @SerializedName("minorCurrencyUnitDigits") var minorCurrencyUnitDigits: Int = 0,
20 | @SerializedName("accountAssignments") var accountAssignments: List =
21 | ArrayList(),
22 | @SerializedName("parameters") var parameters: String? = null,
23 | @SerializedName("createdOn") var createdOn: String? = null,
24 | @SerializedName("createdBy") var createdBy: String? = null,
25 | @SerializedName("lastModifiedOn") var lastModifiedOn: String? = null,
26 | @SerializedName("lastModifiedBy") var lastModifiedBy: String? = null
27 | )
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/base/BasePresenter.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.base
2 |
3 | import android.content.Context
4 | import android.util.Log
5 | import android.widget.Toast
6 | import org.mifos.mobile.cn.exceptions.NoConnectivityException
7 |
8 | /**
9 | * Base class that implements the CasePresenter interface and provides a base implementation for
10 | * attachView() and detachView(). It also handles keeping a reference to the mvpView that
11 | * can be accessed from the children classes by calling getMvpView().
12 | */
13 | open class BasePresenter constructor(var context: Context) : Presenter {
14 |
15 | private var mvpView: T? = null
16 | val getMvpView: T
17 | get() { return mvpView ?: throw MvpViewNotAttachedException() }
18 |
19 | fun isViewAttached(): Boolean {
20 | return mvpView != null
21 | }
22 |
23 | override fun attachView(mvpView: T) {
24 | this.mvpView = mvpView
25 | }
26 |
27 | override fun detachView() {
28 | mvpView = null
29 | }
30 |
31 | fun checkViewAttached() {
32 | if (!isViewAttached()) throw MvpViewNotAttachedException()
33 | }
34 |
35 | fun showExceptionError(throwable: Throwable, errorMessage: String) {
36 | if (throwable is NoConnectivityException) {
37 | Toast.makeText(context,"No Internet Connectivity",Toast.LENGTH_SHORT).show()
38 | } else {
39 | Log.e("Error in Presenter",errorMessage,throwable)
40 | }
41 | }
42 |
43 | class MvpViewNotAttachedException : RuntimeException(
44 | "Please call Presenter.attachView(MvpView) before requesting data to the Presenter")
45 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/utils/ConstantKeys.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.utils
2 |
3 | /**
4 | * @author Rajan Maurya
5 | * On 18/05/18.
6 | */
7 | object ConstantKeys {
8 |
9 | const val ACCOUNT_IDENTIFIER = "account_identifier"
10 | const val REQUEST_PERMISSION_SETTING = 254
11 | const val PERMISSION_REQUEST_ALL = 4
12 | const val PERMISSION_REQUEST_CAMERA = 5
13 |
14 | const val PERMISSIONS_WRITE_EXTERNAL_STORAGE_STATUS = "write_status"
15 | const val PERMISSION_READ_EXTERNAL_STORAGE_STATUS = "read_status"
16 | const val PERMISSIONS_CAMERA_STATUS = "camera_status"
17 | const val INITIAL_LOGIN = "initial_login"
18 | const val CUSTOMER_IDENTIFIER = "customer_identifier"
19 | const val CURRENT_STEP_POSITION = "position"
20 | const val PRODUCTS = "products"
21 | const val TERM_UNIT_TYPE = "term_unit_type"
22 | const val ACCOUNT_TYPE = "accountType"
23 | const val LOAN_ACCOUNTS = "loanAccounts"
24 | const val DEPOSIT_ACCOUNTS = "deposit_accounts"
25 | const val IDENTIFICATION_CARD = "identification_card"
26 | const val PRODUCT_IDENTIFIER = "product_identifier"
27 | const val CASE_IDENTIFIER = "case_identifier"
28 | const val LOAN_CREDITWORTHINESSSNAPSHOTS = "loan_creditWorthinessSnapshots"
29 |
30 |
31 | const val CUSTOMER_STATUS = "customer_status"
32 | const val CUSTOMER = "customer"
33 | const val IDENTIFICATION_SCAN_CARD = "identification_scan_card"
34 | const val IDENTIFICATION_NUMBER = "identification_number"
35 | const val POSITION = "position"
36 |
37 | const val PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 2
38 | const val PERMISSIONS_REQUEST_CAMERA = 1;
39 |
40 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/customer/ContactDetail.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.customer
2 |
3 | import android.os.Parcelable
4 |
5 | import com.google.gson.annotations.SerializedName
6 | import com.raizlabs.android.dbflow.annotation.ConflictAction
7 | import com.raizlabs.android.dbflow.annotation.ForeignKey
8 | import com.raizlabs.android.dbflow.annotation.PrimaryKey
9 | import com.raizlabs.android.dbflow.annotation.Table
10 | import com.raizlabs.android.dbflow.structure.BaseModel
11 | import kotlinx.android.parcel.Parcelize
12 | import org.mifos.mobile.cn.local.MifosCnDatabase
13 |
14 | @Parcelize
15 | @Table(name = "ContactDetail", database = MifosCnDatabase::class, allFields = true, insertConflict =
16 | ConflictAction.REPLACE, useBooleanGetterSetters = false)
17 | data class ContactDetail(
18 | @SerializedName("type") var type: Type? = null,
19 | @SerializedName("value") var value: String? = null,
20 | @SerializedName("preferenceLevel") var preferenceLevel: Int? = null,
21 | @SerializedName("validated") var validated: Boolean? = null,
22 | @SerializedName("group") var group: Group? = null
23 | ) : BaseModel(), Parcelable {
24 |
25 | @PrimaryKey
26 | @ForeignKey(stubbedRelationship = true) var customer: Customer? = null
27 |
28 | enum class Type {
29 | @SerializedName("EMAIL")
30 | EMAIL,
31 |
32 | @SerializedName("PHONE")
33 | PHONE,
34 |
35 | @SerializedName("MOBILE")
36 | MOBILE
37 | }
38 |
39 | enum class Group {
40 |
41 | @SerializedName("BUSINESS")
42 | BUSINESS,
43 |
44 | @SerializedName("PRIVATE")
45 | PRIVATE
46 | }
47 |
48 | }
--------------------------------------------------------------------------------
/app/src/main/resources/loanAccount.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "identifier": "identifier",
4 | "productIdentifier": "productIdentifier",
5 | "parameters": "{\"customerIdentifier\":\"customerIdentifier\",\"maximumBalance\": 343.45,\"termRange\": {\"temporalUnit\": \"WEEKS\", \"maximum\": 45.45 }, \"paymentCycle\": {\"temporalUnit\": \"WEEKS\",\"period\": 1,\"alignmentDay\": 1,\"alignmentWeek\": 1,\"alignmentMonth\": 1},\"creditWorthinessSnapshots\":[{\"forCustomer\":\"forCustomer\"}]}",
6 | "accountAssignments": [
7 | {
8 | "designator": "designator",
9 | "accountIdentifier": "accountIdentifier",
10 | "ledgerIdentifier": "ledgerIdentifier"
11 | }
12 | ],
13 | "currentState": "CREATED",
14 | "createdOn": "createdOn",
15 | "createdBy": "createdBy",
16 | "lastModifiedOn": "lastModifiedOn",
17 | "lastModifiedBy": "lastModifiedBy"
18 | },
19 | {
20 | "identifier": "identifier",
21 | "productIdentifier": "productIdentifier",
22 | "parameters": "{\"customerIdentifier\":\"customerIdentifier\",\"maximumBalance\": 343.45,\"termRange\": {\"temporalUnit\": \"WEEKS\", \"maximum\": 45.45 }, \"paymentCycle\": {\"temporalUnit\": \"WEEKS\",\"period\": 1,\"alignmentDay\": 1,\"alignmentWeek\": 1,\"alignmentMonth\": 1},\"creditWorthinessSnapshots\":[{\"forCustomer\":\"forCustomer\"}]}",
23 | "accountAssignments": [
24 | {
25 | "designator": "designator",
26 | "accountIdentifier": "accountIdentifier",
27 | "ledgerIdentifier": "ledgerIdentifier"
28 | }
29 | ],
30 | "currentState": "CREATED",
31 | "createdOn": "createdOn",
32 | "createdBy": "createdBy",
33 | "lastModifiedOn": "lastModifiedOn",
34 | "lastModifiedBy": "lastModifiedBy"
35 | }
36 | ]
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/adapter/DebtIncomeReportAdapter.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.adapter
2 |
3 | import android.view.LayoutInflater
4 | import android.view.View
5 | import android.view.ViewGroup
6 | import androidx.recyclerview.widget.RecyclerView
7 | import kotlinx.android.synthetic.main.item_debt_income_report.view.*
8 | import org.mifos.mobile.cn.R
9 | import org.mifos.mobile.cn.data.models.accounts.loan.CreditWorthinessFactor
10 | import java.util.ArrayList
11 | import javax.inject.Inject
12 |
13 | class DebtIncomeReportAdapter @Inject constructor() : RecyclerView.Adapter() {
14 |
15 | private var creditWorthinessFactors: List = ArrayList()
16 |
17 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DebtIncomeReportAdapter.ViewHolder {
18 | val view: View = LayoutInflater.from(parent.context).inflate(R.layout.item_debt_income_report,parent,false)
19 | return ViewHolder(view);
20 | }
21 |
22 | override fun getItemCount(): Int {
23 | return creditWorthinessFactors.size
24 | }
25 |
26 | fun setCreditWorthinessFactors(creditWorthinessFactors: List) {
27 | this.creditWorthinessFactors = creditWorthinessFactors
28 | }
29 | override fun onBindViewHolder(holder: ViewHolder, position: Int) {
30 | val creditWorthinessFactor = creditWorthinessFactors[position]
31 | holder.tvAmount.text =creditWorthinessFactor.amount.toString()
32 | holder.tvDescription.text = creditWorthinessFactor.description
33 | }
34 |
35 |
36 | class ViewHolder constructor(v:View): RecyclerView.ViewHolder(v){
37 | var tvAmount = v.tv_amount
38 | var tvDescription = v.tv_description
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_client_accounts.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
11 |
12 |
19 |
20 |
21 |
26 |
27 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/bottom_sheet_filter_accounts.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
17 |
18 |
25 |
30 |
31 |
32 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/resources/loanAccounts.json:
--------------------------------------------------------------------------------
1 | {
2 | "identifier": "identifier",
3 | "productIdentifier": "productIdentifier",
4 | "parameters": "{\"customerIdentifier\":\"customerIdentifier\",\"maximumBalance\": 343.45,\"termRange\": {\"temporalUnit\": \"WEEKS\", \"maximum\": 45.45 }, \"paymentCycle\": {\"temporalUnit\": \"WEEKS\",\"period\": 1,\"alignmentDay\": 1,\"alignmentWeek\": 1,\"alignmentMonth\": 1},\"creditWorthinessSnapshots\":[{\"forCustomer\":\"forCustomer\"}]}",
5 | "accountAssignments": [
6 | {
7 | "designator": "designator",
8 | "accountIdentifier": "accountIdentifier",
9 | "ledgerIdentifier": "ledgerIdentifier"
10 | }
11 | ],
12 | "currentState": "CREATED",
13 | "createdOn": "createdOn",
14 | "createdBy": "createdBy",
15 | "lastModifiedOn": "lastModifiedOn",
16 | "lastModifiedBy": "lastModifiedBy",
17 | "loanParameters": {
18 | "customerIdentifier": "customerIdentifier",
19 | "creditWorthinessSnapshots": [
20 | {
21 | "forCustomer": "forCustomer",
22 | "incomeSources": [
23 | {
24 | "description": "description",
25 | "amount": 45.45
26 | }
27 | ],
28 | "assets": [
29 | {
30 | "description": "description",
31 | "amount": 45.45
32 | }
33 | ],
34 | "debts": [
35 | {
36 | "description": "description",
37 | "amount": 45.45
38 | }
39 | ]
40 | }
41 | ],
42 | "maximumBalance": 4500.50,
43 | "termRange": {
44 | "temporalUnit": "WEEKS",
45 | "maximum": 45
46 | },
47 | "paymentCycle": {
48 | "temporalUnit": "WEEKS",
49 | "period": 1,
50 | "alignmentDay": 1,
51 | "alignmentWeek": 1,
52 | "alignmentMonth": 1
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/nav_drawer_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
22 |
23 |
34 |
35 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/models/accounts/loan/LoanAccount.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.models.accounts.loan
2 |
3 | import com.google.gson.Gson
4 | import com.google.gson.annotations.SerializedName
5 | import java.util.ArrayList
6 |
7 | data class LoanAccount(
8 | @SerializedName("identifier") var identifier: String? = null,
9 | @SerializedName("productIdentifier") var productIdentifier: String? = null,
10 | @SerializedName("parameters") var parameters: String? = null,
11 | @SerializedName("accountAssignments") var accountAssignments: List =
12 | ArrayList(),
13 | @SerializedName("currentState") var currentState: State? = null,
14 | @SerializedName("createdOn") var createdOn: String? = null,
15 | @SerializedName("createdBy") var createdBy: String? = null,
16 | @SerializedName("lastModifiedOn") var lastModifiedOn: String? = null,
17 | @SerializedName("lastModifiedBy") var lastModifiedBy: String? = null
18 | ) {
19 |
20 | private val loanParameters: LoanParameters? = null
21 |
22 | enum class State {
23 |
24 | @SerializedName("CREATED")
25 | CREATED,
26 |
27 | @SerializedName("PENDING")
28 | PENDING,
29 |
30 | @SerializedName("APPROVED")
31 | APPROVED,
32 |
33 | @SerializedName("ACTIVE")
34 | ACTIVE,
35 |
36 | @SerializedName("CLOSED")
37 | CLOSED
38 | }
39 |
40 | enum class RepayUnitType {
41 |
42 | @SerializedName("WEEKS")
43 | WEEKS,
44 |
45 | @SerializedName("MONTHS")
46 | MONTHS,
47 |
48 | @SerializedName("YEARS")
49 | YEARS
50 | }
51 |
52 | fun getLoanParameters(): LoanParameters {
53 | return Gson().fromJson(parameters, LoanParameters::class.java)
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/loanApplication/loancosigner/LoanCosignerFragment.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.loanApplication.loancosigner
2 |
3 | import android.content.Context
4 | import android.os.Bundle
5 | import com.stepstone.stepper.Step
6 | import com.stepstone.stepper.VerificationError
7 | import org.mifos.mobile.cn.R
8 | import org.mifos.mobile.cn.ui.mifos.loanApplication.BaseFragmentDebtIncome
9 | import org.mifos.mobile.cn.ui.mifos.loanApplication.OnNavigationBarListener
10 | import org.mifos.mobile.cn.ui.utils.RxBus
11 | import org.mifos.mobile.cn.ui.utils.RxEvent
12 |
13 | class LoanCosignerFragment : BaseFragmentDebtIncome(), Step {
14 |
15 | private var onNavigationBarListener :OnNavigationBarListener.LoanCoSignerData? = null
16 |
17 | companion object {
18 | fun newInstance(): LoanCosignerFragment {
19 | val fragment = LoanCosignerFragment()
20 | val args = Bundle()
21 | fragment.arguments = args
22 | return fragment
23 | }
24 | }
25 |
26 | override val fragmentLayout: Int
27 | get() = R.layout.fragment_loan_co_signer
28 |
29 |
30 | override fun onSelected() {
31 |
32 | }
33 |
34 | override fun verifyStep(): VerificationError? {
35 | RxBus.publish(RxEvent.SetCoSignerDebtIncome(creditWorthinessSnapshot))
36 | onNavigationBarListener!!.setCoSignerDebtIncome(creditWorthinessSnapshot)
37 | return null
38 | }
39 |
40 | override fun onError(error: VerificationError) {
41 |
42 | }
43 |
44 | override fun onAttach(context: Context?) {
45 | super.onAttach(context)
46 | if(context is OnNavigationBarListener.LoanCoSignerData){onNavigationBarListener = context}
47 | else throw RuntimeException("$context must implement OnNavigationBarListener.LoanCoSignerData")
48 | }
49 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/loanApplication/LoanDebtIncome/LoanDebtIncomeFragment.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.loanApplication.LoanDebtIncome
2 |
3 | import android.content.Context
4 | import android.os.Bundle
5 | import com.stepstone.stepper.Step
6 | import com.stepstone.stepper.VerificationError
7 | import org.mifos.mobile.cn.R
8 | import org.mifos.mobile.cn.ui.mifos.loanApplication.BaseFragmentDebtIncome
9 | import org.mifos.mobile.cn.ui.mifos.loanApplication.OnNavigationBarListener
10 | import org.mifos.mobile.cn.ui.utils.RxBus
11 | import org.mifos.mobile.cn.ui.utils.RxEvent
12 |
13 | class LoanDebtIncomeFragment : BaseFragmentDebtIncome(), Step {
14 |
15 | private var onNavigationBarListner: OnNavigationBarListener.LoanDebtIncomeData? = null
16 |
17 | companion object {
18 | fun newInstance():LoanDebtIncomeFragment {
19 | val fragment = LoanDebtIncomeFragment()
20 | val args = Bundle()
21 | fragment.arguments = args
22 | return fragment
23 | }
24 | }
25 |
26 | override val fragmentLayout: Int
27 | get() = R.layout.fragment_loan_debt_income_ratio
28 |
29 | override fun onSelected() {
30 |
31 |
32 | }
33 |
34 | override fun verifyStep(): VerificationError? {
35 | RxBus.publish(RxEvent.SetDebtIncome(creditWorthinessSnapshot))
36 | onNavigationBarListner!!.setDebtIncome(creditWorthinessSnapshot)
37 | return null
38 |
39 | }
40 |
41 | override fun onError(error: VerificationError) {
42 |
43 | }
44 |
45 | override fun onAttach(context: Context?) {
46 | super.onAttach(context)
47 | if (context is OnNavigationBarListener.LoanDebtIncomeData){
48 | onNavigationBarListner = context
49 | } else throw RuntimeException("$context must implement OnNavigationBarListener.DebtIncome")
50 | }
51 | }
--------------------------------------------------------------------------------
/config/quality/pmd/pmd-ruleset.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Custom ruleset for Mifos-Mobile-CN Android application
8 |
9 | .*/R.java
10 | .*/gen/.*
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/loanApplication/loanActivity/LoanApplicationPresenter.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.mifos.loanApplication.loanActivity
2 |
3 | import android.content.Context
4 | import io.reactivex.android.schedulers.AndroidSchedulers
5 | import io.reactivex.disposables.CompositeDisposable
6 | import io.reactivex.observers.DisposableObserver
7 | import io.reactivex.schedulers.Schedulers
8 | import org.mifos.mobile.cn.data.datamanager.DataManagerLoan
9 | import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount
10 | import org.mifos.mobile.cn.injection.ApplicationContext
11 | import org.mifos.mobile.cn.ui.base.BasePresenter
12 | import javax.inject.Inject
13 |
14 |
15 | /**
16 | * @author Manish Kumar
17 | * @since 01/August/2018
18 | */
19 | class LoanApplicationPresenter
20 | @Inject constructor(@ApplicationContext context: Context, var dataManagerLoan: DataManagerLoan)
21 | : BasePresenter(context), LoanApplicationContract.Presenter {
22 |
23 | val compositeDisposable: CompositeDisposable
24 | init {
25 | compositeDisposable = CompositeDisposable()
26 | }
27 |
28 | override fun createLoan(loanAccount: LoanAccount) {
29 | isViewAttached()
30 | compositeDisposable.add(dataManagerLoan.saveLoanResponse(loanAccount)
31 | .subscribeOn(Schedulers.io())
32 | .observeOn(AndroidSchedulers.mainThread())
33 | .subscribeWith(object : DisposableObserver() {
34 | override fun onNext(t: LoanAccount) {
35 |
36 | }
37 | override fun onError(e: Throwable) {
38 | getMvpView.showError(e.localizedMessage)
39 | }
40 | override fun onComplete() {
41 | getMvpView.applicationCreatedSuccessfully()
42 | }
43 | })
44 | )
45 | }
46 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_privacy_policy.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
12 |
13 |
15 |
16 |
17 |
18 |
21 |
22 |
33 |
34 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/app/src/main/resources/products.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "createdOn": "createdOn",
4 | "patternPackage": "patternPackage",
5 | "description": "description",
6 | "termRange": {
7 | "temporalUnit": "temporalUnit",
8 | "maximum": 1.00
9 | },
10 | "balanceRange": {
11 | "minimum": 0.00,
12 | "maximum": 10000.00
13 | },
14 | "minorCurrencyUnitDigits": 3,
15 | "createdBy": "createdBy",
16 | "interestBasis": "CURRENT_BALANCE",
17 | "identifier": "identifier",
18 | "interestRange": {
19 | "minimum": 0.00,
20 | "maximum": 10.00
21 | },
22 | "name": "name",
23 | "lastModifiedOn": "lastModifiedOn",
24 | "accountAssignments": [
25 | {
26 | "ledgerIdentifier": "ledgerIdentifier",
27 | "accountIdentifier": "accountIdentifier",
28 | "designator": "accountIdentifier"
29 | }
30 | ],
31 | "lastModifiedBy": "lastModifiedOn",
32 | "currencyCode": "IND",
33 | "parameters": "params"
34 | },
35 | {
36 | "createdOn": "createdOn",
37 | "patternPackage": "patternPackage",
38 | "description": "description",
39 | "termRange": {
40 | "temporalUnit": "temporalUnit",
41 | "maximum": 1.00
42 | },
43 | "balanceRange": {
44 | "minimum": 0.00,
45 | "maximum": 10000.00
46 | },
47 | "minorCurrencyUnitDigits": 3,
48 | "createdBy": "createdBy",
49 | "interestBasis": "CURRENT_BALANCE",
50 | "identifier": "identifier",
51 | "interestRange": {
52 | "minimum": 0.00,
53 | "maximum": 10.00
54 | },
55 | "name": "name",
56 | "lastModifiedOn": "lastModifiedOn",
57 | "accountAssignments": [
58 | {
59 | "ledgerIdentifier": "ledgerIdentifier",
60 | "accountIdentifier": "accountIdentifier",
61 | "designator": "accountIdentifier"
62 | }
63 | ],
64 | "lastModifiedBy": "lastModifiedOn",
65 | "currencyCode": "IND",
66 | "parameters": "params"
67 | }
68 | ]
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/data/datamanager/DataManagerAuth.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.data.datamanager
2 |
3 | import io.reactivex.Observable
4 | import org.mifos.mobile.cn.data.local.PreferencesHelper
5 | import org.mifos.mobile.cn.data.models.Authentication
6 | import org.mifos.mobile.cn.data.remote.BaseApiManager
7 | import javax.inject.Inject
8 | import javax.inject.Singleton
9 |
10 | /**
11 | * @author Rajan Maurya
12 | * On 22/01/18.
13 | */
14 | @Singleton
15 | class DataManagerAuth @Inject constructor(private val baseApiManager: BaseApiManager,
16 | private val preferencesHelper: PreferencesHelper) {
17 |
18 |
19 | /**
20 | * Login with iCommit Account
21 | * Logging the Username and password with Basic Authentication
22 | * @loginRequest LoginRequest
23 | *//*
24 | fun login(loginRequest: LoginRequest): Observable {
25 | return baseApiManager.getAuthApi().login(loginRequest)
26 | .retry(2)
27 | .concatMap({ loginResponse ->
28 | preferencesHelper.putAccessToken(loginResponse.authToken)
29 | preferencesHelper.putLoginStatus(true)
30 | return@concatMap Observable.just(loginResponse)
31 | })
32 | }
33 |
34 |
35 | *//**
36 | * Fake Login with iCommit Account
37 | *//*
38 | fun fakeLogin(loginRequest: LoginRequest): Observable {
39 | return Observable.just(FakeRemoteDataSource.getLoginResponse())
40 | .concatMap({ loginResponse ->
41 | preferencesHelper.putAccessToken(loginResponse.authToken)
42 | preferencesHelper.putLoginStatus(true)
43 | return@concatMap Observable.just(loginResponse)
44 | })
45 | }*/
46 | fun refreshToken(): Observable {
47 | return baseApiManager.getAuthApi().refreshToken()
48 | }
49 | }
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/adapter/LoanApplicationStepAdapter.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.adapter
2 |
3 | import androidx.fragment.app.FragmentManager
4 | import android.content.Context
5 | import com.stepstone.stepper.Step
6 | import com.stepstone.stepper.adapter.AbstractFragmentStepAdapter
7 | import com.stepstone.stepper.viewmodel.StepViewModel
8 | import org.mifos.mobile.cn.R
9 | import org.mifos.mobile.cn.ui.mifos.loanApplication.LoanDebtIncome.LoanDebtIncomeFragment
10 | import org.mifos.mobile.cn.ui.mifos.loanApplication.loanDetails.LoanDetailsFragment
11 | import org.mifos.mobile.cn.ui.mifos.loanApplication.loancosigner.LoanCosignerFragment
12 | import org.mifos.mobile.cn.ui.review.AddLoanReviewFragment
13 |
14 |
15 | class LoanApplicationStepAdapter(fragmentManager: FragmentManager, context: Context)
16 | : AbstractFragmentStepAdapter(fragmentManager, context) {
17 |
18 | var loanApplicationSteps: Array
19 |
20 | init {
21 |
22 | loanApplicationSteps = context.resources.getStringArray(R.array.loan_application_steps)
23 | }
24 |
25 | override fun getViewModel(position: Int): StepViewModel {
26 | return StepViewModel.Builder(context)
27 | .setTitle(loanApplicationSteps[position])
28 | .create()
29 | }
30 |
31 | override fun createStep(position: Int): Step? {
32 | when (position) {
33 | 0 -> {
34 | return LoanDetailsFragment.newInstance()
35 | }
36 | 1 -> {
37 | return LoanDebtIncomeFragment.newInstance()
38 | }
39 | 2 -> {
40 | return LoanCosignerFragment.newInstance()
41 | }
42 | 3 -> {
43 | return AddLoanReviewFragment.Companion.newInstance()
44 | }
45 |
46 | }
47 | return null
48 | }
49 |
50 | override fun getCount(): Int {
51 | return loanApplicationSteps.size
52 | }
53 |
54 |
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/ui/utils/ScrollFabBehaviour.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn.ui.utils
2 |
3 | import android.content.Context
4 | import androidx.coordinatorlayout.widget.CoordinatorLayout
5 | import com.google.android.material.floatingactionbutton.FloatingActionButton
6 | import androidx.core.view.ViewCompat
7 | import android.util.AttributeSet
8 | import android.view.View
9 |
10 | class ScrollFabBehaviour(context: Context, attrs: AttributeSet) : FloatingActionButton.Behavior() {
11 |
12 | override fun onStartNestedScroll(coordinatorLayout: CoordinatorLayout,
13 | child: FloatingActionButton, directTargetChild: View,
14 | target: View, axes: Int, type: Int): Boolean {
15 | return axes == ViewCompat.SCROLL_AXIS_VERTICAL
16 | || super.onStartNestedScroll(coordinatorLayout, child,
17 | directTargetChild, target, axes, type)
18 | }
19 |
20 | override fun onNestedScroll(coordinatorLayout: CoordinatorLayout,
21 | child: FloatingActionButton, target: View, dxConsumed: Int,
22 | dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, type: Int) {
23 | super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed,
24 | dyUnconsumed, type)
25 |
26 | if (dyConsumed > 0 && child.visibility == View.VISIBLE) {
27 | // Reason to set fab visiblity as INVISIBLE :
28 | // https://stackoverflow.com/a/41386278/4672688
29 | child.hide(object : FloatingActionButton.OnVisibilityChangedListener() {
30 | override fun onHidden(fab: FloatingActionButton?) {
31 | super.onHidden(fab)
32 | fab!!.visibility = View.INVISIBLE
33 | }
34 | })
35 |
36 | } else if (dyConsumed < 0 && child.visibility != View.VISIBLE) {
37 | child.show()
38 | }
39 |
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Android Client for Fineract CN
2 |
3 | Android Client is built on top of the Fineract CN platform.
4 |
5 | ### Status
6 | [](https://gitter.im/openMF/mifos-mobile-cn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
7 | [](https://travis-ci.org/openMF/mifos-mobile-cn)
8 |
9 | ## Building the Project
10 | 1. Install [Java Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
11 | 2. Download, install, and run the latest version of [Android Studio](http://developer.android.com/sdk/installing/studio.html).
12 | 3. Fork and then clone this repository and import it to Android Studio.
13 | 4. Once the gradle build is finished, click on the green play button to build and run the app.
14 |
15 | ### Demo Credentials
16 | You can use these credentials to log in.
17 | ```
18 | Username: fineractCn
19 | Password: password
20 | ```
21 |
22 | ## Contributing
23 |
24 | We love Pull Requests, Bug Reports, ideas, code reviews or any other kind of positive contribution.
25 |
26 | - [Current issues](https://github.com/openMF/mifos-mobile-cn/issues)
27 | - [Pull requests](https://github.com/openMF/mifos-mobile-cn/pulls)
28 |
29 |
30 | ### Commit Style Guide
31 |
32 | We have set of [Commit Style Guidelines](https://github.com/openMF/mifos-mobile-cn/blob/master/COMMIT_STYLE.md) and [Contribution Guidelines](https://github.com/openMF/mifos-mobile-cn/blob/master/CONTRIBUTING.md). We follow these guideline to track the every change, any bug fixes, any enhancement and any new feature addition. We also suggest you to follow these guidelines to help us manage every commit.
33 |
34 | ## License
35 | This project is currently licensed under the Apache License Version 2.0. A copy of [LICENSE](https://github.com/openMF/mifos-mobile-cn/blob/master/LICENSE.md) should be present along with the source code. To obtain the software under a different license, please contact MIFOS.
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/kotlin/org/mifos/mobile/cn/MifosApplication.kt:
--------------------------------------------------------------------------------
1 | package org.mifos.mobile.cn
2 |
3 | import android.app.Application
4 | import android.content.Context
5 | import androidx.appcompat.app.AppCompatDelegate
6 | import com.facebook.stetho.Stetho
7 | import com.mifos.mobile.passcode.utils.ForegroundChecker
8 | import com.raizlabs.android.dbflow.config.FlowManager
9 | import org.mifos.mobile.cn.injection.component.ApplicationComponent
10 | import org.mifos.mobile.cn.injection.component.DaggerApplicationComponent
11 | import org.mifos.mobile.cn.injection.module.ApplicationModule
12 |
13 | /**
14 | * @author Rajan Maurya
15 | * On 22/01/18.
16 | */
17 | class MifosApplication : Application() {
18 |
19 | lateinit var applicationComponent: ApplicationComponent
20 |
21 | companion object {
22 |
23 | lateinit var fineractApplication: MifosApplication
24 |
25 | fun get(context: Context): MifosApplication {
26 | return context.applicationContext as MifosApplication
27 | }
28 |
29 | fun getContext(context: Context): Context {
30 | return context.applicationContext
31 | }
32 |
33 | fun getContext(): Context {
34 | return fineractApplication
35 | }
36 | }
37 |
38 | override fun onCreate() {
39 | super.onCreate()
40 | fineractApplication = this
41 | AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)
42 |
43 | // Initializing the Dagger component
44 | initializeComponent()
45 | applicationComponent.inject(this)
46 |
47 | // Initialize the Stetho
48 | Stetho.initializeWithDefaults(this)
49 | ForegroundChecker.init(this)
50 |
51 | FlowManager.init(this)
52 |
53 | }
54 |
55 | fun getComponent(): ApplicationComponent {
56 | return applicationComponent
57 | }
58 |
59 | private fun initializeComponent() {
60 | applicationComponent = DaggerApplicationComponent.builder()
61 | .applicationModule(ApplicationModule(this))
62 | .build()
63 | }
64 | }
65 |
--------------------------------------------------------------------------------