Skip to content

Instantly share code, notes, and snippets.

View Ochornma's full-sized avatar
🎯
Looking for new opportunities

Promise Ochornma Ochornma

🎯
Looking for new opportunities
View GitHub Profile
data class UnverifiedData(
val address: String,
val bvn: String,
val bvn_phone_number: Any,
val country_code: String,
val created_at: String,
val date_of_birth: Any,
val devices_code: String,
val email: String,
interface SoftKashApiService {
@GET("admins")
fun getAdminsAsync(): Deferred<GetAdminResponse>
@Multipart
@POST("admins")
fun addAdminsAsync(
@Part("first_name") firstName: RequestBody,
class SoftKashNetworkDataSourceImpl(
private val softKashApiService: SoftKashApiService
) : SoftKashNetworkDataSource {
private val _getAllAdmins = MutableLiveData<GetAdminResponse>()
override val getAllAdmins: LiveData<GetAdminResponse>
get() = _getAllAdmins
override suspend fun fetchAllAdmins() {
interface SoftKashNetworkDataSource {
val getAllAdmins: LiveData<GetAdminResponse>
suspend fun fetchAllAdmins()
val getAllLoanProducts: LiveData<LoanProductResponse>
suspend fun getLoanProducts()
suspend fun getTransactions(paginate: String, result: (Response<TransactionResponse>) -> Unit)
class SoftKashRepositoryImpl(
private val softKashDao: SoftKashDao,
private val softKashNetworkDataSource: SoftKashNetworkDataSource
) : SoftKashRepository {
init {
softKashNetworkDataSource.getAllAdmins.observeForever {admins ->
persistAdmins(admins)
}
interface SoftKashRepository {
suspend fun getAllAdmins(): LiveData<out GetAdminResponse>
suspend fun getAllLoanProducts(): LiveData<out LoanProductResponse>
suspend fun getAllTransactions(paginate: String, result: (Response<TransactionResponse>) -> Unit)
suspend fun getAllLoans(paginate: String, result: (Response<LoansResponse>) -> Unit)
suspend fun getUserNextOfKin(userId: Int, result: ( Response<NestOfKinResponse>) -> Unit)
suspend fun getUserEmployerDetail(userId: Int, result: (Response<EmployerResponse>) -> Unit)
suspend fun deleteDocument(id: Int, result: (Response<DocumentDeleteResponse>) -> Unit)
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".ui.verifyBvn.VerifyBVNFragment">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="200dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
<resources>
<string name="app_name">SoKashAdmin</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title">Android Studio</string>
<string name="nav_header_subtitle">[email protected]</string>
<string name="nav_header_desc">Navigation header</string>
<string name="action_settings">Settings</string>
<string name="menu_home">Dashboard</string>
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mobile_navigation"
app:startDestination="@+id/login">
<fragment
android:id="@+id/dashboard"
android:name="com.app.softkashadmin.ui.dashboard.DashboardFragment"