File tree Expand file tree Collapse file tree
data/src/commonMain/kotlin/com/mifos/core/data
domain/src/commonMain/kotlin/com/mifos/core/domain
model/src/commonMain/kotlin/com/mifos/core/model/objects/account/loan/guarantor
network/src/commonMain/kotlin/com/mifos/core/network
feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/createGuarantor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 */
1010package com.mifos.core.data.mappers.loan
1111
12+ import com.mifos.core.model.objects.account.loan.guarantor.CreateGuarantor
1213import com.mifos.core.model.objects.account.loan.guarantor.CreateGuarantorInput
13- import com.mifos.core.model.objects.account.loan.guarantor.CreateGuarantorResponseDto
14- import com.mifos.core.model.objects.account.loan.guarantor.CreatedGuarantor
1514import com.mifos.core.model.objects.account.loan.guarantor.GuarantorAccountTemplate
1615import com.mifos.core.model.objects.account.loan.guarantor.GuarantorRelationshipOption
1716import com.mifos.core.model.objects.account.loan.guarantor.GuarantorTemplate
1817import com.mifos.core.model.objects.account.loan.guarantor.GuarantorType
18+ import com.mifos.core.network.dto.loans.CreateGuarantorResponseDto
1919import com.mifos.core.network.dto.loans.GuarantorAccountTemplateDto
2020import com.mifos.core.network.dto.loans.GuarantorRelationshipOptionDto
2121import com.mifos.core.network.dto.loans.GuarantorRequestDto
@@ -33,8 +33,8 @@ fun GuarantorRelationshipOptionDto.toDomain(): GuarantorRelationshipOption =
3333 name = name,
3434 )
3535
36- fun CreateGuarantorResponseDto.toDomain (): CreatedGuarantor =
37- CreatedGuarantor (
36+ fun CreateGuarantorResponseDto.toDomain (): CreateGuarantor =
37+ CreateGuarantor (
3838 resourceId = resourceId,
3939 loanId = loanId,
4040 officeId = officeId,
Original file line number Diff line number Diff line change 1010package com.mifos.core.data.repository
1111
1212import com.mifos.core.common.utils.DataState
13+ import com.mifos.core.model.objects.account.loan.guarantor.CreateGuarantor
1314import com.mifos.core.model.objects.account.loan.guarantor.CreateGuarantorInput
14- import com.mifos.core.model.objects.account.loan.guarantor.CreatedGuarantor
1515import com.mifos.core.model.objects.account.loan.guarantor.GuarantorAccountTemplate
1616import com.mifos.core.model.objects.account.loan.guarantor.GuarantorTemplate
1717
@@ -22,7 +22,7 @@ interface LoanCreateGuarantorRepository {
2222 suspend fun createGuarantor (
2323 loanId : Int ,
2424 createGuarantorInput : CreateGuarantorInput ,
25- ): DataState <CreatedGuarantor >
25+ ): DataState <CreateGuarantor >
2626
2727 suspend fun getGuarantorAccountTemplate (
2828 loanId : Int ,
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ import com.mifos.core.data.mappers.loan.toDto
1515import com.mifos.core.data.repository.LoanCreateGuarantorRepository
1616import com.mifos.core.data.util.NetworkMonitor
1717import com.mifos.core.data.util.runAsDataState
18+ import com.mifos.core.model.objects.account.loan.guarantor.CreateGuarantor
1819import com.mifos.core.model.objects.account.loan.guarantor.CreateGuarantorInput
19- import com.mifos.core.model.objects.account.loan.guarantor.CreatedGuarantor
2020import com.mifos.core.model.objects.account.loan.guarantor.GuarantorAccountTemplate
2121import com.mifos.core.model.objects.account.loan.guarantor.GuarantorTemplate
2222import com.mifos.core.network.datamanager.DataManagerLoan
@@ -40,7 +40,7 @@ class LoanCreateGuarantorRepositoryImp(
4040 override suspend fun createGuarantor (
4141 loanId : Int ,
4242 createGuarantorInput : CreateGuarantorInput ,
43- ): DataState <CreatedGuarantor > {
43+ ): DataState <CreateGuarantor > {
4444 return runAsDataState(
4545 networkMonitor,
4646 ioDispatcher,
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ import com.mifos.core.domain.useCases.ValidateServerPortUseCase
9090import com.mifos.core.domain.useCases.ValidateServerProtocolUseCase
9191import com.mifos.core.domain.useCases.ValidateServerTenantUseCase
9292import com.mifos.core.domain.useCases.createGuarantor.CreateGuarantorUseCase
93+ import com.mifos.core.domain.useCases.createGuarantor.GetGuarantorAccountTemplateUseCase
9394import com.mifos.core.domain.useCases.createGuarantor.GetGuarantorTemplateUseCase
9495import com.mifos.core.domain.useCases.loanChargeOff.GetLoanChargeOffTemplateUseCase
9596import com.mifos.core.domain.useCases.loanChargeOff.LoanChargeOffUseCase
@@ -107,6 +108,7 @@ val UseCaseModule = module {
107108 factoryOf(::ApproveSavingsApplicationUseCase )
108109 factoryOf(::CreateChargesUseCase )
109110 factoryOf(::CreateGuarantorUseCase )
111+ factoryOf(::GetGuarantorAccountTemplateUseCase )
110112 factoryOf(::CreateClientIdentifierUseCase )
111113 factoryOf(::CalculateLoanScheduleUseCase )
112114 factoryOf(::CreateGroupLoansAccountUseCase )
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ package com.mifos.core.domain.useCases.createGuarantor
1111
1212import com.mifos.core.common.utils.DataState
1313import com.mifos.core.data.repository.LoanCreateGuarantorRepository
14+ import com.mifos.core.model.objects.account.loan.guarantor.CreateGuarantor
1415import com.mifos.core.model.objects.account.loan.guarantor.CreateGuarantorInput
15- import com.mifos.core.model.objects.account.loan.guarantor.CreatedGuarantor
1616
1717class CreateGuarantorUseCase (
1818 private val repository : LoanCreateGuarantorRepository ,
1919) {
2020 suspend operator fun invoke (
2121 loanId : Int ,
2222 createGuarantorInput : CreateGuarantorInput ,
23- ): DataState <CreatedGuarantor > = repository.createGuarantor(loanId, createGuarantorInput)
23+ ): DataState <CreateGuarantor > = repository.createGuarantor(loanId, createGuarantorInput)
2424}
Original file line number Diff line number Diff line change 99 */
1010package com.mifos.core.model.objects.account.loan.guarantor
1111
12- data class CreatedGuarantor (
12+ data class CreateGuarantor (
1313 val officeId : Long ,
1414 val loanId : Long ,
1515 val resourceId : Long ,
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ data class CreateGuarantorInput(
1515 val clientRelationshipTypeId : Long ,
1616 val dateFormat : String = " dd-MM-yyyy" ,
1717 val entityId : Int? = null ,
18- val guarantorTypeId : Long ,
18+ val guarantorTypeId : Long? ,
1919 val locale : String = DateConstants .LOCALE ,
2020 val firstname : String? = null ,
2121 val lastname : String? = null ,
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import com.mifos.core.common.utils.extractErrorMessage
1313import com.mifos.core.datastore.UserPreferencesRepository
1414import com.mifos.core.model.objects.account.loan.LoanDisbursement
1515import com.mifos.core.model.objects.account.loan.RepaymentSchedule
16- import com.mifos.core.model.objects.account.loan.guarantor.CreateGuarantorResponseDto
1716import com.mifos.core.model.objects.account.loan.reschedules.LoanRescheduleApprovalRequest
1817import com.mifos.core.model.objects.account.loan.reschedules.LoanRescheduleRejectionRequest
1918import com.mifos.core.model.objects.account.loan.reschedules.LoanRescheduleRequest
@@ -24,6 +23,7 @@ import com.mifos.core.model.objects.account.loan.transfer.AccountTransferRespons
2423import com.mifos.core.model.objects.account.loan.transfer.AccountTransferTemplate
2524import com.mifos.core.network.BaseApiManager
2625import com.mifos.core.network.GenericResponse
26+ import com.mifos.core.network.dto.loans.CreateGuarantorResponseDto
2727import com.mifos.core.network.dto.loans.GuarantorAccountTemplateDto
2828import com.mifos.core.network.dto.loans.GuarantorRequestDto
2929import com.mifos.core.network.dto.loans.GuarantorTemplateDto
Original file line number Diff line number Diff line change 77 *
88 * See https://github.com/openMF/mifos-x-field-officer-app/blob/master/LICENSE.md
99 */
10- package com.mifos.core.model.objects.account.loan.guarantor
10+ package com.mifos.core.network.dto.loans
1111
1212import kotlinx.serialization.Serializable
1313
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ data class GuarantorRequestDto(
1616 val clientRelationshipTypeId : Long ,
1717 val dateFormat : String ,
1818 val entityId : Int? ,
19- val guarantorTypeId : Long ,
19+ val guarantorTypeId : Long? ,
2020 val locale : String ,
2121
2222 val firstname : String? ,
You can’t perform that action at this time.
0 commit comments