Commit 3d406e2
feat(auth): Phase C Wave 2 — Login end-to-end Store5 migration
Second end-to-end feature wave. Adds the auth resource API + relocates
the Login chain following the Wave 1 template.
core/network/auth/api/AuthApi.kt (NEW)
Suspend Ktorfit interface for Fineract authentication endpoints.
Future auth-wave additions (OTP, refresh, logout) extend this same file.
core/network/di/NetworkModule.kt
+ single { get<Ktorfit>().createAuthApi() }
Method-level @deprecated on legacy login paths:
- DataManagerAuth.login
- ClientService.authenticate
Both surfaces stay compileable for un-migrated callers; Phase D deletes
them once nothing references them.
core/data/auth/ (relocate + rewrite)
git mv core/data/repository/LoginRepository.kt
-> core/data/auth/LoginRepository.kt
git mv core/data/repositoryImp/LoginRepositoryImp.kt
-> core/data/auth/impl/LoginRepositoryImpl.kt (renamed)
Impl now consumes AuthApi directly; no DataManagerAuth dependency.
RepositoryModule import updated; binding remains in core/data.
core/domain (delete pure-delegator use case)
- useCases/LoginUseCase.kt (deleted)
- di/UseCaseModule.kt: factoryOf(::LoginUseCase) removed
Surviving use cases: UsernameValidationUseCase + PasswordValidationUseCase
(validators — kept per the core/domain rule).
feature/auth/{ui, di, navigation}/ (restructure with MVI triple)
ui/
LoginState.kt — validation-error state (pre-submit gate)
LoginAction.kt — sealed Submit / DismissError
LoginEvent.kt — sealed NavigateToPasscode / ShowError(StringResource)
LoginViewModel.kt — extends BaseViewModel<LoginState, LoginEvent, LoginAction>
with SubmitHandler<PostAuthenticationResponse>.
Submitted -> persist user via prefManager, emit
NavigateToPasscode event. authenticated != true also
routes to ShowError. Failed -> ShowError.
LoginScreen.kt — uses MifosProgressIndicatorOverlay during submit;
Snackbar for error events; passcode navigation on
success. Includes 3 @Preview functions (Idle,
Submitting, ValidationError) using
org.jetbrains.compose.ui.tooling.preview.* (KMP-aware).
di/AuthModule.kt — import updated to ui/ package; viewModelOf-only
(Repository binding lives in core/data
RepositoryModule per the Koin DI ownership boundary).
navigation/
LoginRoute.kt — @serializable object (split from AuthNavigation)
AuthNavigation.kt — NavGraphBuilder.authNavGraph + nav extensions
No hardcoded user-facing strings:
composeResources additions:
feature_auth_update_server_configuration
feature_auth_cd_arrow_forward
feature_auth_cd_error_icon
feature_auth_cd_password_visibility
All button labels, content descriptions consume stringResource(...).
feature/auth/build.gradle.kts
+ implementation(projects.core.ui)
Other deps unchanged (core.data + core.domain for validators).
Grep invariants pass: zero DataState, zero MifosProgressIndicator legacy
imports, zero user-facing string literals, file layout matches plan.1 parent 953f7b0 commit 3d406e2
21 files changed
Lines changed: 369 additions & 288 deletions
File tree
- core
- data/src/commonMain/kotlin/com/mifos/core/data
- auth
- impl
- di
- domain/src/commonMain/kotlin/com/mifos/core/domain
- di
- useCases
- network/src/commonMain/kotlin/com/mifos/core/network
- auth/api
- datamanager
- di
- services
- feature/auth
- src/commonMain
- composeResources/values
- kotlin/com/mifos/feature/auth
- di
- login
- ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 14 | | |
19 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 17 | + | |
| 18 | + | |
22 | 19 | | |
23 | 20 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
27 | 25 | | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | | - | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
| |||
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
147 | | - | |
148 | 146 | | |
149 | 147 | | |
150 | 148 | | |
| |||
Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
0 commit comments