Merge branch 'Feature/InstitutionContract/upgrade' into Main

This commit is contained in:
2025-10-29 15:11:15 +03:30
2 changed files with 51 additions and 0 deletions

View File

@@ -1,11 +1,27 @@
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.InstitutionContract;
public class InsitutionContractAmendmentPaymentResponse
{
public List<InsitutionContractAmendmentPaymentWorkshopResponse> workshops { get; set; }
public InstitutionContractPaymentOneTimeViewModel OneTime { get; set; }
public InstitutionContractPaymentMonthlyViewModel Monthly { get; set; }
public string ContractStart { get; set; }
public string ContractEnd { get; set; }
public string OneMonthAmount { get; set; }
public string TotalAmount { get; set; }
}
public class InsitutionContractAmendmentPaymentWorkshopResponse
{
public WorkshopServicesViewModel OldServices { get; set; }
public WorkshopServicesViewModel NewServices { get; set; }
public bool IsNewWorkshop { get; set; }
public int PrevPersonnelCount { get; set; }
public int NewPersonnelCount { get; set; }
public double Price { get; set; }
}

View File

@@ -2464,6 +2464,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
var tax = baseAmount*0.10;
var totalPayment = tax+baseAmount;
var res = new InsitutionContractAmendmentPaymentResponse()
{
@@ -2471,6 +2472,40 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
ContractEnd = amendmentEnd.ToFarsi(),
OneMonthAmount = sumOneMonth.ToMoney(),
TotalAmount = baseAmount.ToMoney(),
workshops = institutionContractAmendmentTemp.NewWorkshops
.Select(x=>
{
var prevWorkshop = institutionContractAmendmentTemp.PrevWorkshops
.FirstOrDefault(w=> w.Id == x.Id);
var isNewWorkshop = prevWorkshop == null;
return new InsitutionContractAmendmentPaymentWorkshopResponse()
{
IsNewWorkshop = isNewWorkshop,
NewPersonnelCount = x.CountPerson,
PrevPersonnelCount = prevWorkshop?.CountPerson??0,
Price = x.PriceDifference,
OldServices = prevWorkshop != null? new WorkshopServicesViewModel()
{
Contract = prevWorkshop.ContractAndCheckout,
ContractInPerson = prevWorkshop.ContractAndCheckoutInPerson,
CustomizeCheckout = prevWorkshop.CustomizeCheckout,
Insurance = prevWorkshop.Insurance,
InsuranceInPerson = prevWorkshop.InsuranceInPerson,
RollCall = prevWorkshop.RollCall,
RollCallInPerson = prevWorkshop.RollCallInPerson,
}: new WorkshopServicesViewModel(),
NewServices = new WorkshopServicesViewModel()
{
Contract = x.ContractAndCheckout,
ContractInPerson = x.ContractAndCheckoutInPerson,
CustomizeCheckout = x.CustomizeCheckout,
Insurance = x.Insurance,
InsuranceInPerson = x.InsuranceInPerson,
RollCall = x.RollCall,
RollCallInPerson = x.RollCallInPerson,
},
};
}).ToList()
};
res.OneTime = new InstitutionContractPaymentOneTimeViewModel()