= Parceler
+
+actual typealias TypeParceler {
+ fun create(parcel: Parcel): P
+
+ fun P.write(parcel: Parcel, flags: Int)
+}
+
+expect annotation class TypeParceler {
+ actual fun create(parcel: Parcel): P
+ actual fun P.write(parcel: Parcel, flags: Int)
+}
+
+actual annotation class TypeParceler {
+ actual fun create(parcel: Parcel): P
+ actual fun P.write(parcel: Parcel, flags: Int)
+}
+
+actual annotation class TypeParceler {
+ actual fun create(parcel: Parcel): P
+ actual fun P.write(parcel: Parcel, flags: Int)
+}
+
+actual annotation class TypeParceler {
+ actual fun create(parcel: Parcel): P
+ actual fun P.write(parcel: Parcel, flags: Int)
+}
+
+actual annotation class TypeParceler>
}
diff --git a/core/data/src/commonMain/kotlin/org/mifospay/core/data/repository/SelfServiceRepository.kt b/core/data/src/commonMain/kotlin/org/mifospay/core/data/repository/SelfServiceRepository.kt
index 307bfad04..dc0c437ff 100644
--- a/core/data/src/commonMain/kotlin/org/mifospay/core/data/repository/SelfServiceRepository.kt
+++ b/core/data/src/commonMain/kotlin/org/mifospay/core/data/repository/SelfServiceRepository.kt
@@ -24,9 +24,9 @@ import org.mifospay.core.model.entity.client.ClientAccounts
import org.mifospay.core.network.model.CommonResponse
interface SelfServiceRepository {
- suspend fun loginSelf(payload: AuthenticationPayload): Flow
> {
+ return try {
+ val result = withContext(ioDispatcher) {
+ apiManager.searchApi.searchResources(query, resources, exactMatch)
+ }
+
+ Result.Success(result)
+ } catch (e: Exception) {
+ Result.Error(e)
+ }
}
}
diff --git a/core/data/src/commonMain/kotlin/org/mifospay/core/data/repositoryImp/SelfServiceRepositoryImpl.kt b/core/data/src/commonMain/kotlin/org/mifospay/core/data/repositoryImp/SelfServiceRepositoryImpl.kt
index 32d33bac5..66b287fd2 100644
--- a/core/data/src/commonMain/kotlin/org/mifospay/core/data/repositoryImp/SelfServiceRepositoryImpl.kt
+++ b/core/data/src/commonMain/kotlin/org/mifospay/core/data/repositoryImp/SelfServiceRepositoryImpl.kt
@@ -36,15 +36,24 @@ class SelfServiceRepositoryImpl(
private val dispatcher: CoroutineDispatcher,
) : SelfServiceRepository {
- override suspend fun loginSelf(payload: AuthenticationPayload): Flow
>
+ suspend fun beneficiaryList(): Flow
>
@GET(ApiEndPoints.BENEFICIARIES + "/tpt/template")
- fun beneficiaryTemplate(): Flow
>
@@ -38,7 +38,7 @@ interface DocumentService {
*/
@POST("{entityType}/{entityId}/" + ApiEndPoints.DOCUMENTS)
@Multipart
- fun createDocument(
+ suspend fun createDocument(
@Path("entityType") entityType: String,
@Path("entityId") entityId: Int,
@Part("name") nameOfDocument: String,
@@ -59,7 +59,7 @@ interface DocumentService {
* @return ResponseBody
*/
@GET("{entityType}/{entityId}/" + ApiEndPoints.DOCUMENTS + "/{documentId}/attachment")
- fun downloadDocument(
+ suspend fun downloadDocument(
@Path("entityType") entityType: String,
@Path("entityId") entityId: Int,
@Path("documentId") documentId: Int,
@@ -77,7 +77,7 @@ interface DocumentService {
* @param documentId - Document Id
*/
@DELETE("{entityType}/{entityId}/" + ApiEndPoints.DOCUMENTS + "/{documentId}")
- fun removeDocument(
+ suspend fun removeDocument(
@Path("entityType") entityType: String,
@Path("entityId") entityId: Int,
@Path("documentId") documentId: Int,
@@ -100,7 +100,7 @@ interface DocumentService {
*/
@PUT("{entityType}/{entityId}/" + ApiEndPoints.DOCUMENTS + "/{documentId}")
@Multipart
- fun updateDocument(
+ suspend fun updateDocument(
@Path("entityType") entityType: String,
@Path("entityId") entityId: Int,
@Path("documentId") documentId: Int,
diff --git a/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/InvoiceService.kt b/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/InvoiceService.kt
index 7052adb17..94ac56fff 100644
--- a/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/InvoiceService.kt
+++ b/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/InvoiceService.kt
@@ -17,35 +17,35 @@ import de.jensklingenberg.ktorfit.http.PUT
import de.jensklingenberg.ktorfit.http.Path
import kotlinx.coroutines.flow.Flow
import org.mifospay.core.model.entity.Invoice
-import org.mifospay.core.network.ApiEndPoints
import org.mifospay.core.network.model.GenericResponse
+import org.mifospay.core.network.utils.ApiEndPoints
// TODO:: Fix this endpoints, there's no such endpoint for invoices
interface InvoiceService {
@GET(ApiEndPoints.DATATABLES + "/invoices/{clientId}")
- fun getInvoices(@Path("clientId") clientId: Int): Flow
>
+ suspend fun getInvoices(@Path("clientId") clientId: Int): Flow
>
@GET(ApiEndPoints.DATATABLES + "/invoices/{clientId}/{invoiceId}")
- fun getInvoice(
+ suspend fun getInvoice(
@Path("clientId") clientId: Int,
@Path("invoiceId") invoiceId: Int,
): Flow
>
+ suspend fun fetchKYCLevel1Details(@Path("clientId") clientId: Int): Flow
>
@POST(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}")
- fun addKYCLevel1Details(
+ suspend fun addKYCLevel1Details(
@Path("clientId") clientId: Int,
@Body kycLevel1Details: KYCLevel1Details,
): Flow
>
+ suspend fun fetchNotifications(@Path("clientId") clientId: Long): Flow
>
}
diff --git a/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/RegistrationService.kt b/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/RegistrationService.kt
index d93401cf6..f93f575f4 100644
--- a/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/RegistrationService.kt
+++ b/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/RegistrationService.kt
@@ -13,12 +13,12 @@ import de.jensklingenberg.ktorfit.http.Body
import de.jensklingenberg.ktorfit.http.POST
import org.mifospay.core.model.entity.register.RegisterPayload
import org.mifospay.core.model.entity.register.UserVerify
-import org.mifospay.core.network.ApiEndPoints
+import org.mifospay.core.network.utils.ApiEndPoints
interface RegistrationService {
@POST(ApiEndPoints.REGISTRATION)
- fun registerUser(@Body registerPayload: RegisterPayload)
+ suspend fun registerUser(@Body registerPayload: RegisterPayload)
@POST(ApiEndPoints.REGISTRATION + "/user")
- fun verifyUser(@Body userVerify: UserVerify)
+ suspend fun verifyUser(@Body userVerify: UserVerify)
}
diff --git a/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/RunReportService.kt b/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/RunReportService.kt
index c502d067f..b32f50fab 100644
--- a/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/RunReportService.kt
+++ b/core/network/src/commonMain/kotlin/org/mifospay/core/network/services/RunReportService.kt
@@ -13,11 +13,11 @@ import de.jensklingenberg.ktorfit.http.GET
import de.jensklingenberg.ktorfit.http.Query
import kotlinx.coroutines.flow.Flow
import org.mifospay.core.model.entity.accounts.savings.TransactionsEntity
-import org.mifospay.core.network.ApiEndPoints
+import org.mifospay.core.network.utils.ApiEndPoints
interface RunReportService {
@GET(ApiEndPoints.RUN_REPORT + "/Savings Transaction Receipt")
- fun getTransactionReceipt(
+ suspend fun getTransactionReceipt(
@Query("output-type") outputType: String,
@Query("R_transactionId") transactionId: String,
): Flow
>
+ suspend fun getSavedCards(@Path("clientId") clientId: Int): Flow
>
@DELETE(ApiEndPoints.DATATABLES + "/saved_cards/{clientId}/{cardId}")
- fun deleteCard(
+ suspend fun deleteCard(
@Path("clientId") clientId: Int,
@Path("cardId") cardId: Int,
): Flow
>
+ ): List
>
+ suspend fun deliveryMethods(): Flow
>
@POST(ApiEndPoints.TWOFACTOR)
- fun requestOTP(@Query("deliveryMethod") deliveryMethod: String): Flow
>
+ suspend fun users(): Flow
>
@POST(ApiEndPoints.USER)
- fun createUser(@Body user: NewUser): Flow
(
+ initialState: S,
+) : ViewModel() {
+ protected val mutableStateFlow: MutableStateFlow = MutableStateFlow(initialState)
+ private val eventChannel: Channel = mutableStateFlow.asStateFlow()
+
+ /**
+ * A [Flow] of one-shot events. These may be received and consumed by only a single consumer.
+ * Any additional consumers will receive no events.
+ */
+ val eventFlow: Flow