diff --git a/Company.Domain/InsuranceListAgg/InsuranceList.cs b/Company.Domain/InsuranceListAgg/InsuranceList.cs index b0880d7f..9717b967 100644 --- a/Company.Domain/InsuranceListAgg/InsuranceList.cs +++ b/Company.Domain/InsuranceListAgg/InsuranceList.cs @@ -151,6 +151,22 @@ public class InsuranceList : EntityBase /// public double SumOfMarriedAllowance { get; private set; } + #region Mahan + /// + /// بازرسی + /// + public InsuranceListInspection Inspection { get; set; } =new (InsuraceListInspectionType.None,DateTime.MinValue, 0); + /// + /// بدهی + /// + public InsuranceListDebt Debt { get; set; } = new(InsuranceListDebtType.None, DateTime.MinValue, 0, 0); + /// + /// تاییدیه کارفرما + /// + public InsuranceListEmployerApproval EmployerApproval { get; set; } = new(InsuranceListEmployerApprovalStatus.None, string.Empty); + #endregion + + public List InsuranceListWorkshops { get; set; } public void Edit(int sumOfEmployees, int sumOfWorkingDays, double sumOfSalaries, double sumOfBenefitsIncluded, double included, @@ -174,4 +190,73 @@ public class InsuranceList : EntityBase SumOfDailyWagePlusBaseYears = sumOfDailyWage + sumOfBaseYears; } +} + +public class InsuranceListEmployerApproval +{ + public InsuranceListEmployerApproval(InsuranceListEmployerApprovalStatus status, string description) + { + Status = status; + Description = description; + } + + public InsuranceListEmployerApprovalStatus Status { get; set; } + public string Description { get; set; } +} + +public enum InsuranceListEmployerApprovalStatus +{ + None, + /// + /// تاییدیه شفاهی (اذنی) + /// + VerbalApproval, + /// + /// تاییدیه کاغذی + /// + WrittenApproval +} + +public class InsuranceListDebt +{ + public InsuranceListDebt(InsuranceListDebtType type, DateTime debtDate, double amount, long mediaId) + { + Type = type; + DebtDate = debtDate; + Amount = amount; + MediaId = mediaId; + } + + public InsuranceListDebtType Type { get; set; } + public DateTime DebtDate { get; set; } + public double Amount { get; set; } + public long MediaId { get; set; } +} + +public enum InsuranceListDebtType +{ + None, + Old, + New +} + +public class InsuranceListInspection +{ + public InsuranceListInspection(InsuraceListInspectionType type, DateTime lastInspectionDateTime, long mediaId) + { + Type = type; + LastInspectionDateTime = lastInspectionDateTime; + MediaId = mediaId; + } + + public InsuraceListInspectionType Type { get; set; } + public DateTime LastInspectionDateTime { get; set; } + public long MediaId { get; set; } +} + +public enum InsuraceListInspectionType +{ + None, + Old, + New } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Mapping/InsuranceListMapping.cs b/CompanyManagment.EFCore/Mapping/InsuranceListMapping.cs index 5a781b31..c6130319 100644 --- a/CompanyManagment.EFCore/Mapping/InsuranceListMapping.cs +++ b/CompanyManagment.EFCore/Mapping/InsuranceListMapping.cs @@ -13,5 +13,27 @@ public class InsuranceListMapping : IEntityTypeConfiguration builder.Property(x => x.Year).HasMaxLength(4); builder.Property(x => x.Month).HasMaxLength(2); + + builder.ComplexProperty(x => x.Inspection, inspection => + { + inspection.Property(x => x.Type).HasConversion().HasMaxLength(50); + inspection.Property(x => x.LastInspectionDateTime); + inspection.Property(x => x.MediaId); + }); + + builder.ComplexProperty(x => x.Debt, debt => + { + debt.Property(x => x.Type).HasConversion().HasMaxLength(50); + debt.Property(x => x.DebtDate); + debt.Property(x => x.Amount); + debt.Property(x => x.MediaId); + }); + + builder.ComplexProperty(x => x.EmployerApproval, approval => + { + approval.Property(x => x.Status).HasConversion().HasMaxLength(50); + approval.Property(x => x.Description).HasMaxLength(500); + }); + } } \ No newline at end of file