Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(feature:account): set up initial directory structure for account… #2773

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions feature/accounts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
35 changes: 35 additions & 0 deletions feature/accounts/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/


plugins {
alias(libs.plugins.mifos.cmp.feature)
}

android {
namespace = "com.hekmatullahamin.accounts"
}

kotlin {
sourceSets{
commonMain.dependencies {
implementation(compose.material3)
implementation(compose.components.resources)

api(projects.core.common)
api(projects.core.model)

api(projects.feature.loanAccount)
api(projects.feature.savingsAccount)
api(projects.feature.shareAccount)
}
}
}

21 changes: 21 additions & 0 deletions feature/accounts/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
package org.mifos.mobile.feature.accounts.navigation

import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavType
import androidx.navigation.compose.composable
import androidx.navigation.navArgument
import androidx.navigation.navigation
import org.mifos.mobile.core.common.Constants
import org.mifos.mobile.core.model.enums.AccountType
import org.mifos.mobile.feature.accounts.screen.AccountsScreen

fun NavController.navigateToAccountsScreen(accountType: AccountType = AccountType.SAVINGS) {
navigate(AccountsNavigation.AccountsScreen.passArguments(accountType = accountType))
}

fun NavGraphBuilder.accountsNavGraph(
navController: NavController,
navigateToAccountDetail: (AccountType, Long) -> Unit,
navigateToLoanApplicationScreen: () -> Unit,
navigateToSavingsApplicationScreen: () -> Unit,
) {
navigation(
startDestination = AccountsNavigation.AccountsScreen.route,
route = AccountsNavigation.AccountsBase.route,
) {
accountsScreenRoute(
navigateBack = navController::popBackStack,
navigateToAccountDetail = navigateToAccountDetail,
navigateToLoanApplicationScreen = navigateToLoanApplicationScreen,
navigateToSavingsApplicationScreen = navigateToSavingsApplicationScreen,
)
}
}

fun NavGraphBuilder.accountsScreenRoute(
navigateBack: () -> Unit,
navigateToAccountDetail: (AccountType, Long) -> Unit,
navigateToLoanApplicationScreen: () -> Unit,
navigateToSavingsApplicationScreen: () -> Unit,
) {
composable(
route = AccountsNavigation.AccountsScreen.route,
arguments = listOf(
navArgument(name = Constants.ACCOUNT_TYPE) {
type = NavType.StringType
},
),
) {
AccountsScreen(
navigateBack = navigateBack,
navigateToLoanApplicationScreen = navigateToLoanApplicationScreen,
navigateToSavingsApplicationScreen = navigateToSavingsApplicationScreen,
onItemClick = { accountType, accountId ->
navigateToAccountDetail(
accountType,
accountId,
)
},
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
package org.mifos.mobile.feature.accounts.navigation

import org.mifos.mobile.core.common.Constants.ACCOUNT_TYPE
import org.mifos.mobile.core.model.enums.AccountType

// Constants for Routes
const val ACCOUNTS_NAVIGATION_ROUTE_BASE = "accounts_base_route"
const val ACCOUNT_SCREEN_ROUTE = "account_screen_route"

// Sealed class for navigation route
sealed class AccountsNavigation(val route: String) {
data object AccountsBase : AccountsNavigation(route = ACCOUNTS_NAVIGATION_ROUTE_BASE)
data object AccountsScreen : AccountsNavigation(route = "ACCOUNT_SCREEN_ROUTE/{$ACCOUNT_TYPE}") {
fun passArguments(accountType: AccountType) =
"$ACCOUNT_SCREEN_ROUTE/${accountType.name}"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
package org.mifos.mobile.feature.accounts.screen

import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import org.mifos.mobile.core.model.enums.AccountType

@Composable
fun AccountsScreen(
navigateBack: () -> Unit,
navigateToLoanApplicationScreen: () -> Unit,
navigateToSavingsApplicationScreen: () -> Unit,
onItemClick: (AccountType, Long) -> Unit,
modifier: Modifier = Modifier,
) {
// Added for now to surpass the detekt error
navigateBack()
navigateToLoanApplicationScreen()
navigateToSavingsApplicationScreen()
onItemClick(AccountType.LOAN, 1)

Column(modifier = modifier) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
package org.mifos.mobile.feature.accounts.viewmodel

import androidx.lifecycle.ViewModel

class AccountsViewModel : ViewModel()
1 change: 1 addition & 0 deletions feature/loan-account/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
24 changes: 24 additions & 0 deletions feature/loan-account/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
plugins {
alias(libs.plugins.mifos.cmp.feature)
}

android {
namespace = "com.hekmatullahamin.loan_account"
}

kotlin {
sourceSets{
commonMain.dependencies {

}
}
}
21 changes: 21 additions & 0 deletions feature/loan-account/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
1 change: 1 addition & 0 deletions feature/savings-account/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
24 changes: 24 additions & 0 deletions feature/savings-account/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
plugins {
alias(libs.plugins.mifos.cmp.feature)
}

android {
namespace = "com.hekmatullahamin.savings_account"
}

kotlin {
sourceSets {
commonMain.dependencies {

}
}
}
21 changes: 21 additions & 0 deletions feature/savings-account/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
1 change: 1 addition & 0 deletions feature/share-account/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
24 changes: 24 additions & 0 deletions feature/share-account/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
plugins {
alias(libs.plugins.mifos.cmp.feature)
}

android {
namespace = "com.hekmatullahamin.share_account"
}

kotlin {
sourceSets {
commonMain.dependencies {

}
}
}
21 changes: 21 additions & 0 deletions feature/share-account/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ roomCommonVersion = "2.6.1"
androidPackageName = "AndroidApp"
androidPackageNamespace = "org.mifos.mobile"
androidPackageVersion = "1.0.0"
materialVersion = "1.12.0"

[libraries]
accompanist-pager = { group = "com.google.accompanist", name = "accompanist-pager", version.ref = "accompanistVersion" }
Expand Down Expand Up @@ -321,6 +322,7 @@ moko-permission-compose = { group = "dev.icerock.moko", name = "permissions-comp

window-size = { group = "dev.chrisbanes.material3", name = "material3-window-size-class-multiplatform", version.ref = "windowsSizeClass" }
androidx-room-common = { group = "androidx.room", name = "room-common", version.ref = "roomCommonVersion" }
material = { group = "com.google.android.material", name = "material", version.ref = "materialVersion" }

[bundles]
androidx-compose-ui-test = [
Expand Down
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ include(":feature:auth")
//include(":feature:update-password")
//include(":feature:home")
//include(":feature:user-profile")
include(":feature:accounts")
include(":feature:share-account")
include(":feature:loan-account")
include(":feature:savings-account")

// Lint Modules
//include(":lint")
Expand Down
Loading