HRM-10/HRM.BO/Bonus/BonusProcessAndSave.cs
Mohaimen Hasan aa35c40142 BonusProcess
2026-11-12 15:03:31 +06:00

97 lines
3.9 KiB
C#

using System;
using System.Collections.Generic;
namespace HRM.BO
{
/// <summary>
/// Bonus Process screen, "Process" button: calculate the bonus (and tax) of these employees and save it
/// in the same request (api/Bonus/processAndSave). Only the header and the employee IDs travel — the
/// browser no longer sends the whole calculated BonusProcess back for a separate Save.
/// </summary>
public class BonusProcessAndSaveRequest
{
public int BonusID { get; set; }
public DateTime BasicMonth { get; set; }
public DateTime PayDate { get; set; }
public DateTime CuttOfDate { get; set; }
public double CurrProcess { get; set; }
public bool IsDisburseWithSalary { get; set; }
public bool IsTaxProcess { get; set; }
public List<int> EmployeeIDs { get; set; }
}
/// <summary>One saved row of the Bonus Process grid, read back from the database.</summary>
public class BonusProcessGridRow
{
public int BonusProcessDetailID { get; set; }
public int BonusProcessID { get; set; }
public int BonusID { get; set; }
public int EmployeeID { get; set; }
public string EmployeeNo { get; set; }
public string Name { get; set; }
public DateTime? JoiningDate { get; set; }
public bool IsConfirmed { get; set; }
public double GrossSalary { get; set; }
public double BasicSalary { get; set; }
public double BonusAmount { get; set; }
public double ChangeBonusAmount { get; set; }
public double TaxAmount { get; set; }
public double ChangeTaxAmount { get; set; }
}
/// <summary>What processAndSave returns: the saved process and its rows.</summary>
public class BonusProcessAndSaveResult
{
public int BonusProcessID { get; set; }
public List<BonusProcessGridRow> Rows { get; set; } = new List<BonusProcessGridRow>();
/// <summary>Employees left out because this bonus was already processed for them this month.</summary>
public List<int> AlreadyProcessedEmployeeIDs { get; set; } = new List<int>();
}
/// <summary>
/// Modify dialog, "Calculate": the tax of one saved row for this bonus amount
/// (api/Bonus/calculateRowTax). Nothing is saved.
/// </summary>
public class BonusProcessRowTaxRequest
{
public int BonusProcessDetailID { get; set; }
public double BonusAmount { get; set; }
}
public class BonusProcessRowTaxResult
{
public int BonusProcessDetailID { get; set; }
public double BonusAmount { get; set; }
public double TaxAmount { get; set; }
}
/// <summary>
/// Modify dialog, "Save": saves one row (api/Bonus/saveRow). With CalculateTax the server works the tax
/// out again from BonusAmount (TaxAmount is ignored); without it TaxAmount is the amount typed in.
/// </summary>
public class BonusProcessRowSaveRequest
{
public int BonusProcessDetailID { get; set; }
public double BonusAmount { get; set; }
public double TaxAmount { get; set; }
public bool CalculateTax { get; set; }
/// <summary>
/// "Edited Tax Amount" (with CalculateTax): the tax the user settled on after seeing the calculated one.
/// Saved as CHANGETAXAMOUNT and on the Tax Deducted line; TAXAMOUNT keeps the calculated tax.
/// Null = use the calculated tax.
/// </summary>
public double? EditedTaxAmount { get; set; }
}
/// <summary>
/// Remove button on a saved row (api/Bonus/removeRow/{id}): what was deleted. ProcessDeleted is true when
/// that was the process's last employee, so the (now empty) BONUSPROCESS header was deleted too.
/// </summary>
public class BonusProcessRowRemoveResult
{
public int BonusProcessDetailID { get; set; }
public int BonusProcessID { get; set; }
public bool ProcessDeleted { get; set; }
}
}