Files
MahanCh d1e5adf96f add salaryAid calculation Date and
edit checkout on cahnge salary & ...
2025-05-08 14:08:28 +03:30

63 lines
2.1 KiB
C#

using System;
using _0_Framework.Application;
using _0_Framework.Domain;
using Hangfire.Annotations;
namespace Company.Domain.SalaryAidAgg;
public class SalaryAid : EntityBase
{
private SalaryAid()
{
}
public SalaryAid(long employeeId, long workshopId, double amount, DateTime salaryAidDateTime, long createdByAccountId, UserType createdByUserType, int calculationMonth, int calculationYear)
{
EmployeeId = employeeId;
WorkshopId = workshopId;
Amount = amount;
SalaryAidDateTime = salaryAidDateTime;
CreatedByUserType = createdByUserType;
CreatedByAccountId = createdByAccountId;
CalculationDate = $"{calculationYear:0000}/{calculationMonth:00}/01".ToGeorgianDateTime();
CalculationMonth = calculationMonth;
CalculationYear = calculationYear;
}
public long EmployeeId { get; private set; }
public long WorkshopId { get; private set; }
public double Amount { get; private set; }
/// <summary>
/// تاریخ پرداخت
/// </summary>
public DateTime SalaryAidDateTime { get; private set; }
/// <summary>
/// تاریخ محاسبه
/// </summary>
public DateTime CalculationDate { get; private set; }
public int CalculationMonth { get; set; }
public int CalculationYear { get; set; }
public long CreatedByAccountId { get; private set; }
public UserType CreatedByUserType { get; private set; }
public long LastModifiedByAccountId { get; private set; }
public UserType LastModifiedByUserType { get; private set; }
public void Edit(double amount, DateTime salaryAidTime, long modifiedByAccountId, UserType modifiedByUserType, int calculationMonth, int calculationYear)
{
Amount = amount;
SalaryAidDateTime = salaryAidTime;
LastModifiedByAccountId = modifiedByAccountId;
LastModifiedByUserType = modifiedByUserType;
CalculationDate = $"{calculationYear:0000}/{calculationMonth:00}/01".ToGeorgianDateTime();
CalculationMonth = calculationMonth;
CalculationYear = calculationYear;
}
}