Feature : New Fixed Deposit Details Page
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 checkorci-prepush.shto 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.
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.
Comment @coderabbitai help to get the list of available commands and usage tips.