feat: add PublicId to institution contract and update response models for calculators
This commit is contained in:
@@ -11,17 +11,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "RegistrationStatus",
|
||||
table: "InstitutionContractTemps",
|
||||
type: "int",
|
||||
maxLength: 30,
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(30)",
|
||||
oldMaxLength: 30,
|
||||
oldNullable: true);
|
||||
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "PublicId",
|
||||
|
||||
@@ -5586,7 +5586,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("RegistrationStatus")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user