Skip to content

Commit ce3b260

Browse files
authored
Merge branch 'kmp-impl' into MIFOSAC-458-client-charge-dialog
2 parents ffc6865 + 1e38080 commit ce3b260

30 files changed

Lines changed: 576 additions & 134 deletions

File tree

cmp-android/dependencies/demoDebugRuntimeClasspath.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ com.google.accompanist:accompanist-drawablepainter:0.37.3
153153
com.google.accompanist:accompanist-permissions:0.34.0
154154
com.google.android.gms:play-services-base:18.5.0
155155
com.google.android.gms:play-services-basement:18.4.0
156+
com.google.android.gms:play-services-location:21.3.0
156157
com.google.android.gms:play-services-maps:18.2.0
157158
com.google.android.gms:play-services-oss-licenses:17.1.0
158159
com.google.android.gms:play-services-tasks:18.2.0
@@ -313,6 +314,7 @@ org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
313314
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.10.2
314315
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.10.2
315316
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2
317+
org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.10.2
316318
org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.10.2
317319
org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.6.2
318320
org.jetbrains.kotlinx:kotlinx-datetime:0.6.2

cmp-android/dependencies/demoReleaseRuntimeClasspath.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ com.google.accompanist:accompanist-drawablepainter:0.37.3
149149
com.google.accompanist:accompanist-permissions:0.34.0
150150
com.google.android.gms:play-services-base:18.5.0
151151
com.google.android.gms:play-services-basement:18.4.0
152+
com.google.android.gms:play-services-location:21.3.0
152153
com.google.android.gms:play-services-maps:18.2.0
153154
com.google.android.gms:play-services-oss-licenses:17.1.0
154155
com.google.android.gms:play-services-tasks:18.2.0
@@ -306,6 +307,7 @@ org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
306307
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.10.2
307308
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.10.2
308309
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2
310+
org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.10.2
309311
org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.10.2
310312
org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.6.2
311313
org.jetbrains.kotlinx:kotlinx-datetime:0.6.2

cmp-android/dependencies/prodDebugRuntimeClasspath.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ com.google.accompanist:accompanist-drawablepainter:0.37.3
153153
com.google.accompanist:accompanist-permissions:0.34.0
154154
com.google.android.gms:play-services-base:18.5.0
155155
com.google.android.gms:play-services-basement:18.4.0
156+
com.google.android.gms:play-services-location:21.3.0
156157
com.google.android.gms:play-services-maps:18.2.0
157158
com.google.android.gms:play-services-oss-licenses:17.1.0
158159
com.google.android.gms:play-services-tasks:18.2.0
@@ -313,6 +314,7 @@ org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
313314
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.10.2
314315
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.10.2
315316
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2
317+
org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.10.2
316318
org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.10.2
317319
org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.6.2
318320
org.jetbrains.kotlinx:kotlinx-datetime:0.6.2

cmp-android/dependencies/prodReleaseRuntimeClasspath.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ com.google.accompanist:accompanist-drawablepainter:0.37.3
149149
com.google.accompanist:accompanist-permissions:0.34.0
150150
com.google.android.gms:play-services-base:18.5.0
151151
com.google.android.gms:play-services-basement:18.4.0
152+
com.google.android.gms:play-services-location:21.3.0
152153
com.google.android.gms:play-services-maps:18.2.0
153154
com.google.android.gms:play-services-oss-licenses:17.1.0
154155
com.google.android.gms:play-services-tasks:18.2.0
@@ -306,6 +307,7 @@ org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
306307
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.10.2
307308
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.10.2
308309
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2
310+
org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.10.2
309311
org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.10.2
310312
org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.6.2
311313
org.jetbrains.kotlinx:kotlinx-datetime:0.6.2

cmp-android/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
2424
android:maxSdkVersion="32"
2525
tools:ignore="ScopedStorage" />
26+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
27+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
2628
<!--
2729
Firebase automatically adds the AD_ID permission, even though we don't use it. If you use this
2830
permission you must declare how you're using it to Google Play, otherwise the app will be

core/data/src/commonMain/kotlin/com/mifos/core/data/repository/PinPointClientRepository.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ package com.mifos.core.data.repository
1212
import com.mifos.core.common.utils.DataState
1313
import com.mifos.core.model.objects.clients.ClientAddressRequest
1414
import com.mifos.core.model.objects.clients.ClientAddressResponse
15-
import com.mifos.core.network.GenericResponse
15+
import com.mifos.core.network.model.PinpointLocationActionResponse
1616
import kotlinx.coroutines.flow.Flow
1717

1818
/**
@@ -25,16 +25,16 @@ interface PinPointClientRepository {
2525
suspend fun addClientPinpointLocation(
2626
clientId: Int,
2727
address: ClientAddressRequest,
28-
): GenericResponse
28+
): PinpointLocationActionResponse
2929

3030
suspend fun deleteClientAddressPinpointLocation(
3131
apptableId: Int,
3232
datatableId: Int,
33-
): GenericResponse
33+
): PinpointLocationActionResponse
3434

3535
suspend fun updateClientPinpointLocation(
3636
apptableId: Int,
3737
datatableId: Int,
3838
address: ClientAddressRequest,
39-
): GenericResponse
39+
): PinpointLocationActionResponse
4040
}

core/data/src/commonMain/kotlin/com/mifos/core/data/repositoryImp/PinPointClientRepositoryImp.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ package com.mifos.core.data.repositoryImp
1212
import com.mifos.core.common.utils.DataState
1313
import com.mifos.core.common.utils.asDataStateFlow
1414
import com.mifos.core.data.repository.PinPointClientRepository
15+
import com.mifos.core.model.objects.clients.ClientAddressRequest
1516
import com.mifos.core.model.objects.clients.ClientAddressResponse
16-
import com.mifos.core.network.GenericResponse
1717
import com.mifos.core.network.datamanager.DataManagerClient
18+
import com.mifos.core.network.model.PinpointLocationActionResponse
1819
import kotlinx.coroutines.flow.Flow
1920

2021
/**
@@ -31,23 +32,23 @@ class PinPointClientRepositoryImp(
3132

3233
override suspend fun addClientPinpointLocation(
3334
clientId: Int,
34-
address: com.mifos.core.model.objects.clients.ClientAddressRequest,
35-
): GenericResponse {
35+
address: ClientAddressRequest,
36+
): PinpointLocationActionResponse {
3637
return dataManagerClient.addClientPinpointLocation(clientId, address)
3738
}
3839

3940
override suspend fun deleteClientAddressPinpointLocation(
4041
apptableId: Int,
4142
datatableId: Int,
42-
): GenericResponse {
43+
): PinpointLocationActionResponse {
4344
return dataManagerClient.deleteClientAddressPinpointLocation(apptableId, datatableId)
4445
}
4546

4647
override suspend fun updateClientPinpointLocation(
4748
apptableId: Int,
4849
datatableId: Int,
49-
address: com.mifos.core.model.objects.clients.ClientAddressRequest,
50-
): GenericResponse {
50+
address: ClientAddressRequest,
51+
): PinpointLocationActionResponse {
5152
return dataManagerClient.updateClientPinpointLocation(apptableId, datatableId, address)
5253
}
5354
}

core/designsystem/src/androidMain/kotlin/com/mifos/core/designsystem/component/MifosPermissionBox.android.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import androidx.compose.runtime.mutableStateOf
2525
import androidx.compose.runtime.remember
2626
import androidx.compose.runtime.setValue
2727
import androidx.compose.ui.platform.LocalContext
28-
import androidx.compose.ui.platform.LocalLifecycleOwner
2928
import androidx.core.app.ActivityCompat
3029
import androidx.core.content.ContextCompat
3130
import androidx.lifecycle.Lifecycle
3231
import androidx.lifecycle.LifecycleEventObserver
32+
import androidx.lifecycle.compose.LocalLifecycleOwner
3333

3434
@Composable
3535
actual fun PermissionBox(
@@ -169,3 +169,10 @@ actual fun getRequiredPermissionsForExport(): List<String> {
169169
)
170170
}
171171
}
172+
173+
actual fun getRequiredPermissionsForLocation(): List<String> {
174+
return listOf(
175+
Manifest.permission.ACCESS_FINE_LOCATION,
176+
Manifest.permission.ACCESS_COARSE_LOCATION,
177+
)
178+
}

core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosPermissionBox.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ expect fun PermissionBox(
2222
)
2323

2424
expect fun getRequiredPermissionsForExport(): List<String>
25+
26+
expect fun getRequiredPermissionsForLocation(): List<String>

core/designsystem/src/desktopMain/kotlin/com/mifos/core/designsystem/component/MifosPermissionBox.desktop.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ actual fun PermissionBox(
2626
actual fun getRequiredPermissionsForExport(): List<String> {
2727
TODO("Not yet implemented")
2828
}
29+
30+
actual fun getRequiredPermissionsForLocation(): List<String> {
31+
TODO("Not yet implemented")
32+
}

0 commit comments

Comments
 (0)