-
Notifications
You must be signed in to change notification settings - Fork 659
Feature : New Fixed Deposit Details Page #2534
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
base: development
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.mifos.core.data.repository | ||
|
|
||
| import com.mifos.core.common.utils.DataState | ||
| import com.mifos.core.network.model.FixedDepositTemplate | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| interface FixedDepositRepository { | ||
| fun getFixedDepositTemplate(clientId: Int): Flow<DataState<FixedDepositTemplate>> | ||
|
|
||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package com.mifos.core.data.repositoryImp | ||
|
|
||
|
|
||
| import com.mifos.core.common.utils.DataState | ||
| import com.mifos.core.common.utils.asDataStateFlow | ||
| import com.mifos.core.data.repository.FixedDepositRepository | ||
| import com.mifos.core.network.datamanager.DataManagerFixedDeposit | ||
| import com.mifos.core.network.model.FixedDepositTemplate | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| class FixedDepositRepositoryImpl (private val dataManagerFixedDeposit: DataManagerFixedDeposit): FixedDepositRepository{ | ||
|
|
||
| override fun getFixedDepositTemplate(clientId: Int): Flow<DataState<FixedDepositTemplate>> { | ||
| return dataManagerFixedDeposit.getFixedDepositTemplate(clientId).asDataStateFlow() | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.mifos.core.network.datamanager | ||
|
|
||
| import com.mifos.core.network.BaseApiManager | ||
| import com.mifos.core.network.model.FixedDepositTemplate | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| class DataManagerFixedDeposit (private val baseApiManager: BaseApiManager){ | ||
|
|
||
| fun getFixedDepositTemplate(clientId:Int): Flow<FixedDepositTemplate> = | ||
| baseApiManager.fixedDepositService.fixedDepositProductTemplate(clientId) | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package com.mifos.core.network.model | ||
|
|
||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class FixedDepositProductOption( | ||
| @SerialName("id") | ||
| val id: Int, | ||
|
|
||
| @SerialName("name") | ||
| val name: String, | ||
|
|
||
| @SerialName("shortName") | ||
| val shortName: String, | ||
|
|
||
| @SerialName("totalShares") | ||
| val totalShares: Int, | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package com.mifos.core.network.model | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
|
|
||
|
|
||
| @Serializable | ||
| data class FixedDepositTemplate( | ||
| @SerialName("clientId") | ||
| val clientId: Int, | ||
|
|
||
| @SerialName(value = "clientName") | ||
| val clientName: String, | ||
|
|
||
| @SerialName("productOptions") | ||
| val productOptions: List<FixedDepositProductOption> = emptyList(), | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package com.mifos.core.network.services | ||
|
|
||
| import com.mifos.core.network.model.FixedDepositTemplate | ||
| import com.mifos.room.basemodel.APIEndPoint | ||
| import de.jensklingenberg.ktorfit.http.Query | ||
| import de.jensklingenberg.ktorfit.http.GET | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| interface FixedDepositService { | ||
|
|
||
| @GET( APIEndPoint.FIXED_DEPOSIT + "/template") | ||
| fun fixedDepositProductTemplate( | ||
| @Query("clientId") clientId: Int, | ||
| ): Flow<FixedDepositTemplate> | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -530,6 +530,12 @@ | |
| <string name="client_update_document_title">Update Document</string> | ||
| <!-- Screen Title --> | ||
| <string name="title_new_fixed_deposit_account">New Fixed Deposit Account</string> | ||
| <string name="title_new_recurring_deposit_account">New Recurring Deposit Account</string> | ||
| <!-- New Fixed Deposit Account --> | ||
| <string name="one_year_fixed_deposit">1 Year Fixed Deposit</string> | ||
| <string name="submission_on">Submission On</string> | ||
| <string name="Field_officer">Field Officer</string> | ||
|
|
||
|
Comment on lines
+533
to
+538
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix invalid resource name for Field Officer label. Android string resource names must be lowercase. Defining - <string name="Field_officer">Field Officer</string>
+ <string name="field_officer">Field Officer</string>
🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| </resources> | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ import androidx.compose.runtime.getValue | |
| import androidx.compose.ui.Modifier | ||
| import androidx.lifecycle.compose.collectAsStateWithLifecycle | ||
| import androidx.lifecycle.viewmodel.compose.viewModel | ||
| import androidx.navigation.NavController | ||
| import com.mifos.core.designsystem.component.MifosScaffold | ||
| import com.mifos.core.ui.components.MifosStepper | ||
| import com.mifos.core.ui.components.Step | ||
|
|
@@ -34,11 +35,12 @@ import com.mifos.feature.client.newFixedDepositAccount.pages.TermsPage | |
| import org.jetbrains.compose.resources.stringResource | ||
|
|
||
| @Composable | ||
| internal fun FixedDepositAccountScreen( | ||
| internal fun CreateFixedDepositAccountScreen( | ||
| onNavigateBack: () -> Unit, | ||
| navController: NavController, | ||
| onFinish: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| viewModel: NewFixedDepositAccountViewmodel = viewModel(), | ||
| viewModel: CreateFixedDepositAccountViewmodel = viewModel(), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we have to use koinViewModel() here |
||
| ) { | ||
| val state by viewModel.stateFlow.collectAsStateWithLifecycle() | ||
| EventsEffect(viewModel.eventFlow) { event -> | ||
|
|
@@ -64,7 +66,8 @@ private fun FixedDepositAccountScaffold( | |
| listOf( | ||
| Step(stringResource(Res.string.step_details)) { | ||
| DetailsPage( | ||
| onNext = { onAction(NewFixedDepositAccountAction.NextStep) }, | ||
| state = state, | ||
| onAction = onAction, | ||
| ) | ||
| }, | ||
| Step(name = stringResource(Res.string.step_terms)) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify the
totalSharesfield naming for Fixed Deposit products.The field name
totalSharesseems semantically incorrect for a Fixed Deposit product option. Fixed deposits typically don't have "shares" — that terminology is more common for equity or share products. Please verify that this field name matches the actual API response for fixed deposit product templates.Run the following script to check if similar models use this field and to look for API documentation:
🏁 Script executed:
Length of output: 26
Length of output: 3610
Length of output: 5845
💡 Result:
There is no totalShares field on the Fixed Deposit Product API — totalShares is a field used by the Share Product / Share Accounts APIs. See the Fixed Deposit product fields (no totalShares shown). [1] For the field totalShares and examples, see the Share Product API documentation (totalShares / totalSharesIssued appear on products/share and related endpoints). [2]
Sources:
Remove the
totalSharesfield fromFixedDepositProductOption— it does not exist in the Mifos Fixed Deposit Product API.The
totalSharesfield is specific to Share Product / Share Accounts APIs and is not included in Fixed Deposit product definitions. This field should not be in theFixedDepositProductOptionclass. Remove line 18-19 entirely.🤖 Prompt for AI Agents