Compare commits
18 Commits
master
...
Feature/In
| Author | SHA1 | Date | |
|---|---|---|---|
| 87d47fa0d9 | |||
| c7d4481a6d | |||
| 4b52d144e0 | |||
| 90a1683047 | |||
| d078feccf9 | |||
| c6a7e0a0bd | |||
| fcf2b38457 | |||
| 7b71bd36b1 | |||
| 62900a22a1 | |||
| e6977b29fc | |||
| 6e902011ca | |||
| 7cce903f6e | |||
| 4d6077c93d | |||
| c36e81e263 | |||
| 818d88d859 | |||
| 1a70569a36 | |||
| 8d24339f04 | |||
| bea858d4e7 |
@@ -28,6 +28,7 @@ public interface ISmsService
|
||||
Task<double> GetCreditAmount();
|
||||
|
||||
public Task<bool> SendInstitutionCreationVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId);
|
||||
public Task<bool> SendInstitutionAmendmentVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId);
|
||||
|
||||
public Task<bool> SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
|
||||
long contractingPartyId, long institutionContractId);
|
||||
|
||||
@@ -6,7 +6,6 @@ using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
@@ -77,4 +76,6 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
|
||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected);
|
||||
Task<List<InstitutionContractPrintViewModel>> PrintAllAsync(List<long> ids);
|
||||
Task AmendmentComplete(InstitutionContractAmendmentCompleteRequest request);
|
||||
Task<GetInstitutionAmendmentVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id, long amendmentId);
|
||||
}
|
||||
@@ -252,6 +252,11 @@ public class InstitutionContract : EntityBase
|
||||
{
|
||||
WorkshopGroup = null;
|
||||
}
|
||||
|
||||
public void AddAmendment(InstitutionContractAmendment amendment)
|
||||
{
|
||||
Amendments.Add(amendment);
|
||||
}
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendment : EntityBase
|
||||
@@ -259,14 +264,15 @@ public class InstitutionContractAmendment : EntityBase
|
||||
private InstitutionContractAmendment(){}
|
||||
public InstitutionContractAmendment(long institutionContractId,
|
||||
List<InstitutionContractInstallment> installments, double amount, bool hasInstallment,
|
||||
InstitutionContractAmendmentChange amendmentChange, long lawId)
|
||||
List<InstitutionContractAmendmentChange> amendmentChanges, long lawId)
|
||||
{
|
||||
InstitutionContractId = institutionContractId;
|
||||
Installments = installments is { Count: > 0} ? installments : [];
|
||||
Amount = amount;
|
||||
HasInstallment = hasInstallment;
|
||||
AmendmentChanges = [amendmentChange];
|
||||
AmendmentChanges = amendmentChanges;
|
||||
LawId = lawId;
|
||||
VerificationStatus = InstitutionContractVerificationStatus.PendingForVerify;
|
||||
}
|
||||
|
||||
public long InstitutionContractId { get; set; }
|
||||
@@ -280,6 +286,15 @@ public class InstitutionContractAmendment : EntityBase
|
||||
|
||||
public long LawId { get; set; }
|
||||
|
||||
|
||||
public string VerifierPhoneNumber { get; private set; }
|
||||
|
||||
public string VerifierFullName { get; private set; }
|
||||
|
||||
public InstitutionContractVerificationStatus VerificationStatus { get; set; }
|
||||
|
||||
public DateTime VerifyCodeCreation { get; set; }
|
||||
|
||||
public void SetVerifyCode(string code,string verifierFullName, string verifierPhoneNumber)
|
||||
{
|
||||
VerifyCode = code;
|
||||
@@ -287,25 +302,22 @@ public class InstitutionContractAmendment : EntityBase
|
||||
VerifierFullName = verifierFullName;
|
||||
VerifierPhoneNumber = verifierPhoneNumber;
|
||||
}
|
||||
|
||||
public string VerifierPhoneNumber { get; private set; }
|
||||
|
||||
public string VerifierFullName { get; private set; }
|
||||
|
||||
public DateTime VerifyCodeCreation { get; set; }
|
||||
public void Verified()
|
||||
{
|
||||
VerificationStatus = InstitutionContractVerificationStatus.Verified;
|
||||
}
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendmentChange : EntityBase
|
||||
{
|
||||
private InstitutionContractAmendmentChange() { }
|
||||
private InstitutionContractAmendmentChange(long institutionContractAmendmentId,
|
||||
InstitutionContractAmendment institutionContractAmendment, InstitutionContractAmendmentChangeType changeType,
|
||||
DateTime changeDateGr, bool? hasRollCallPlan, bool? hasCustomizeCheckoutPlan, bool? hasContractPlan,
|
||||
|
||||
private InstitutionContractAmendmentChange(InstitutionContractAmendmentChangeType changeType,
|
||||
DateTime changeDateGr, bool? hasCustomizeCheckoutPlan, bool? hasContractPlan,
|
||||
bool? hasContractPlanInPerson, bool? hasInsurancePlan, bool? hasInsurancePlanInPerson, int? personnelCount,
|
||||
long? workshopDetailsId)
|
||||
bool? hasRollCallPlan, bool? hasRollCallInPerson,
|
||||
long? currentWorkshopId, int personnelCountDifference)
|
||||
{
|
||||
InstitutionContractAmendmentId = institutionContractAmendmentId;
|
||||
InstitutionContractAmendment = institutionContractAmendment;
|
||||
ChangeType = changeType;
|
||||
ChangeDateGr = changeDateGr;
|
||||
HasRollCallPlan = hasRollCallPlan;
|
||||
@@ -315,9 +327,80 @@ public class InstitutionContractAmendmentChange : EntityBase
|
||||
HasInsurancePlan = hasInsurancePlan;
|
||||
HasInsurancePlanInPerson = hasInsurancePlanInPerson;
|
||||
PersonnelCount = personnelCount;
|
||||
WorkshopDetailsId = workshopDetailsId;
|
||||
PersonnelCountDifference = personnelCountDifference;
|
||||
CurrentWorkshopId = currentWorkshopId;
|
||||
HasRollCallInPerson = hasRollCallInPerson;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// تغییر تعداد پرسنل
|
||||
/// </summary>
|
||||
public static InstitutionContractAmendmentChange CreatePersonCountChange(
|
||||
DateTime changeDateGr, int personnelCount, int personnelCountDifference,
|
||||
long currentWorkshopId)
|
||||
{
|
||||
return new InstitutionContractAmendmentChange(
|
||||
changeType: InstitutionContractAmendmentChangeType.PersonCount,
|
||||
changeDateGr: changeDateGr,
|
||||
hasCustomizeCheckoutPlan: null,
|
||||
hasContractPlan: null,
|
||||
hasContractPlanInPerson: null,
|
||||
hasInsurancePlan: null,
|
||||
hasInsurancePlanInPerson: null,
|
||||
personnelCount: personnelCount,
|
||||
hasRollCallPlan: null,
|
||||
hasRollCallInPerson: null,
|
||||
currentWorkshopId: currentWorkshopId,
|
||||
personnelCountDifference: personnelCountDifference);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// تغییر خدمات
|
||||
/// </summary>
|
||||
public static InstitutionContractAmendmentChange CreateServicesChange(
|
||||
DateTime changeDateGr, long currentWorkshopId, bool hasRollCallPlan, bool hasRollCallInPerson,
|
||||
bool hasCustomizeCheckoutPlan, bool hasContractPlan, bool hasContractPlanInPerson,
|
||||
bool hasInsurancePlan, bool hasInsurancePlanInPerson)
|
||||
{
|
||||
return new InstitutionContractAmendmentChange(
|
||||
changeType: InstitutionContractAmendmentChangeType.Services,
|
||||
changeDateGr: changeDateGr,
|
||||
hasCustomizeCheckoutPlan: hasCustomizeCheckoutPlan,
|
||||
hasContractPlan: hasContractPlan,
|
||||
hasContractPlanInPerson: hasContractPlanInPerson,
|
||||
hasInsurancePlan: hasInsurancePlan,
|
||||
hasInsurancePlanInPerson: hasInsurancePlanInPerson,
|
||||
personnelCount: null,
|
||||
hasRollCallPlan: hasRollCallPlan,
|
||||
hasRollCallInPerson: hasRollCallInPerson,
|
||||
currentWorkshopId: currentWorkshopId,
|
||||
personnelCountDifference: 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارگاه جدید
|
||||
/// </summary>
|
||||
public static InstitutionContractAmendmentChange CreateWorkshopCreatedChange(
|
||||
DateTime changeDateGr, bool hasRollCallPlan, bool hasRollCallInPerson,
|
||||
bool hasCustomizeCheckoutPlan, bool hasContractPlan, bool hasContractPlanInPerson,
|
||||
bool hasInsurancePlan, bool hasInsurancePlanInPerson,int personnelCount)
|
||||
{
|
||||
return new InstitutionContractAmendmentChange(
|
||||
changeType: InstitutionContractAmendmentChangeType.WorkshopCreated,
|
||||
changeDateGr: changeDateGr,
|
||||
hasCustomizeCheckoutPlan: hasCustomizeCheckoutPlan,
|
||||
hasContractPlan: hasContractPlan,
|
||||
hasContractPlanInPerson: hasContractPlanInPerson,
|
||||
hasInsurancePlan: hasInsurancePlan,
|
||||
hasInsurancePlanInPerson: hasInsurancePlanInPerson,
|
||||
personnelCount: personnelCount,
|
||||
hasRollCallPlan: hasRollCallPlan,
|
||||
hasRollCallInPerson: hasRollCallInPerson,
|
||||
currentWorkshopId: null,
|
||||
personnelCountDifference: 0);
|
||||
}
|
||||
|
||||
|
||||
public long InstitutionContractAmendmentId { get; private set; }
|
||||
public InstitutionContractAmendment InstitutionContractAmendment { get; private set; }
|
||||
public InstitutionContractAmendmentChangeType ChangeType { get; private set; }
|
||||
@@ -328,6 +411,8 @@ public class InstitutionContractAmendmentChange : EntityBase
|
||||
/// </summary>
|
||||
public bool? HasRollCallPlan { get; private set; }
|
||||
|
||||
public bool? HasRollCallInPerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن فیش غیر رسمی
|
||||
/// </summary>
|
||||
@@ -357,11 +442,17 @@ public class InstitutionContractAmendmentChange : EntityBase
|
||||
/// تعداد پرسنل
|
||||
/// </summary>
|
||||
public int? PersonnelCount { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مقدار تغییرات تعداد پرسنل
|
||||
/// </summary>
|
||||
public int PersonnelCountDifference { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// تعداد کارگاه
|
||||
/// </summary>
|
||||
public long? WorkshopDetailsId { get; private set; }
|
||||
public long? CurrentWorkshopId { get; private set; }
|
||||
}
|
||||
|
||||
public enum InstitutionContractAmendmentChangeType
|
||||
|
||||
@@ -9,7 +9,7 @@ public class InstitutionContractWorkshopBase:EntityBase
|
||||
protected InstitutionContractWorkshopBase(){}
|
||||
public InstitutionContractWorkshopBase(string workshopName, bool hasRollCallPlan,bool hasRollCallPlanInPerson,
|
||||
bool hasCustomizeCheckoutPlan, bool hasContractPlan,bool hasContractPlanInPerson,bool hasInsurancePlan,bool hasInsurancePlanInPerson,
|
||||
int personnelCount, double price )
|
||||
int personnelCount, double price,bool isAmendment )
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
Services = new WorkshopServices(hasInsurancePlan, hasInsurancePlanInPerson,
|
||||
@@ -17,7 +17,10 @@ public class InstitutionContractWorkshopBase:EntityBase
|
||||
PersonnelCount = personnelCount;
|
||||
Price = price;
|
||||
Employers = [];
|
||||
IsAmendment = isAmendment;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شناسه کارگاه
|
||||
/// </summary>
|
||||
@@ -42,7 +45,11 @@ public class InstitutionContractWorkshopBase:EntityBase
|
||||
|
||||
|
||||
public double Price { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// جهت نمایش دادن اینکه آیا این کارگاه مربوط به ارتقا قرارداد است یا خیر
|
||||
/// </summary>
|
||||
public bool IsAmendment { get; set; }
|
||||
|
||||
public List<InstitutionContractWorkshopDetailEmployer> Employers { get; private set; } = new();
|
||||
|
||||
|
||||
@@ -10,9 +10,10 @@ public class InstitutionContractWorkshopCurrent:InstitutionContractWorkshopBase
|
||||
public InstitutionContractWorkshopCurrent(string workshopName, bool hasRollCallPlan,
|
||||
bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
|
||||
bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
|
||||
int personnelCount, double price,long institutionContractWorkshopGroupId,InstitutionContractWorkshopGroup workshopGroup,long workshopId) : base(workshopName, hasRollCallPlan,
|
||||
int personnelCount, double price,long institutionContractWorkshopGroupId,
|
||||
InstitutionContractWorkshopGroup workshopGroup,long workshopId,bool isAmendment) : base(workshopName, hasRollCallPlan,
|
||||
hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan,
|
||||
hasContractPlanInPerson, hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price)
|
||||
hasContractPlanInPerson, hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price,isAmendment)
|
||||
{
|
||||
InstitutionContractWorkshopGroupId = institutionContractWorkshopGroupId;
|
||||
WorkshopGroup = workshopGroup;
|
||||
|
||||
@@ -31,6 +31,13 @@ public class InstitutionContractWorkshopGroup : EntityBase
|
||||
InitialWorkshops = initialWorkshops.ToList();
|
||||
LastModifiedDate = DateTime.Now;
|
||||
}
|
||||
|
||||
public void AddAmendmentWorkshops(List<InstitutionContractWorkshopInitial> amendmentDetails)
|
||||
{
|
||||
InitialWorkshops.AddRange(amendmentDetails);
|
||||
LastModifiedDate = DateTime.Now;
|
||||
}
|
||||
|
||||
|
||||
public void UpdateCurrentWorkshops(List<InstitutionContractWorkshopCurrent> updatedDetails)
|
||||
{
|
||||
|
||||
@@ -11,9 +11,9 @@ public class InstitutionContractWorkshopInitial:InstitutionContractWorkshopBase
|
||||
public InstitutionContractWorkshopInitial(string workshopName, bool hasRollCallPlan,
|
||||
bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
|
||||
bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
|
||||
int personnelCount, double price) : base(workshopName, hasRollCallPlan,
|
||||
int personnelCount, double price,bool isAmendment =false) : base(workshopName, hasRollCallPlan,
|
||||
hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan, hasContractPlanInPerson,
|
||||
hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price)
|
||||
hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price,isAmendment)
|
||||
{
|
||||
WorkshopCreated = false;
|
||||
}
|
||||
@@ -31,7 +31,8 @@ public class InstitutionContractWorkshopInitial:InstitutionContractWorkshopBase
|
||||
WorkshopCreated = true;
|
||||
WorkshopCurrent = new InstitutionContractWorkshopCurrent(WorkshopName,Services.RollCall,Services.RollCallInPerson,
|
||||
Services.CustomizeCheckout,Services.Contract,Services.ContractInPerson,Services.Insurance,
|
||||
Services.InsuranceInPerson,PersonnelCount,Price,InstitutionContractWorkshopGroupId,WorkshopGroup,workshopId);
|
||||
Services.InsuranceInPerson,PersonnelCount,Price,InstitutionContractWorkshopGroupId,WorkshopGroup,workshopId,
|
||||
IsAmendment);
|
||||
WorkshopCurrent.SetEmployers(Employers.Select(x=>x.EmployerId).ToList());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
@@ -16,7 +17,7 @@ public class InstitutionContractAmendmentTemp
|
||||
NewWorkshops = prevWorkshops.Select(x=> new InstitutionContractAmendmentTempNewWorkshop(
|
||||
x.WorkshopName, x.CountPerson, x.ContractAndCheckout, x.ContractAndCheckoutInPerson, x.Insurance,
|
||||
x.InsuranceInPerson, x.RollCall, x.RollCallInPerson, x.CustomizeCheckout, x.Price, x.WorkshopId,
|
||||
x.CurrentWorkshopId, 0)).ToList();
|
||||
x.CurrentWorkshopId, 0,x.Id)).ToList();
|
||||
InstitutionContractId = institutionContractId;
|
||||
}
|
||||
|
||||
@@ -25,17 +26,32 @@ public class InstitutionContractAmendmentTemp
|
||||
public Guid Id { get; private set; }
|
||||
public List<InstitutionContractAmendmentTempPrevWorkshop> PrevWorkshops { get; private set; }
|
||||
public List<InstitutionContractAmendmentTempNewWorkshop> NewWorkshops { get; private set; }
|
||||
|
||||
public InstitutionContractPaymentMonthlyViewModel MonthlyPayment { get; set; }
|
||||
|
||||
public InstitutionContractPaymentOneTimeViewModel OneTimePayment { get; set; }
|
||||
|
||||
public long InstitutionContractId { get; private set; }
|
||||
|
||||
public int MonthDifference { get; set; }
|
||||
public void AddPaymentDetails(InstitutionContractPaymentMonthlyViewModel resMonthly, InstitutionContractPaymentOneTimeViewModel resOneTime, int monthDiff)
|
||||
{
|
||||
MonthlyPayment = resMonthly;
|
||||
OneTimePayment = resOneTime;
|
||||
MonthDifference = monthDiff;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendmentTempNewWorkshop : InstitutionContractAmendmentTempPrevWorkshop
|
||||
{
|
||||
public InstitutionContractAmendmentTempNewWorkshop(string workshopName, int countPerson, bool contractAndCheckout,
|
||||
bool contractAndCheckoutInPerson, bool insurance, bool insuranceInPerson, bool rollCall, bool rollCallInPerson,
|
||||
bool customizeCheckout, double price, long workshopId, long currentWorkshopId,double priceDifference) : base(
|
||||
bool customizeCheckout, double price, long workshopId, long currentWorkshopId,double priceDifference,Guid prevId) : base(
|
||||
workshopName, countPerson, contractAndCheckout, contractAndCheckoutInPerson, insurance, insuranceInPerson,
|
||||
rollCall, rollCallInPerson, customizeCheckout, price, workshopId, currentWorkshopId)
|
||||
{
|
||||
Id = prevId;
|
||||
PriceDifference = priceDifference;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ public class GetInstitutionVerificationDetailsWorkshopsViewModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int PersonnelCount { get; set; }
|
||||
|
||||
public WorkshopServicesViewModel OldServices { get; set; }
|
||||
public WorkshopServicesViewModel Services { get; set; }
|
||||
public string Price { get; set; }
|
||||
}
|
||||
@@ -244,13 +244,41 @@ public interface IInstitutionContractApplication
|
||||
#endregion
|
||||
|
||||
Task<OperationResult> ResendVerifyLink(long institutionContractId);
|
||||
|
||||
Task AmendmentComplete(InstitutionContractAmendmentCompleteRequest request);
|
||||
/// <summary>
|
||||
/// دیتای پرینت قرارداد مالی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<InstitutionContractPrintViewModel> PrintOneAsync(long id);
|
||||
|
||||
Task<GetInstitutionAmendmentVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id, long amendmentId);
|
||||
}
|
||||
|
||||
public class GetInstitutionAmendmentVerificationDetailsViewModel
|
||||
{
|
||||
public InstitutionContratVerificationParty FirstParty { get; set; }
|
||||
public InstitutionContratVerificationParty SecondParty { get; set; }
|
||||
public string ContractNo { get; set; }
|
||||
public string AmendmentCreationDate { get; set; }
|
||||
public string AmendmentStart { get; set; }
|
||||
public string AmendmentEnd { get; set; }
|
||||
public List<GetInstitutionVerificationDetailsWorkshopsViewModel> Workshops { get; set; }
|
||||
public string TotalPrice { get; set; }
|
||||
public string TaxPrice { get; set; }
|
||||
public string PaymentPrice { get; set; }
|
||||
public List<InstitutionContractInstallmentViewModel> Installments { get; set; }
|
||||
public bool IsInstallment { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendmentCompleteRequest
|
||||
{
|
||||
public Guid TempId { get; set; }
|
||||
public bool IsInstallment { get; set; }
|
||||
public long LawId { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class InstitutionContractPrintViewModel
|
||||
|
||||
@@ -1,11 +1,28 @@
|
||||
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 string WorkshopName { get; set; }
|
||||
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; }
|
||||
}
|
||||
@@ -1387,6 +1387,16 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
return (await _institutionContractRepository.PrintAllAsync([id])).FirstOrDefault();
|
||||
}
|
||||
|
||||
public async Task<GetInstitutionAmendmentVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id, long amendmentId)
|
||||
{
|
||||
return await _institutionContractRepository.GetAmendmentVerificationDetails(id,amendmentId);
|
||||
}
|
||||
|
||||
public async Task AmendmentComplete(InstitutionContractAmendmentCompleteRequest request)
|
||||
{
|
||||
await _institutionContractRepository.AmendmentComplete(request);
|
||||
}
|
||||
|
||||
|
||||
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
||||
CreateInstitutionContractLegalPartyRequest request, long representativeId, string address, string city,
|
||||
|
||||
@@ -14,6 +14,8 @@ public class InstitutionContractAmendmentMapping:IEntityTypeConfiguration<Instit
|
||||
builder.Property(x => x.VerifyCode).HasMaxLength(10);
|
||||
builder.Property(x => x.VerifierFullName).HasMaxLength(100);
|
||||
builder.Property(x => x.VerifierPhoneNumber).HasMaxLength(20);
|
||||
|
||||
builder.Property(x=>x.VerificationStatus).HasConversion<string>().HasMaxLength(50);
|
||||
|
||||
builder.HasOne(x => x.InstitutionContract)
|
||||
.WithMany(x => x.Amendments)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,83 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddIsAmendmentininstitutioncontractWorkshopDetials : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "WorkshopDetailsId",
|
||||
table: "InstitutionContractAmendmentChange",
|
||||
newName: "CurrentWorkshopId");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAmendment",
|
||||
table: "InstitutionContractWorkshopInitials",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAmendment",
|
||||
table: "InstitutionContractWorkshopCurrents",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "VerificationStatus",
|
||||
table: "InstitutionContractAmendments",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasRollCallInPerson",
|
||||
table: "InstitutionContractAmendmentChange",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PersonnelCountDifference",
|
||||
table: "InstitutionContractAmendmentChange",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAmendment",
|
||||
table: "InstitutionContractWorkshopInitials");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAmendment",
|
||||
table: "InstitutionContractWorkshopCurrents");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "VerificationStatus",
|
||||
table: "InstitutionContractAmendments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasRollCallInPerson",
|
||||
table: "InstitutionContractAmendmentChange");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PersonnelCountDifference",
|
||||
table: "InstitutionContractAmendmentChange");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "CurrentWorkshopId",
|
||||
table: "InstitutionContractAmendmentChange",
|
||||
newName: "WorkshopDetailsId");
|
||||
}
|
||||
}
|
||||
}
|
||||
11085
CompanyManagment.EFCore/Migrations/20251106075529_institutioncontractAmendment law id.Designer.cs
generated
Normal file
11085
CompanyManagment.EFCore/Migrations/20251106075529_institutioncontractAmendment law id.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class institutioncontractAmendmentlawid : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
11081
CompanyManagment.EFCore/Migrations/20251106075938_ignore law id.Designer.cs
generated
Normal file
11081
CompanyManagment.EFCore/Migrations/20251106075938_ignore law id.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ignorelawid : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "LawId",
|
||||
table: "InstitutionContractAmendments",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LawId",
|
||||
table: "InstitutionContractAmendments");
|
||||
}
|
||||
}
|
||||
}
|
||||
11084
CompanyManagment.EFCore/Migrations/20251106080435_lawId test.Designer.cs
generated
Normal file
11084
CompanyManagment.EFCore/Migrations/20251106080435_lawId test.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,20 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class lawIdtest : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3288,6 +3288,11 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("VerificationCreation")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("VerificationStatus")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("VerifierFullName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
@@ -3327,6 +3332,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long?>("CurrentWorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool?>("HasContractPlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -3342,6 +3350,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<bool?>("HasInsurancePlanInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool?>("HasRollCallInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool?>("HasRollCallPlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -3351,8 +3362,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<int?>("PersonnelCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long?>("WorkshopDetailsId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<int>("PersonnelCountDifference")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
@@ -3419,6 +3430,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("InstitutionContractWorkshopGroupId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("IsAmendment")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("PersonnelCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
@@ -3484,6 +3498,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("InstitutionContractWorkshopGroupId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("IsAmendment")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("PersonnelCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ using CompanyManagment.App.Contracts.Law;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using CompanyManagment.App.Contracts.WorkshopPlan;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
@@ -2374,6 +2373,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
x.WorkshopId??0,x.id)).ToList();
|
||||
|
||||
|
||||
await _institutionAmendmentTemp
|
||||
.DeleteManyAsync(x => x.InstitutionContractId == institutionContractId);;
|
||||
|
||||
var temp = new InstitutionContractAmendmentTemp(workshops, institutionContractId);
|
||||
|
||||
@@ -2456,12 +2457,14 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
if (endDay > startDay)
|
||||
monthDiff++;
|
||||
|
||||
var sumOneMonth = institutionContractAmendmentTemp.NewWorkshops.Sum(x => x.PriceDifference);
|
||||
var sumOneMonth = institutionContractAmendmentTemp
|
||||
.NewWorkshops.Sum(x => x.PriceDifference);
|
||||
|
||||
var baseAmount = monthDiff * sumOneMonth;
|
||||
var tax = baseAmount*0.10;
|
||||
var totalPayment = tax+baseAmount;
|
||||
|
||||
|
||||
|
||||
var res = new InsitutionContractAmendmentPaymentResponse()
|
||||
{
|
||||
@@ -2469,6 +2472,41 @@ 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()
|
||||
{
|
||||
WorkshopName = x.WorkshopName,
|
||||
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,
|
||||
},
|
||||
};
|
||||
}).OrderByDescending(x=>x.Price).ToList()
|
||||
};
|
||||
|
||||
res.OneTime = new InstitutionContractPaymentOneTimeViewModel()
|
||||
@@ -2515,6 +2553,13 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
institutionContractAmendmentTemp.AddPaymentDetails(res.Monthly, res.OneTime, monthDiff);
|
||||
await _institutionAmendmentTemp
|
||||
.ReplaceOneAsync(x => x.Id == institutionContractAmendmentTemp.Id, institutionContractAmendmentTemp);
|
||||
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -2553,7 +2598,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
request.Insurance, request.InsuranceInPerson,
|
||||
request.RollCall, request.RollCallInPerson,
|
||||
request.CustomizeCheckout, price,
|
||||
request.WorkshopId,0,price);
|
||||
request.WorkshopId,0,price,Guid.NewGuid());
|
||||
|
||||
workshopTemp = newWorkshopTemp;
|
||||
|
||||
@@ -2565,9 +2610,24 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
}
|
||||
else
|
||||
{
|
||||
var prevWorkshop = amendmentTemp.PrevWorkshops
|
||||
.FirstOrDefault(x => x.Id == workshopTemp.Id);
|
||||
var differencePrice = 0d;
|
||||
if (prevWorkshop != null)
|
||||
{
|
||||
differencePrice = price - prevWorkshop.Price;
|
||||
}
|
||||
else
|
||||
{
|
||||
differencePrice = price;
|
||||
}
|
||||
amendmentTemp.NewWorkshops.Remove(workshopTemp);
|
||||
|
||||
var differencePrice = price - workshopTemp.Price;
|
||||
|
||||
if (differencePrice<0)
|
||||
{
|
||||
differencePrice = 0;
|
||||
}
|
||||
workshopTemp.Edit(request.WorkshopName, request.CountPerson,
|
||||
request.ContractAndCheckout, request.ContractAndCheckoutInPerson,
|
||||
request.Insurance, request.InsuranceInPerson,
|
||||
@@ -2768,6 +2828,146 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task AmendmentComplete(InstitutionContractAmendmentCompleteRequest request)
|
||||
{
|
||||
var amendmentTemp = await _institutionAmendmentTemp
|
||||
.Find(x=>x.Id == request.TempId).FirstOrDefaultAsync();
|
||||
|
||||
if (amendmentTemp == null)
|
||||
throw new BadRequestException("دیتای وارد شده نامعتبر است");
|
||||
|
||||
var institutionContract = await _context.InstitutionContractSet
|
||||
.Include(x=>x.Amendments)
|
||||
.Include(x=>x.WorkshopGroup)
|
||||
.ThenInclude(x=>x.CurrentWorkshops)
|
||||
.FirstOrDefaultAsync(x => x.id == amendmentTemp.InstitutionContractId);
|
||||
|
||||
|
||||
List<InstitutionContractInstallment> installments = [];
|
||||
double amount = 0;
|
||||
if (request.IsInstallment)
|
||||
{
|
||||
installments = amendmentTemp.MonthlyPayment.Installments.Select(x=>
|
||||
new InstitutionContractInstallment(x.InstalmentDate.ToGeorgianDateTime(),
|
||||
x.InstallmentAmountStr.MoneyToDouble(), "")).ToList();
|
||||
amount = amendmentTemp.MonthlyPayment.PaymentAmount.MoneyToDouble();
|
||||
}
|
||||
else
|
||||
{
|
||||
amount = amendmentTemp.OneTimePayment.PaymentAmount.MoneyToDouble();
|
||||
}
|
||||
var newWorkshops = amendmentTemp
|
||||
.NewWorkshops.Where(x=>x.CurrentWorkshopId ==0).ToList();
|
||||
|
||||
var newWorkshopTempIds = newWorkshops.Select(x=>x.Id).ToList();
|
||||
|
||||
var changes = newWorkshops.Select(x=>
|
||||
InstitutionContractAmendmentChange.CreateWorkshopCreatedChange(DateTime.Now,x.RollCall,x.RollCallInPerson,x.CustomizeCheckout,
|
||||
x.ContractAndCheckout,x.ContractAndCheckoutInPerson,x.Insurance,x.InsuranceInPerson,x.CountPerson)).ToList();
|
||||
|
||||
var changedWorkshops = amendmentTemp.NewWorkshops
|
||||
.Where(x => !newWorkshopTempIds.Contains(x.Id)).ToList();
|
||||
|
||||
foreach (var changedWorkshop in changedWorkshops)
|
||||
{
|
||||
var prev = amendmentTemp.PrevWorkshops.FirstOrDefault(x => x.Id == changedWorkshop.Id);
|
||||
if (prev == null)
|
||||
throw new BadRequestException("دیتای وارد شده ناقص ذخیره شده است");
|
||||
|
||||
// مقایسه مقادیر بولین بین prev و changedWorkshop برای تشخیص تغییرات
|
||||
var changedBooleans = new Dictionary<string, (bool Previous, bool Current)>();
|
||||
|
||||
if (prev.CustomizeCheckout != changedWorkshop.CustomizeCheckout)
|
||||
changedBooleans.Add("CustomizeCheckout", (prev.CustomizeCheckout, changedWorkshop.CustomizeCheckout));
|
||||
|
||||
if (prev.ContractAndCheckout != changedWorkshop.ContractAndCheckout)
|
||||
changedBooleans.Add("ContractAndCheckout", (prev.ContractAndCheckout, changedWorkshop.ContractAndCheckout));
|
||||
|
||||
if (prev.ContractAndCheckoutInPerson != changedWorkshop.ContractAndCheckoutInPerson)
|
||||
changedBooleans.Add("ContractAndCheckoutInPerson", (prev.ContractAndCheckoutInPerson, changedWorkshop.ContractAndCheckoutInPerson));
|
||||
|
||||
if (prev.Insurance != changedWorkshop.Insurance)
|
||||
changedBooleans.Add("Insurance", (prev.Insurance, changedWorkshop.Insurance));
|
||||
|
||||
if (prev.InsuranceInPerson != changedWorkshop.InsuranceInPerson)
|
||||
changedBooleans.Add("InsuranceInPerson", (prev.InsuranceInPerson, changedWorkshop.InsuranceInPerson));
|
||||
|
||||
if (prev.RollCall != changedWorkshop.RollCall)
|
||||
changedBooleans.Add("RollCall", (prev.RollCall, changedWorkshop.RollCall));
|
||||
|
||||
if (prev.RollCallInPerson != changedWorkshop.RollCallInPerson)
|
||||
changedBooleans.Add("RollCallInPerson", (prev.RollCallInPerson, changedWorkshop.RollCallInPerson));
|
||||
|
||||
// اگر تغییری وجود داشته باشد، آن را به لیست تغییرات اضافه کن
|
||||
if (changedBooleans.Any())
|
||||
{
|
||||
var change = InstitutionContractAmendmentChange.CreateServicesChange(
|
||||
DateTime.Now,
|
||||
changedWorkshop.WorkshopId,
|
||||
changedWorkshop.RollCall,
|
||||
changedWorkshop.RollCallInPerson,
|
||||
changedWorkshop.CustomizeCheckout,
|
||||
changedWorkshop.ContractAndCheckout,
|
||||
changedWorkshop.ContractAndCheckoutInPerson,
|
||||
changedWorkshop.Insurance,
|
||||
changedWorkshop.InsuranceInPerson);
|
||||
|
||||
changes.Add(change);
|
||||
}
|
||||
|
||||
if (changedWorkshop.CountPerson != prev.CountPerson)
|
||||
{
|
||||
var difference = changedWorkshop.CountPerson - prev.CountPerson;
|
||||
var change = InstitutionContractAmendmentChange.CreatePersonCountChange(
|
||||
DateTime.Now,
|
||||
changedWorkshop.CountPerson,
|
||||
difference,changedWorkshop.WorkshopId);
|
||||
|
||||
changes.Add(change);
|
||||
}
|
||||
}
|
||||
|
||||
var amendment = new InstitutionContractAmendment(institutionContract.id,installments,amount,
|
||||
request.IsInstallment,changes,request.LawId);
|
||||
institutionContract.AddAmendment(amendment);
|
||||
|
||||
await _smsService.SendInstitutionAmendmentVerificationLink(
|
||||
institutionContract.VerifierPhoneNumber,
|
||||
institutionContract.ContractingPartyName,
|
||||
institutionContract.PublicId,
|
||||
institutionContract.ContractingPartyId,
|
||||
institutionContract.id
|
||||
);
|
||||
|
||||
await _institutionAmendmentTemp.DeleteOneAsync(x=>x.Id == amendmentTemp.Id);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
||||
public async Task<GetInstitutionAmendmentVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id,
|
||||
long amendmentId)
|
||||
{
|
||||
var institutionContract = await _context.InstitutionContractSet
|
||||
.Include(x => x.Amendments)
|
||||
.FirstOrDefaultAsync(x => x.PublicId == id);
|
||||
|
||||
if (institutionContract == null)
|
||||
throw new NotFoundException("قرارداد مؤسسه یافت نشد");
|
||||
|
||||
var amendment = institutionContract.Amendments
|
||||
.FirstOrDefault(x => x.id == amendmentId);
|
||||
if (amendment == null)
|
||||
throw new NotFoundException("ارتقا یافت نشد");
|
||||
|
||||
if (amendment.VerificationStatus != InstitutionContractVerificationStatus.PendingForVerify)
|
||||
throw new BadRequestException("این ارتقا قبلا تایید شده است");
|
||||
|
||||
throw new NotImplementedException();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private InstitutionContractExtensionPaymentResponse CalculateInPersonPayment(
|
||||
InstitutionContractExtensionPlanDetail selectedPlan, double baseAmount, double tenPercent,
|
||||
|
||||
@@ -541,18 +541,52 @@ public class institutionContractController : AdminBaseController
|
||||
var res =await _institutionContractApplication.InsertAmendmentTempWorkshops(request);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpDelete("amendment/remove-temp-workshops/{workshopTempId:guid}")]
|
||||
public async Task<ActionResult> RemoveAmendmentWorkshops(Guid workshopTempId)
|
||||
{
|
||||
await _institutionContractApplication.RemoveAmendmentWorkshops(workshopTempId);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost("amendment/payment-details")]
|
||||
public async Task<ActionResult<InsitutionContractAmendmentPaymentResponse>> GetAmendmentPaymentDetails([FromBody]InsitutionContractAmendmentPaymentRequest request)
|
||||
{
|
||||
var res =await _institutionContractApplication.GetAmendmentPaymentDetails(request);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost("amendment/complete")]
|
||||
public async Task<ActionResult> AmendmentComplete(
|
||||
[FromBody] InstitutionContractAmendmentCompleteRequest request)
|
||||
{
|
||||
|
||||
await _institutionContractApplication.AmendmentComplete(request);
|
||||
return Ok();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/api/institutionContract/amendment-Verification/{id:guid}/{amendmentId:long}")]
|
||||
[AllowAnonymous]
|
||||
public async Task<GetInstitutionAmendmentVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id,long amendmentId)
|
||||
{
|
||||
return await _institutionContractApplication.GetAmendmentVerificationDetails(id,amendmentId);
|
||||
}
|
||||
|
||||
[HttpPost("/api/institutionContract/Verify-amendment")]
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult<OperationResult>> VerifyAmendment([FromBody] InstitutionVerificationRequest command)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//var res = await _institutionContractApplication.AmendmentVerifyOtp(command.Id, command.Code);
|
||||
//return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpGet("edit-old/{id}")]
|
||||
|
||||
@@ -737,7 +737,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
x.PersonnelCount,
|
||||
x.Price, x.InstitutionContractWorkshopGroupId,
|
||||
group,
|
||||
x.WorkshopId.Value);
|
||||
x.WorkshopId.Value,false);
|
||||
entity.SetEmployers(x.Employers.Select(e => e.EmployerId).ToList());
|
||||
|
||||
return entity;
|
||||
|
||||
Reference in New Issue
Block a user