Merge branch 'Feature/institution-contract/refactor-creation' into Main
This commit is contained in:
@@ -310,6 +310,11 @@ public interface IInstitutionContractApplication
|
|||||||
Task<OperationResult> CreationComplete(InstitutionContractExtensionCompleteRequest request);
|
Task<OperationResult> CreationComplete(InstitutionContractExtensionCompleteRequest request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CreationSetContractingPartyResponse
|
||||||
|
{
|
||||||
|
public long RepresentativeId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class InstitutionContractCreationWorkshopsResponse
|
public class InstitutionContractCreationWorkshopsResponse
|
||||||
{
|
{
|
||||||
public List<WorkshopTempViewModel> WorkshopTemps { get; set; }
|
public List<WorkshopTempViewModel> WorkshopTemps { get; set; }
|
||||||
|
|||||||
@@ -33,5 +33,5 @@ public class InstitutionContractPaymentOneTimeViewModel
|
|||||||
}
|
}
|
||||||
public class InstitutionContractPaymentMonthlyViewModel:InstitutionContractPaymentOneTimeViewModel
|
public class InstitutionContractPaymentMonthlyViewModel:InstitutionContractPaymentOneTimeViewModel
|
||||||
{
|
{
|
||||||
public List<MonthlyInstallment> Installments { get; set; }
|
public List<MonthlyInstallment> Installments { get; set; } = [];
|
||||||
}
|
}
|
||||||
@@ -1714,6 +1714,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
return _institutionContractRepository.CreationComplete(request);
|
return _institutionContractRepository.CreationComplete(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
||||||
CreateInstitutionContractLegalPartyRequest request, long representativeId, string address, string city,
|
CreateInstitutionContractLegalPartyRequest request, long representativeId, string address, string city,
|
||||||
string state)
|
string state)
|
||||||
|
|||||||
@@ -3673,7 +3673,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
TotalAmount = baseAmount.ToMoney(),
|
TotalAmount = baseAmount.ToMoney(),
|
||||||
Tax = tax.ToMoney(),
|
Tax = tax.ToMoney(),
|
||||||
PaymentAmount = total.ToMoney()
|
PaymentAmount = total.ToMoney()
|
||||||
}
|
},
|
||||||
|
Monthly = new(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5388,6 +5389,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
BirthDateFa = apiRespons.IdentificationInformation.BirthDate,
|
BirthDateFa = apiRespons.IdentificationInformation.BirthDate,
|
||||||
};
|
};
|
||||||
result.LegalParty = null;
|
result.LegalParty = null;
|
||||||
|
result.LegalType = LegalType.Real;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -5404,6 +5406,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
PhoneNumber = request.Mobile,
|
PhoneNumber = request.Mobile,
|
||||||
};
|
};
|
||||||
result.RealParty = null;
|
result.RealParty = null;
|
||||||
|
result.LegalType = LegalType.Legal;
|
||||||
}
|
}
|
||||||
|
|
||||||
idNumberSeri = apiRespons.IdentificationInformation.ShenasnameSeri;
|
idNumberSeri = apiRespons.IdentificationInformation.ShenasnameSeri;
|
||||||
@@ -5517,6 +5520,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
|
|
||||||
var creationTemp = await _institutionContractCreationTemp.Find(x => x.Id == request.TempId)
|
var creationTemp = await _institutionContractCreationTemp.Find(x => x.Id == request.TempId)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
|
// creationTemp.SetContractingPartyInfo(request.LegalType,request.RealParty,request.LegalParty);
|
||||||
|
|
||||||
if (creationTemp == null)
|
if (creationTemp == null)
|
||||||
{
|
{
|
||||||
@@ -5767,9 +5771,9 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var monthly = institutionTemp.MonthlyPayment;
|
var monthly = institutionTemp.MonthlyPayment;
|
||||||
|
|
||||||
institutionTemp.MonthlyPayment.TotalAmountWithoutDiscount = monthly.TotalAmount;
|
institutionTemp.MonthlyPayment.TotalAmountWithoutDiscount = monthly.TotalAmount;
|
||||||
|
|
||||||
res.Monthly = new()
|
res.Monthly = new()
|
||||||
{
|
{
|
||||||
PaymentAmount = monthly.PaymentAmount,
|
PaymentAmount = monthly.PaymentAmount,
|
||||||
|
|||||||
@@ -540,7 +540,7 @@ public class institutionContractController : AdminBaseController
|
|||||||
|
|
||||||
#region Create
|
#region Create
|
||||||
|
|
||||||
[HttpPost("creation/inquiry/")]
|
[HttpPost("creation/inquiry")]
|
||||||
public async Task<ActionResult<InstitutionContractCreationInquiryResult>> CreationInquiry(
|
public async Task<ActionResult<InstitutionContractCreationInquiryResult>> CreationInquiry(
|
||||||
InstitutionContractCreationInquiryRequest request)
|
InstitutionContractCreationInquiryRequest request)
|
||||||
{
|
{
|
||||||
@@ -548,9 +548,8 @@ public class institutionContractController : AdminBaseController
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("creation/get-representative")]
|
[HttpPost("creation/set-contracting-party")]
|
||||||
public async Task<ActionResult<InstitutionContractCreationGetRepresentativeIdResponse>> GetRepresentatives(
|
public async Task<ActionResult<InstitutionContractCreationGetRepresentativeIdResponse>> GetRepresentatives(string nationalCode)
|
||||||
string nationalCode)
|
|
||||||
{
|
{
|
||||||
var res = await _contractingPartyApplication.GetRepresentativeIdByNationalCode(nationalCode);
|
var res = await _contractingPartyApplication.GetRepresentativeIdByNationalCode(nationalCode);
|
||||||
return new InstitutionContractCreationGetRepresentativeIdResponse()
|
return new InstitutionContractCreationGetRepresentativeIdResponse()
|
||||||
|
|||||||
Reference in New Issue
Block a user