add Services and updat get list institutioncontract
This commit is contained in:
@@ -1,21 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
public class InstitutionContractWorkshopDetail:EntityBase
|
||||
{
|
||||
public InstitutionContractWorkshopDetail(string workshopName, bool hasRollCallPlan,
|
||||
public InstitutionContractWorkshopDetail(string workshopName, bool hasRollCallPlan,bool hasRollCallPlanInPerson,
|
||||
bool hasCustomizeCheckoutPlan, bool hasContractPlan,bool hasContractPlanInPerson,bool hasInsurancePlan,bool hasInsurancePlanInPerson,
|
||||
int personnelCount, double price)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
HasRollCallPlan = hasRollCallPlan;
|
||||
HasCustomizeCheckoutPlan = hasCustomizeCheckoutPlan;
|
||||
HasContractPlan = hasContractPlan;
|
||||
HasContractPlanInPerson = hasContractPlanInPerson;
|
||||
HasInsurancePlan = hasInsurancePlan;
|
||||
HasInsurancePlanInPerson = hasInsurancePlanInPerson;
|
||||
Services = new WorkshopServices(hasInsurancePlan, hasInsurancePlanInPerson,
|
||||
hasContractPlan, hasContractPlanInPerson, hasRollCallPlan, hasRollCallPlanInPerson,hasCustomizeCheckoutPlan);
|
||||
PersonnelCount = personnelCount;
|
||||
WorkshopCreated = false;
|
||||
Price = price;
|
||||
@@ -32,35 +29,7 @@ public class InstitutionContractWorkshopDetail:EntityBase
|
||||
/// </summary>
|
||||
public string WorkshopName { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن حضور و غیاب
|
||||
/// </summary>
|
||||
public bool HasRollCallPlan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن فیش غیر رسمی
|
||||
/// </summary>
|
||||
public bool HasCustomizeCheckoutPlan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن قرارداد و تصفیه
|
||||
/// </summary>
|
||||
public bool HasContractPlan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن قرارداد و تصفیه حضوری
|
||||
/// </summary>
|
||||
public bool HasContractPlanInPerson { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن بیمه
|
||||
/// </summary>
|
||||
public bool HasInsurancePlan { get; private set; }
|
||||
/// <summary>
|
||||
/// پلن بیمه حضوری
|
||||
/// </summary>
|
||||
public bool HasInsurancePlanInPerson { get; private set; }
|
||||
|
||||
public WorkshopServices Services { get; set; }
|
||||
public int PersonnelCount { get; private set; }
|
||||
|
||||
public bool WorkshopCreated { get; private set; }
|
||||
@@ -95,13 +64,7 @@ public class InstitutionContractWorkshopDetail:EntityBase
|
||||
|
||||
Employers.Add(new InstitutionContractWorkshopDetailEmployer(id, employerId));
|
||||
}
|
||||
|
||||
public void Edit(bool hasAttendancePlan, bool hasUnofficialPayslipPlan, bool hasContractSettlementPlan)
|
||||
{
|
||||
HasRollCallPlan = hasAttendancePlan;
|
||||
HasCustomizeCheckoutPlan = hasUnofficialPayslipPlan;
|
||||
HasContractPlan = hasContractSettlementPlan;
|
||||
}
|
||||
|
||||
|
||||
public void SetWorkshopId(long workshopId)
|
||||
{
|
||||
|
||||
23
Company.Domain/InstitutionContractAgg/WorkshopServices.cs
Normal file
23
Company.Domain/InstitutionContractAgg/WorkshopServices.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
public class WorkshopServices
|
||||
{
|
||||
public WorkshopServices(bool insurance, bool insuranceInPerson, bool contract, bool contractInPerson, bool rollCall, bool rollCallInPerson, bool customizeCheckout)
|
||||
{
|
||||
Insurance = insurance;
|
||||
InsuranceInPerson = insuranceInPerson;
|
||||
Contract = contract;
|
||||
ContractInPerson = contractInPerson;
|
||||
RollCall = rollCall;
|
||||
CustomizeCheckout = customizeCheckout;
|
||||
RollCallInPerson = rollCallInPerson;
|
||||
}
|
||||
|
||||
public bool Insurance { get; private set; }
|
||||
public bool InsuranceInPerson { get; private set; }
|
||||
public bool Contract { get; private set; }
|
||||
public bool ContractInPerson { get; private set; }
|
||||
public bool RollCall { get; private set; }
|
||||
|
||||
public bool RollCallInPerson { get; private set; }
|
||||
public bool CustomizeCheckout { get; private set; }
|
||||
}
|
||||
@@ -85,4 +85,24 @@ public class GetInstitutionContractListItemsViewModel
|
||||
public bool IsExpired { get; set; }
|
||||
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
public List<InstitutionContractListWorkshop> Workshops { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractListWorkshop
|
||||
{
|
||||
public string WorkshopName { get; set; }
|
||||
public int EmployeeCount { get; set; }
|
||||
public WorkshopServicesViewModel WorkshopServices { get; set; }
|
||||
}
|
||||
|
||||
public class WorkshopServicesViewModel
|
||||
{
|
||||
public bool Insurance { get; set; }
|
||||
public bool InsuranceInPerson { get; set; }
|
||||
public bool Contract { get; set; }
|
||||
public bool ContractInPerson { get; set; }
|
||||
public bool RollCall { get; set; }
|
||||
public bool RollCallInPerson { get; set; }
|
||||
public bool CustomizeCheckout { get; set; }
|
||||
}
|
||||
@@ -967,7 +967,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
var contractingPartyFullName = contractingParty.FName + " " + contractingParty.LName;
|
||||
|
||||
var workshopDetails = command.Workshops.Select(x =>
|
||||
new InstitutionContractWorkshopDetail(x.WorkshopName, x.HasRollCallPlan, x.HasCustomizeCheckoutPlan,
|
||||
new InstitutionContractWorkshopDetail(x.WorkshopName, x.HasRollCallPlan,false, x.HasCustomizeCheckoutPlan,
|
||||
x.HasContractPlan, x.HasContractPlanInPerson,x.HasInsurancePlan,x.HasInsurancePlanInPerson,x.PersonnelCount, x.Price)).ToList();
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,17 @@ public class InstitutionContractWorkshopGroupDetailMapping : IEntityTypeConfigur
|
||||
initialDetails.WithOwner().HasForeignKey(x => x.InstitutionContractWorkshopGroupId);
|
||||
initialDetails.Property(x => x.WorkshopName).HasMaxLength(100);
|
||||
initialDetails.Property(x => x.WorkshopId).IsRequired(false);
|
||||
|
||||
initialDetails.OwnsOne(x => x.Services, service =>
|
||||
{
|
||||
service.Property(x => x.Contract).IsRequired();
|
||||
service.Property(x => x.ContractInPerson).IsRequired();
|
||||
service.Property(x => x.Insurance).IsRequired();
|
||||
service.Property(x => x.InsuranceInPerson).IsRequired();
|
||||
service.Property(x => x.RollCall).IsRequired();
|
||||
service.Property(x => x.CustomizeCheckout).IsRequired();
|
||||
});
|
||||
|
||||
initialDetails.OwnsMany(x => x.Employers, employer =>
|
||||
{
|
||||
employer.ToTable("InstitutionContractInitialWorkshopDetailEmployers");
|
||||
@@ -44,6 +55,17 @@ public class InstitutionContractWorkshopGroupDetailMapping : IEntityTypeConfigur
|
||||
currentDetails.WithOwner().HasForeignKey(x => x.InstitutionContractWorkshopGroupId);
|
||||
currentDetails.Property(x => x.WorkshopName).HasMaxLength(100);
|
||||
currentDetails.Property(x => x.WorkshopId).IsRequired(false);
|
||||
|
||||
currentDetails.OwnsOne(x => x.Services, service =>
|
||||
{
|
||||
service.Property(x => x.Contract).IsRequired();
|
||||
service.Property(x => x.ContractInPerson).IsRequired();
|
||||
service.Property(x => x.Insurance).IsRequired();
|
||||
service.Property(x => x.InsuranceInPerson).IsRequired();
|
||||
service.Property(x => x.RollCall).IsRequired();
|
||||
service.Property(x => x.CustomizeCheckout).IsRequired();
|
||||
});
|
||||
|
||||
currentDetails.OwnsMany(x => x.Employers, employer =>
|
||||
{
|
||||
employer.ToTable("InstitutionContractCurrentWorkshopDetailEmployers"); // Changed table name
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,398 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddWorkshopservicesForInstitutionWorkshopDetails : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_InstitutionContractCurrentWorkshopDetails_InstitutionContractWorkshopGroup_InstitutionContractWorkshopGroupId",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_InstitutionContractInitialWorkshopDetails_InstitutionContractWorkshopGroup_InstitutionContractWorkshopGroupId",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_InstitutionContractWorkshopGroup_InstitutionContracts_InstitutionContractId",
|
||||
table: "InstitutionContractWorkshopGroup");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_InstitutionContractWorkshopGroup",
|
||||
table: "InstitutionContractWorkshopGroup");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasContractPlan",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasContractPlanInPerson",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasCustomizeCheckoutPlan",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasInsurancePlan",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasInsurancePlanInPerson",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasRollCallPlan",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasContractPlan",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasContractPlanInPerson",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasCustomizeCheckoutPlan",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasInsurancePlan",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasInsurancePlanInPerson",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasRollCallPlan",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "InstitutionContractWorkshopGroup",
|
||||
newName: "InstitutionContractWorkshopGroups");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_InstitutionContractWorkshopGroup_InstitutionContractId",
|
||||
table: "InstitutionContractWorkshopGroups",
|
||||
newName: "IX_InstitutionContractWorkshopGroups_InstitutionContractId");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_Contract",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_ContractInPerson",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_CustomizeCheckout",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_Insurance",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_InsuranceInPerson",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_RollCall",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_RollCallInPerson",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_Contract",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_ContractInPerson",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_CustomizeCheckout",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_Insurance",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_InsuranceInPerson",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_RollCall",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Services_RollCallInPerson",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_InstitutionContractWorkshopGroups",
|
||||
table: "InstitutionContractWorkshopGroups",
|
||||
column: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_InstitutionContractCurrentWorkshopDetails_InstitutionContractWorkshopGroups_InstitutionContractWorkshopGroupId",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
column: "InstitutionContractWorkshopGroupId",
|
||||
principalTable: "InstitutionContractWorkshopGroups",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_InstitutionContractInitialWorkshopDetails_InstitutionContractWorkshopGroups_InstitutionContractWorkshopGroupId",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
column: "InstitutionContractWorkshopGroupId",
|
||||
principalTable: "InstitutionContractWorkshopGroups",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_InstitutionContractWorkshopGroups_InstitutionContracts_InstitutionContractId",
|
||||
table: "InstitutionContractWorkshopGroups",
|
||||
column: "InstitutionContractId",
|
||||
principalTable: "InstitutionContracts",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_InstitutionContractCurrentWorkshopDetails_InstitutionContractWorkshopGroups_InstitutionContractWorkshopGroupId",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_InstitutionContractInitialWorkshopDetails_InstitutionContractWorkshopGroups_InstitutionContractWorkshopGroupId",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_InstitutionContractWorkshopGroups_InstitutionContracts_InstitutionContractId",
|
||||
table: "InstitutionContractWorkshopGroups");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_InstitutionContractWorkshopGroups",
|
||||
table: "InstitutionContractWorkshopGroups");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_Contract",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_ContractInPerson",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_CustomizeCheckout",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_Insurance",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_InsuranceInPerson",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_RollCall",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_RollCallInPerson",
|
||||
table: "InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_Contract",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_ContractInPerson",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_CustomizeCheckout",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_Insurance",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_InsuranceInPerson",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_RollCall",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Services_RollCallInPerson",
|
||||
table: "InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "InstitutionContractWorkshopGroups",
|
||||
newName: "InstitutionContractWorkshopGroup");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_InstitutionContractWorkshopGroups_InstitutionContractId",
|
||||
table: "InstitutionContractWorkshopGroup",
|
||||
newName: "IX_InstitutionContractWorkshopGroup_InstitutionContractId");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasContractPlan",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasContractPlanInPerson",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasCustomizeCheckoutPlan",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasInsurancePlan",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasInsurancePlanInPerson",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasRollCallPlan",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasContractPlan",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasContractPlanInPerson",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasCustomizeCheckoutPlan",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasInsurancePlan",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasInsurancePlanInPerson",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasRollCallPlan",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_InstitutionContractWorkshopGroup",
|
||||
table: "InstitutionContractWorkshopGroup",
|
||||
column: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_InstitutionContractCurrentWorkshopDetails_InstitutionContractWorkshopGroup_InstitutionContractWorkshopGroupId",
|
||||
table: "InstitutionContractCurrentWorkshopDetails",
|
||||
column: "InstitutionContractWorkshopGroupId",
|
||||
principalTable: "InstitutionContractWorkshopGroup",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_InstitutionContractInitialWorkshopDetails_InstitutionContractWorkshopGroup_InstitutionContractWorkshopGroupId",
|
||||
table: "InstitutionContractInitialWorkshopDetails",
|
||||
column: "InstitutionContractWorkshopGroupId",
|
||||
principalTable: "InstitutionContractWorkshopGroup",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_InstitutionContractWorkshopGroup_InstitutionContracts_InstitutionContractId",
|
||||
table: "InstitutionContractWorkshopGroup",
|
||||
column: "InstitutionContractId",
|
||||
principalTable: "InstitutionContracts",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3286,7 +3286,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.HasIndex("InstitutionContractId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("InstitutionContractWorkshopGroup");
|
||||
b.ToTable("InstitutionContractWorkshopGroups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.InstitutionContractContactInfoAgg.InstitutionContractContactInfo", b =>
|
||||
@@ -9747,24 +9747,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<bool>("HasContractPlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<bool>("HasContractPlanInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<bool>("HasCustomizeCheckoutPlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<bool>("HasInsurancePlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<bool>("HasInsurancePlanInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<bool>("HasRollCallPlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<long>("InstitutionContractId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -9824,7 +9806,43 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasForeignKey("InstitutionContractWorkshopDetailId");
|
||||
});
|
||||
|
||||
b1.OwnsOne("CompanyManagment.App.Contracts.InstitutionContract.WorkshopServices", "Services", b2 =>
|
||||
{
|
||||
b2.Property<long>("InstitutionContractWorkshopDetailid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b2.Property<bool>("Contract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("ContractInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("CustomizeCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("Insurance")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("InsuranceInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("RollCall")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("RollCallInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.HasKey("InstitutionContractWorkshopDetailid");
|
||||
|
||||
b2.ToTable("InstitutionContractCurrentWorkshopDetails");
|
||||
|
||||
b2.WithOwner()
|
||||
.HasForeignKey("InstitutionContractWorkshopDetailid");
|
||||
});
|
||||
|
||||
b1.Navigation("Employers");
|
||||
|
||||
b1.Navigation("Services");
|
||||
});
|
||||
|
||||
b.OwnsMany("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopDetail", "InitialWorkshopDetails", b1 =>
|
||||
@@ -9838,24 +9856,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<bool>("HasContractPlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<bool>("HasContractPlanInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<bool>("HasCustomizeCheckoutPlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<bool>("HasInsurancePlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<bool>("HasInsurancePlanInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<bool>("HasRollCallPlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<long>("InstitutionContractId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -9915,7 +9915,43 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasForeignKey("InstitutionContractWorkshopDetailId");
|
||||
});
|
||||
|
||||
b1.OwnsOne("CompanyManagment.App.Contracts.InstitutionContract.WorkshopServices", "Services", b2 =>
|
||||
{
|
||||
b2.Property<long>("InstitutionContractWorkshopDetailid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b2.Property<bool>("Contract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("ContractInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("CustomizeCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("Insurance")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("InsuranceInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("RollCall")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("RollCallInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.HasKey("InstitutionContractWorkshopDetailid");
|
||||
|
||||
b2.ToTable("InstitutionContractInitialWorkshopDetails");
|
||||
|
||||
b2.WithOwner()
|
||||
.HasForeignKey("InstitutionContractWorkshopDetailid");
|
||||
});
|
||||
|
||||
b1.Navigation("Employers");
|
||||
|
||||
b1.Navigation("Services");
|
||||
});
|
||||
|
||||
b.Navigation("CurrentWorkshopDetails");
|
||||
|
||||
@@ -1016,6 +1016,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
InstitutionContractListSearchModel searchModel)
|
||||
{
|
||||
var query = _context.InstitutionContractSet
|
||||
.Include(x=>x.WorkshopGroup)
|
||||
.Include(x => x.ContactInfoList);
|
||||
|
||||
var now = DateTime.Today;
|
||||
@@ -1223,6 +1224,30 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
var archiveCode = minArchiveCode == 10000000 ? 0 : minArchiveCode;
|
||||
var status = Enum.Parse<InstitutionContractListStatus>(x.StatusPriority.ToString());
|
||||
var workshopDetails = x.contract.WorkshopGroup.CurrentWorkshopDetails.Select(w=>
|
||||
{
|
||||
Workshop workshopSelected = null;
|
||||
if (w.WorkshopId != null && workshops.Select(ww => ww.id).Contains(w.WorkshopId.Value))
|
||||
{
|
||||
workshopSelected = workshops.First(ww => ww.id == w.WorkshopId.Value);
|
||||
}
|
||||
|
||||
return new InstitutionContractListWorkshop()
|
||||
{
|
||||
EmployeeCount = w.PersonnelCount,
|
||||
WorkshopName = workshopSelected?.WorkshopName??w.WorkshopName,
|
||||
WorkshopServices = new WorkshopServicesViewModel()
|
||||
{
|
||||
Contract =w.Services.Contract,
|
||||
ContractInPerson = w.Services.ContractInPerson,
|
||||
CustomizeCheckout = w.Services.CustomizeCheckout,
|
||||
Insurance = w.Services.Insurance,
|
||||
InsuranceInPerson = w.Services.InsuranceInPerson,
|
||||
RollCall = w.Services.RollCall,
|
||||
RollCallInPerson = w.Services.RollCallInPerson
|
||||
}
|
||||
};
|
||||
}).ToList();
|
||||
return new GetInstitutionContractListItemsViewModel()
|
||||
{
|
||||
ContractAmount = x.contract.ContractAmount,
|
||||
@@ -1244,12 +1269,13 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
ListStatus = status,
|
||||
IsExpired = x.contract.ContractEndGr <= endThisMontGr,
|
||||
ContractingPartyId = x.contractingParty.id,
|
||||
Workshops = workshopDetails
|
||||
};
|
||||
}).ToList()
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
public async Task<GetInstitutionContractListStatsViewModel> GetListStats(
|
||||
InstitutionContractListSearchModel searchModel)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
//server
|
||||
"MesbahDbServer": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
|
||||
|
||||
|
||||
//local
|
||||
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
|
||||
|
||||
|
||||
Reference in New Issue
Block a user