feat: add contracting party response class and update endpoints for institution contract creation
This commit is contained in:
@@ -307,6 +307,11 @@ public interface IInstitutionContractApplication
|
||||
Task<OperationResult> CreationComplete(InstitutionContractExtensionCompleteRequest request);
|
||||
}
|
||||
|
||||
public class CreationSetContractingPartyResponse
|
||||
{
|
||||
public long RepresentativeId { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractCreationWorkshopsResponse
|
||||
{
|
||||
public List<WorkshopTempViewModel> WorkshopTemps { get; set; }
|
||||
|
||||
@@ -33,5 +33,5 @@ public class InstitutionContractPaymentOneTimeViewModel
|
||||
}
|
||||
public class InstitutionContractPaymentMonthlyViewModel:InstitutionContractPaymentOneTimeViewModel
|
||||
{
|
||||
public List<MonthlyInstallment> Installments { get; set; }
|
||||
public List<MonthlyInstallment> Installments { get; set; } = [];
|
||||
}
|
||||
@@ -1698,6 +1698,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
return _institutionContractRepository.CreationComplete(request);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
||||
CreateInstitutionContractLegalPartyRequest request, long representativeId, string address, string city,
|
||||
string state)
|
||||
|
||||
@@ -3422,7 +3422,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
TotalAmount = baseAmount.ToMoney(),
|
||||
Tax = tax.ToMoney(),
|
||||
PaymentAmount = total.ToMoney()
|
||||
}
|
||||
},
|
||||
Monthly = new(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5137,6 +5138,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
BirthDateFa = apiRespons.IdentificationInformation.BirthDate,
|
||||
};
|
||||
result.LegalParty = null;
|
||||
result.LegalType = LegalType.Real;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5153,6 +5155,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
PhoneNumber = request.Mobile,
|
||||
};
|
||||
result.RealParty = null;
|
||||
result.LegalType = LegalType.Legal;
|
||||
}
|
||||
|
||||
idNumberSeri = apiRespons.IdentificationInformation.ShenasnameSeri;
|
||||
@@ -5266,6 +5269,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
var creationTemp = await _institutionContractCreationTemp.Find(x => x.Id == request.TempId)
|
||||
.FirstOrDefaultAsync();
|
||||
// creationTemp.SetContractingPartyInfo(request.LegalType,request.RealParty,request.LegalParty);
|
||||
|
||||
if (creationTemp == null)
|
||||
{
|
||||
@@ -5516,9 +5520,9 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
else
|
||||
{
|
||||
var monthly = institutionTemp.MonthlyPayment;
|
||||
|
||||
|
||||
institutionTemp.MonthlyPayment.TotalAmountWithoutDiscount = monthly.TotalAmount;
|
||||
|
||||
|
||||
res.Monthly = new()
|
||||
{
|
||||
PaymentAmount = monthly.PaymentAmount,
|
||||
|
||||
@@ -533,7 +533,7 @@ public class institutionContractController : AdminBaseController
|
||||
|
||||
#region Create
|
||||
|
||||
[HttpPost("creation/inquiry/")]
|
||||
[HttpPost("creation/inquiry")]
|
||||
public async Task<ActionResult<InstitutionContractCreationInquiryResult>> CreationInquiry(
|
||||
InstitutionContractCreationInquiryRequest request)
|
||||
{
|
||||
@@ -541,9 +541,8 @@ public class institutionContractController : AdminBaseController
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpGet("creation/get-representative")]
|
||||
public async Task<ActionResult<InstitutionContractCreationGetRepresentativeIdResponse>> GetRepresentatives(
|
||||
string nationalCode)
|
||||
[HttpPost("creation/set-contracting-party")]
|
||||
public async Task<ActionResult<InstitutionContractCreationGetRepresentativeIdResponse>> GetRepresentatives(string nationalCode)
|
||||
{
|
||||
var res = await _contractingPartyApplication.GetRepresentativeIdByNationalCode(nationalCode);
|
||||
return new InstitutionContractCreationGetRepresentativeIdResponse()
|
||||
|
||||
Reference in New Issue
Block a user