android-client icon indicating copy to clipboard operation
android-client copied to clipboard

Feature : New Fixed Deposit Details Page

Open ankitkumarrain opened this issue 1 month ago β€’ 1 comments

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.

ankitkumarrain avatar Nov 05 '25 12:11 ankitkumarrain

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<FixedDepositTemplate>>.
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

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.

coderabbitai[bot] avatar Nov 05 '25 12:11 coderabbitai[bot]