feat: add PublicId to institution contract and update response models for calculators

This commit is contained in:
MahanCh
2025-08-23 10:50:07 +03:30
parent 76e5a93ee5
commit 8bde7aa3d1
3 changed files with 38 additions and 18 deletions

View File

@@ -582,7 +582,7 @@ public class institutionContractController : AdminBaseController
}
[HttpPost("create/workshop-service-calculator")]
public ActionResult<InstitutionPlanViewModel> WorkshopServiceCalculator([FromBody]CreateWorkshopTemp command)
public ActionResult<WorkshopServiceCalculatorResponse> WorkshopServiceCalculator([FromBody]CreateWorkshopTemp command)
{
var workshopTemp = new WorkshopTempViewModel
{
@@ -596,16 +596,31 @@ public class institutionContractController : AdminBaseController
InsuranceInPerson = command.InsuranceInPerson
};
return _temporaryClientRegistration.GetInstitutionPlanForWorkshop(workshopTemp);
var response = _temporaryClientRegistration.GetInstitutionPlanForWorkshop(workshopTemp);
var result = new WorkshopServiceCalculatorResponse
{
TotalAmount = response.OnlineAndInPersonSumAmountDouble
};
return result;
}
[HttpPost("create/institution-plan-calculator")]
public async Task<ActionResult<ReviewAndPaymentViewModel>> InstitutionPlanCalculator(
public async Task<ActionResult<InstitutionPlanCalculatorResponse>> InstitutionPlanCalculator(
[FromBody] InstitutionPlanCalculatorRequest request)
{
var res = await _temporaryClientRegistration.GetTotalPaymentAndWorkshopList(0,
request.workshopList, paymentModel: request.PaymentModel, contractStartType: request.ContractStartType);
return res;
request.workshopList, paymentModel: request.PaymentModel, contractStartType: request.ContractStartType,duration:request.Duration);
var response = new InstitutionPlanCalculatorResponse
{
Installments = res.MonthlyInstallments,
OneTimeTotalAmountWithoutTax = res.OneTimeWithoutTaxPaymentDouble,
MonthlyTotalAmountWithoutTax = res.MonthlyWithoutTaxPaymentDouble,
OneTimeTotalAmount = res.OneTimeTotalPaymentDouble,
MonthlyTotalAmount= res.MonthlyTotalPaymentDouble,
TotalTax = res.ValueAddedTaxDouble,
};
return response;
}
/// <summary>
@@ -649,8 +664,24 @@ public class institutionContractController : AdminBaseController
}
}
public class InstitutionPlanCalculatorResponse
{
public double TotalAmountWithTax { get; set; }
public double OneTimeTotalAmountWithoutTax { get; set; }
public double TotalTax { get; set; }
public List<MonthlyInstallment> Installments { get; set; }
public double OneTimeTotalAmount { get; set; }
public double MonthlyTotalAmount { get; set; }
public double MonthlyTotalAmountWithoutTax { get; set; }
}
public class WorkshopServiceCalculatorResponse
{
public double TotalAmount { get; set; }
}
public record InstitutionPlanCalculatorRequest(List<WorkshopTempViewModel> workshopList,
string PeriodModel = "12",
InstitutionContractDuration Duration = InstitutionContractDuration.TwelveMonths,
string PaymentModel = "OneTime",
string ContractStartType = "currentMonth");