Skip to content

Conversation

@ankitkumarrain
Copy link
Contributor

@ankitkumarrain ankitkumarrain commented Nov 5, 2025

Fixes - Jira-#Issue_Number

Didn't create a Jira ticket, click here to create new.

Please Add Screenshots If there are any UI changes.

Before After

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the static analysis check ./gradlew check or ci-prepush.sh to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them.

Summary by CodeRabbit

  • New Features
    • Multi-step fixed deposit account creation flow with guided pages.
    • Select fixed deposit product, choose field officer, pick submission date, and enter external ID.
    • Dynamic loading of fixed-deposit product options from the server.
    • Updated navigation to a dedicated "Create Fixed Deposit" route and view.
  • UI
    • Added strings for recurring/fixed deposit titles and submission labels.

@coderabbitai
Copy link

coderabbitai bot commented Nov 5, 2025

Walkthrough

Adds a fixed-deposit feature: network models and service, API endpoint constant, data manager and repository, DI bindings, navigation and route changes to pass clientId, a new multi-step CreateFixedDepositAccountViewmodel and state-driven UI (DetailsPage), plus string resources and minor enum endpoint update.

Changes

Cohort / File(s) Summary
Network Models
core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositTemplate.kt, core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositProductOption.kt
Adds serializable models FixedDepositTemplate and FixedDepositProductOption with JSON mappings.
Network Service & API
core/network/src/commonMain/kotlin/com/mifos/core/network/services/FixedDepositService.kt, core/database/src/commonMain/kotlin/com/mifos/room/basemodel/APIEndPoint.kt, core/network/src/commonMain/kotlin/com/mifos/core/network/BaseApiManager.kt
Adds FixedDepositService interface with fixedDepositProductTemplate endpoint; adds APIEndPoint.FIXED_DEPOSIT = "fixeddepositaccounts"; wires fixedDepositService into BaseApiManager.
Network DataManager & DI
core/network/src/commonMain/kotlin/com/mifos/core/network/datamanager/DataManagerFixedDeposit.kt, core/network/src/commonMain/kotlin/com/mifos/core/network/di/DataMangerModule.kt
Adds DataManagerFixedDeposit delegating to fixedDepositService; registers it in DataMangerModule as a singleton.
Data Layer - Repository
core/data/src/commonMain/kotlin/com/mifos/core/data/repository/FixedDepositRepository.kt, core/data/src/commonMain/kotlin/com/mifos/core/data/repositoryImp/FixedDepositRepositoryImpl.kt
Adds FixedDepositRepository interface and FixedDepositRepositoryImpl delegating to DataManagerFixedDeposit and exposing Flow<DataState>.
Feature ViewModel & DI
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountViewmodel.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/di/ClientModule.kt
Introduces CreateFixedDepositAccountViewmodel, state (NewFixedDepositAccountState), actions and events; registers CreateFixedDepositAccountViewmodel in ClientModule.
UI — Screens & Pages
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountScreen.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt
Renames screen to CreateFixedDepositAccountScreen (adds NavController param), replaces DetailsPage callback with state-driven signature (state, onAction) and refactors UI to dispatch actions for product/date/fieldOfficer/externalId.
Navigation & Routes
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountRoute.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt, feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientApplyNewApplications/ClientApplyNewApplication*.kt
Replaces FixedDepositRoute with createFixedDepositAccountRoute(clientId: Int); adds createFixedDepositAccountDestination and navigateToCreateFixedDepositRoute(clientId); updates callback types to pass clientId (onNavigateApplyFixedAccount: (Int) -> Unit).
Removed / Replaced
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/FixedDepositAccountViewmodel.kt (old)
Removes old NewFixedDepositAccountViewmodel implementation; replaced by new viewmodel and flow.
Resources
feature/client/src/commonMain/composeResources/values/strings.xml
Adds strings: title_new_recurring_deposit_account, one_year_fixed_deposit, submission_on, Field_officer.
Enum Endpoint Mapping
core/database/src/commonMain/kotlin/com/mifos/room/entities/accounts/savings/SavingAccountDepositTypeEntity.kt
Changes ServerTypes.FIXED endpoint from APIEndPoint.SAVINGS_ACCOUNTS to APIEndPoint.FIXED_DEPOSIT.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant User
    participant Screen as CreateFixedDepositAccountScreen
    participant VM as CreateFixedDepositAccountViewmodel
    participant Repo as FixedDepositRepository
    participant DM as DataManagerFixedDeposit
    participant Service as FixedDepositService
    participant API as Backend

    User->>Screen: interact (select product / pick date / submit)
    Screen->>VM: onAction(OnDetailsSubmit / other actions)
    VM->>VM: update state (emit StateFlow)
    VM-->>Screen: state updates (recompose)

    alt Needs template data
        VM->>Repo: getFixedDepositTemplate(clientId)
        Repo->>DM: delegate
        DM->>Service: fixedDepositProductTemplate(clientId)
        Service->>API: GET /fixeddepositaccounts/template?clientId=...
        API-->>Service: FixedDepositTemplate
        Service-->>DM: Flow<FixedDepositTemplate>
        DM-->>Repo: Flow<FixedDepositTemplate>
        Repo-->>VM: DataState<FixedDepositTemplate>
        VM->>VM: incorporate template into state
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

  • Areas to focus on:
    • createFixedDepositAccountViewmodel and NewFixedDepositAccountAction handlers (state transitions, validation, concurrency).
    • DetailsPage refactor (bindings, date picker dialog integration, error display).
    • Navigation changes ensuring clientId is passed correctly through route → destination → screen.
    • Flow pipeline from FixedDepositService → DataManager → Repository → ViewModel (DataState wrapping, error paths).

Poem

🐇 I hopped through code, stitched routes with care,
Templates fetched through network air,
Steps and actions, state in a row,
ClientId travels where it must go,
A tiny rabbit cheers: fixed-deposits, hooray! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feature : New Fixed Deposit Details Page' directly aligns with the PR's primary objective of implementing a new fixed deposit details page UI component with associated state management and navigation infrastructure.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (10)
core/database/src/commonMain/kotlin/com/mifos/room/basemodel/APIEndPoint.kt (1)

44-44: Fix spacing around the assignment operator.

Missing space before the = operator. For consistency with other constants in this file, add a space.

Apply this diff:

-    const val FIXED_DEPOSIT ="fixeddepositaccounts"
+    const val FIXED_DEPOSIT = "fixeddepositaccounts"
core/data/src/commonMain/kotlin/com/mifos/core/data/repository/FixedDepositRepository.kt (1)

7-11: LGTM!

The interface is well-defined and follows the repository pattern correctly.

Consider removing the extra blank lines (9-10) for cleaner formatting:

 interface FixedDepositRepository {
     fun getFixedDepositTemplate(clientId: Int): Flow<DataState<FixedDepositTemplate>>
-
-
 }
core/network/src/commonMain/kotlin/com/mifos/core/network/datamanager/DataManagerFixedDeposit.kt (1)

7-7: Fix constructor formatting.

Missing space before the opening parenthesis in the constructor declaration.

Apply this diff:

-class DataManagerFixedDeposit (private val baseApiManager: BaseApiManager){
+class DataManagerFixedDeposit(private val baseApiManager: BaseApiManager) {
core/data/src/commonMain/kotlin/com/mifos/core/data/repositoryImp/FixedDepositRepositoryImpl.kt (1)

11-15: LGTM!

The repository implementation correctly delegates to the data manager and properly converts the Flow to a DataState Flow using the asDataStateFlow() extension.

Consider removing the extra blank lines (16-19) at the end of the class for cleaner formatting:

     override fun getFixedDepositTemplate(clientId: Int): Flow<DataState<FixedDepositTemplate>> {
         return dataManagerFixedDeposit.getFixedDepositTemplate(clientId).asDataStateFlow()
     }
-
-
-
 }
core/network/src/commonMain/kotlin/com/mifos/core/network/services/FixedDepositService.kt (1)

14-20: LGTM!

The service interface is correctly defined with proper Ktorfit annotations. The GET endpoint path uses compile-time string concatenation with APIEndPoint.FIXED_DEPOSIT, which is appropriate.

Consider removing the excessive blank lines (9-13 before the interface, 21-25 after) to improve code cleanliness:

 import kotlinx.coroutines.flow.Flow
-
-
-
-
-
 interface FixedDepositService {
 
     @GET("accounts/" + APIEndPoint.FIXED_DEPOSIT + "/template")
     fun fixedDepositProductTemplate(
         @Query("clientId") clientId: Int,
     ): Flow<FixedDepositTemplate>
 }
-
-
-
-
core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositTemplate.kt (2)

6-7: Consider removing one empty line.

Two consecutive empty lines are present. Kotlin style typically uses a single blank line between imports and class declarations.


13-13: Inconsistent @SerialName style.

This annotation uses the explicit value = parameter name while others on lines 10 and 16 don't. For consistency, consider removing value =.

Apply this diff:

-    @SerialName(value = "clientName")
+    @SerialName("clientName")
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountViewmodel.kt (3)

21-26: Rename class to follow Kotlin naming conventions.

The class name uses Viewmodel but the Kotlin/Android convention is ViewModel with a capital 'M'.

Apply this diff:

-class CreateFixedDepositAccountViewmodel :
+class CreateFixedDepositAccountViewModel :
     BaseViewModel<
         NewFixedDepositAccountState,
         NewFixedDepositAccountEvent,
         NewFixedDepositAccountAction,
         >(NewFixedDepositAccountState()) {

85-85: Consider using a more specific type for dialogState.

Typing dialogState as Any? sacrifices type safety. Consider defining a sealed class for dialog states to improve type safety and code clarity.

Example:

sealed class DialogState {
    data object None : DialogState()
    data class ConfirmationDialog(val message: String) : DialogState()
    // Add other dialog types as needed
}

// Then in state:
val dialogState: DialogState = DialogState.None

102-119: Standardize sealed class member declarations.

There's inconsistent use of object and data object for members without properties. For Kotlin 1.9+, prefer data object for all singleton members to get consistent toString(), equals(), and hashCode() implementations.

Apply this diff for consistency:

 sealed class NewFixedDepositAccountAction() {
-    object NextStep : NewFixedDepositAccountAction()
+    data object NextStep : NewFixedDepositAccountAction()
     data class OnStepChange(val newIndex: Int) : NewFixedDepositAccountAction()
-    object NavigateBack : NewFixedDepositAccountAction()
+    data object NavigateBack : NewFixedDepositAccountAction()
     data class OnSubmissionDatePick(val state: Boolean) : NewFixedDepositAccountAction()
     data class OnSubmissionDateChange(val date: String) : NewFixedDepositAccountAction()
     data class OnProductNameChange(val index: Int) : NewFixedDepositAccountAction()
-    object Finish : NewFixedDepositAccountAction()
+    data object Finish : NewFixedDepositAccountAction()
     data class OnFieldOfficerChange(val index: Int) : NewFixedDepositAccountAction()
     data class OnExternalIdChange(val value: String) : NewFixedDepositAccountAction()
     data object OnDetailsSubmit : NewFixedDepositAccountAction()


 }
 sealed class NewFixedDepositAccountEvent() {
-    object NavigateBack : NewFixedDepositAccountEvent()
+    data object NavigateBack : NewFixedDepositAccountEvent()
-    object Finish : NewFixedDepositAccountEvent()
+    data object Finish : NewFixedDepositAccountEvent()
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9df7ef4 and 98f09c5.

📒 Files selected for processing (19)
  • core/data/src/commonMain/kotlin/com/mifos/core/data/repository/FixedDepositRepository.kt (1 hunks)
  • core/data/src/commonMain/kotlin/com/mifos/core/data/repositoryImp/FixedDepositRepositoryImpl.kt (1 hunks)
  • core/database/src/commonMain/kotlin/com/mifos/room/basemodel/APIEndPoint.kt (1 hunks)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/BaseApiManager.kt (3 hunks)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/datamanager/DataManagerFixedDeposit.kt (1 hunks)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/di/DataMangerModule.kt (2 hunks)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositProductOption.kt (1 hunks)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositTemplate.kt (1 hunks)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/services/FixedDepositService.kt (1 hunks)
  • feature/client/src/commonMain/composeResources/values/strings.xml (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientApplyNewApplications/ClientApplyNewApplicationRoute.kt (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/clientApplyNewApplications/ClientApplyNewApplicationsScreen.kt (2 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/di/ClientModule.kt (2 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt (3 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/FixedDepositAccountViewmodel.kt (0 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountRoute.kt (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountScreen.kt (3 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountViewmodel.kt (1 hunks)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt (1 hunks)
💤 Files with no reviewable changes (1)
  • feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/FixedDepositAccountViewmodel.kt
🧰 Additional context used
🧬 Code graph analysis (3)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt (3)
core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosTextFieldDropdown.kt (1)
  • MifosTextFieldDropdown (39-112)
core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosOutlinedTextField.kt (1)
  • MifosDatePickerTextField (363-402)
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosTwoButtonRow.kt (1)
  • MifosTwoButtonRow (31-91)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/navigation/ClientNavigation.kt (1)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountRoute.kt (1)
  • createFixedDepositAccountDestination (25-33)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountRoute.kt (1)
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountScreen.kt (1)
  • CreateFixedDepositAccountScreen (37-57)
🔇 Additional comments (9)
core/network/src/commonMain/kotlin/com/mifos/core/network/di/DataMangerModule.kt (2)

24-24: LGTM!

Import correctly added for the new DataManagerFixedDeposit.


55-55: LGTM!

DI binding is correctly configured following the same pattern as other data managers in this module.

core/network/src/commonMain/kotlin/com/mifos/core/network/BaseApiManager.kt (3)

46-46: LGTM!

Import correctly added for the FixedDepositService.


62-62: LGTM!

Import for the Ktorfit-generated service creator is correct.


79-79: LGTM!

Service initialization follows the same pattern as other services in BaseApiManager and is correctly positioned.

core/network/src/commonMain/kotlin/com/mifos/core/network/datamanager/DataManagerFixedDeposit.kt (1)

9-10: LGTM!

The delegation to the service layer is correct and follows the data manager pattern used throughout the codebase.

core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositTemplate.kt (1)

8-18: Verify nullability requirements against Mifos API specification.

The codebase shows inconsistent nullability patterns: response models like ShareAccountResponse use nullable fields, while template models like FixedDepositProductOption in the same package use non-nullable required fields. FixedDepositTemplate follows the template pattern with non-nullable clientId and clientName.

However, without access to the Mifos API specification or response documentation, it cannot be confirmed whether these fields can actually be null in the API response. Check the API contract to determine if clientId and clientName should be nullable (Int?, String?) to handle potential null values gracefully.

feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountViewmodel.kt (2)

60-66: Verify that validation logic is not missing.

The handleOnDetailsSubmit method only clears externalIdError without performing any validation on externalId or other fields. Ensure that validation is either handled elsewhere or should be added here.

If validation is needed, consider adding it:

 private fun handleOnDetailsSubmit() {
+    // Add validation logic here
+    if (state.externalId.isBlank()) {
+        mutableStateFlow.update {
+            it.copy(externalIdError = /* error resource */)
+        }
+        return
+    }
     mutableStateFlow.update {
         it.copy(
             externalIdError = null,
         )
     }
+    // Proceed to next step or submit
 }

98-101: Verify whether externalId validation should be included.

The isDetailsNextEnabled computed property checks submissionDate, fixedDepositProductSelected, and fieldOfficerIndex, but doesn't validate externalId. Confirm whether externalId is optional or if validation should be added.

If externalId is required, update the validation:

 val isDetailsNextEnabled = submissionDate.isNotEmpty() &&
         fixedDepositProductSelected != -1 &&
-        fieldOfficerIndex != -1
+        fieldOfficerIndex != -1 &&
+        externalId.isNotEmpty()

Comment on lines +18 to +19
@SerialName("totalShares")
val totalShares: Int,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the totalShares field naming for Fixed Deposit products.

The field name totalShares seems 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:

#!/bin/bash
# Search for other product option models to compare naming patterns
ast-grep --pattern 'data class $_ ProductOption(
  $$$
)'

# Search for any API documentation or comments about totalShares in fixed deposits
rg -n -C3 'totalShares' --type=kt

Length of output: 26



---

🏁 Script executed:

```shell
#!/bin/bash
# Find all kotlin files in the network model directory
echo "=== Kotlin files in network model directory ==="
fd "\.kt$" "core/network/src/commonMain/kotlin/com/mifos/core/network/model" 2>/dev/null | head -20

# Search for ProductOption data classes
echo -e "\n=== Searching for ProductOption classes ==="
rg -n "data class.*ProductOption" 2>/dev/null

# Search for totalShares references in kotlin files
echo -e "\n=== Searching for totalShares references ==="
rg -n -C3 "totalShares" 2>/dev/null

# Search for FixedDepositProductOption file
echo -e "\n=== FixedDepositProductOption file content ==="
find . -name "FixedDepositProductOption.kt" -exec cat {} \; 2>/dev/null

Length of output: 3610



---

🏁 Script executed:

```shell
#!/bin/bash
# Show the ProductOptions class from loan template
echo "=== ProductOptions from loan template ==="
cat "core/model/src/commonMain/kotlin/com/mifos/core/model/objects/template/loan/ProductOptions.kt" 2>/dev/null | head -50

# Show the ProductOption class from recurring period
echo -e "\n=== ProductOption from recurring period ==="
cat "core/model/src/commonMain/kotlin/com/mifos/core/model/objects/template/recurring/period/ProductOption.kt" 2>/dev/null | head -50

# Show the SavingProductOptionsEntity
echo -e "\n=== SavingProductOptionsEntity ==="
cat "core/database/src/commonMain/kotlin/com/mifos/room/entities/templates/clients/SavingProductOptionsEntity.kt" 2>/dev/null

# Search for any API documentation, README, or comments about FixedDepositProductOption
echo -e "\n=== Search for FixedDeposit API references ==="
rg -i "fixeddeposit.*product" -n --max-count=10 2>/dev/null

Length of output: 5845



---

🌐 Web query:

```web
Mifos fixed deposit product API totalShares field documentation

💡 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:

  • Fixed Deposit Product Fields — Mifos docs. [1]
  • Share Product / Share API (totalShares example) — Apache Fineract / Mifos API docs. [2]

Remove the totalShares field from FixedDepositProductOption — it does not exist in the Mifos Fixed Deposit Product API.

The totalShares field is specific to Share Product / Share Accounts APIs and is not included in Fixed Deposit product definitions. This field should not be in the FixedDepositProductOption class. Remove line 18-19 entirely.

🤖 Prompt for AI Agents
In
core/network/src/commonMain/kotlin/com/mifos/core/network/model/FixedDepositProductOption.kt
around lines 18-19, remove the unnecessary `@SerialName("totalShares") val
totalShares: Int` property from the FixedDepositProductOption data class; delete
those two lines and any unused imports or references to totalShares in this file
or its usages so the model matches the Mifos Fixed Deposit Product API.

Comment on lines +533 to +538
<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>

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix invalid resource name for Field Officer label.

Android string resource names must be lowercase. Defining <string name="Field_officer"> will fail the aapt compile step. Please rename it (e.g., field_officer) and update the corresponding usages such as Res.string.Field_officer.

-    <string name="Field_officer">Field Officer</string>
+    <string name="field_officer">Field Officer</string>

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In feature/client/src/commonMain/composeResources/values/strings.xml around
lines 533 to 538, the string resource name "Field_officer" is invalid (contains
uppercase) and will break aapt; rename the resource to all-lowercase (e.g.,
field_officer) in this file and update all call sites/usages (e.g.,
Res.string.Field_officer → Res.string.field_officer) to match the new name.

Comment on lines +67 to +78
private fun moveToNextStep() {
val current = state.currentStep
if (current < state.totalSteps) {
mutableStateFlow.update {
it.copy(
currentStep = current + 1,
)
}
} else {
sendEvent(NewFixedDepositAccountEvent.Finish)
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix off-by-one error in step progression logic.

With totalSteps = 4 and currentStep starting at 0, the condition current < state.totalSteps allows progression through steps 0, 1, 2, 3, and 4—creating 5 steps instead of 4.

Apply this diff to ensure exactly 4 steps (indexed 0-3):

 private fun moveToNextStep() {
     val current = state.currentStep
-    if (current < state.totalSteps) {
+    if (current < state.totalSteps - 1) {
         mutableStateFlow.update {
             it.copy(
                 currentStep = current + 1,
             )
         }
     } else {
         sendEvent(NewFixedDepositAccountEvent.Finish)
     }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private fun moveToNextStep() {
val current = state.currentStep
if (current < state.totalSteps) {
mutableStateFlow.update {
it.copy(
currentStep = current + 1,
)
}
} else {
sendEvent(NewFixedDepositAccountEvent.Finish)
}
}
private fun moveToNextStep() {
val current = state.currentStep
if (current < state.totalSteps - 1) {
mutableStateFlow.update {
it.copy(
currentStep = current + 1,
)
}
} else {
sendEvent(NewFixedDepositAccountEvent.Finish)
}
}
🤖 Prompt for AI Agents
In
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/createFixedDepositAccountViewmodel.kt
around lines 67 to 78, the progression condition allows an off-by-one (with
totalSteps=4 and zero-based currentStep you can reach index 4); change the guard
to only increment while current < state.totalSteps - 1 (so valid indices are
0..totalSteps-1) and keep the else branch sending
NewFixedDepositAccountEvent.Finish when the last step is reached.

Comment on lines +76 to +95
TextButton(
onClick = {
onAction(NewFixedDepositAccountAction.OnSubmissionDatePick(state = false))
submissionDatePickerState.selectedDateMillis?.let {
onAction(
NewFixedDepositAccountAction.OnSubmissionDateChange(
DateHelper.getDateAsStringFromLong(it),
),
)
}
},
) { Text("Hello World") }
},
dismissButton = {
TextButton(
onClick = {
onAction(NewFixedDepositAccountAction.OnSubmissionDatePick(state = false))
},
) { Text("jljks") }
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Replace placeholder dialog button labels.

The DatePicker dialog currently renders literal strings "Hello World" and "jljks", which is unprofessional and not localized. Please wire these buttons to real, translated strings (for example Res.string.feature_client_next / Res.string.feature_client_cancel) so the UI is production-ready.

-                ) { Text("Hello World") }
+                ) { Text(stringResource(Res.string.feature_client_next)) }
...
-                ) { Text("jljks") }
+                ) { Text(stringResource(Res.string.feature_client_cancel)) }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
TextButton(
onClick = {
onAction(NewFixedDepositAccountAction.OnSubmissionDatePick(state = false))
submissionDatePickerState.selectedDateMillis?.let {
onAction(
NewFixedDepositAccountAction.OnSubmissionDateChange(
DateHelper.getDateAsStringFromLong(it),
),
)
}
},
) { Text("Hello World") }
},
dismissButton = {
TextButton(
onClick = {
onAction(NewFixedDepositAccountAction.OnSubmissionDatePick(state = false))
},
) { Text("jljks") }
},
TextButton(
onClick = {
onAction(NewFixedDepositAccountAction.OnSubmissionDatePick(state = false))
submissionDatePickerState.selectedDateMillis?.let {
onAction(
NewFixedDepositAccountAction.OnSubmissionDateChange(
DateHelper.getDateAsStringFromLong(it),
),
)
}
},
) { Text(stringResource(Res.string.feature_client_next)) }
},
dismissButton = {
TextButton(
onClick = {
onAction(NewFixedDepositAccountAction.OnSubmissionDatePick(state = false))
},
) { Text(stringResource(Res.string.feature_client_cancel)) }
},
🤖 Prompt for AI Agents
In
feature/client/src/commonMain/kotlin/com/mifos/feature/client/newFixedDepositAccount/pages/DetailsPage.kt
around lines 76 to 95, the DatePicker dialog buttons use placeholder text
("Hello World" and "jljks"); replace these with localized string resources
(e.g., Res.string.feature_client_next and Res.string.feature_client_cancel) by
calling the Compose stringResource (or your existing Res wrapper) to obtain the
translated text and pass that to Text for each button label; ensure you add any
necessary import for stringResource/Res and use the appropriate resource IDs so
the labels are localized and production-ready.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
core/network/src/commonMain/kotlin/com/mifos/core/network/services/FixedDepositService.kt (2)

9-13: Remove excessive blank lines.

These consecutive blank lines are unnecessary and should be removed to maintain clean code formatting.

Apply this diff:

 import kotlinx.coroutines.flow.Flow
-
-
-
-
-
 interface FixedDepositService {

21-25: Remove trailing blank lines.

Excessive blank lines at the end of the file should be removed.

Apply this diff:

 }
-
-
-
-
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98f09c5 and e29e583.

📒 Files selected for processing (2)
  • core/database/src/commonMain/kotlin/com/mifos/room/entities/accounts/savings/SavingAccountDepositTypeEntity.kt (1 hunks)
  • core/network/src/commonMain/kotlin/com/mifos/core/network/services/FixedDepositService.kt (1 hunks)
🔇 Additional comments (2)
core/database/src/commonMain/kotlin/com/mifos/room/entities/accounts/savings/SavingAccountDepositTypeEntity.kt (1)

47-47: LGTM! Corrects the endpoint mapping for fixed deposits.

This change properly maps the FIXED deposit type to its dedicated endpoint APIEndPoint.FIXED_DEPOSIT instead of incorrectly using the savings accounts endpoint. This ensures correct API routing for fixed deposit operations.

core/network/src/commonMain/kotlin/com/mifos/core/network/services/FixedDepositService.kt (1)

14-20: LGTM! Clean service interface definition.

The interface follows proper Ktorfit patterns with correct annotations and returns a Flow for async operations, which is appropriate for this use case.

onFinish: () -> Unit,
modifier: Modifier = Modifier,
viewModel: NewFixedDepositAccountViewmodel = viewModel(),
viewModel: CreateFixedDepositAccountViewmodel = viewModel(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we have to use koinViewModel() here

}

private fun handleSubmissionDatePick(action: NewFixedDepositAccountAction.OnSubmissionDatePick) {
mutableStateFlow.update { it.copy(showSubmissionDatePick = action.state) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this pr is not completed yet, you haven't called api and fetched the template anywhere

@shashank-0-0 shashank-0-0 mentioned this pull request Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants