94 lines
2.3 KiB
C#
94 lines
2.3 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using _0_Framework.Application;
|
|
using _0_Framework.Domain;
|
|
using CompanyManagment.App.Contracts.Reward.Enums;
|
|
|
|
namespace Company.Domain.RewardAgg;
|
|
|
|
public class Reward:EntityBase
|
|
{
|
|
private Reward()
|
|
{
|
|
|
|
}
|
|
|
|
public Reward(long employeeId, long workshopId, double amount, string description, long rewardedByAccountId,UserType userType, DateTime grantDate, string title , RewardType type = RewardType.None)
|
|
{
|
|
EmployeeId = employeeId;
|
|
WorkshopId = workshopId;
|
|
Amount = amount;
|
|
Description = description;
|
|
CreatedByAccountId = rewardedByAccountId;
|
|
CreatedByUserType = userType;
|
|
GrantDate = grantDate;
|
|
Title = title;
|
|
IsActive = IsActive.True;
|
|
RewardType = type;
|
|
}
|
|
|
|
public long EmployeeId { get; private set; }
|
|
public long WorkshopId { get; private set; }
|
|
|
|
/// <summary>
|
|
/// مبلغ پاداش
|
|
/// </summary>
|
|
public double Amount { get; private set; }
|
|
|
|
/// <summary>
|
|
/// عنوان
|
|
/// </summary>
|
|
public string Title { get; set; }
|
|
|
|
/// <summary>
|
|
/// توضیحات
|
|
/// </summary>
|
|
public string Description { get; private set; }
|
|
|
|
/// <summary>
|
|
/// شخصی که پاداش را ساخته است
|
|
/// </summary>
|
|
public long CreatedByAccountId { get; private set; }
|
|
public UserType CreatedByUserType { get;private set; }
|
|
|
|
|
|
/// <summary>
|
|
/// شخصی که پاداش را ویرایش کرده است
|
|
/// </summary>
|
|
public long LastModifiedByAccountId { get; private set; }
|
|
public UserType LastModifiedByUserType { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
/// تاریخ اعطای پاداش
|
|
/// </summary>
|
|
public DateTime GrantDate { get; set; }
|
|
|
|
public RewardType RewardType { get; set; }
|
|
|
|
public IsActive IsActive { get; private set; }
|
|
|
|
|
|
public void Edit(double amount, string description, long modifiedByAccountId, UserType userType, DateTime grantDate,string title)
|
|
{
|
|
Amount = amount;
|
|
Description = description;
|
|
LastModifiedByAccountId = modifiedByAccountId;
|
|
LastModifiedByUserType = userType;
|
|
GrantDate = grantDate;
|
|
Title = title;
|
|
}
|
|
|
|
public void Active()
|
|
{
|
|
IsActive = IsActive.True;
|
|
}
|
|
|
|
public void DeActive()
|
|
{
|
|
IsActive = IsActive.False;
|
|
}
|
|
|
|
|
|
|
|
} |