using System; using System.Collections.Generic; namespace HRM.BO { /// /// 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. /// 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 EmployeeIDs { get; set; } } /// One saved row of the Bonus Process grid, read back from the database. 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; } } /// What processAndSave returns: the saved process and its rows. public class BonusProcessAndSaveResult { public int BonusProcessID { get; set; } public List Rows { get; set; } = new List(); /// Employees left out because this bonus was already processed for them this month. public List AlreadyProcessedEmployeeIDs { get; set; } = new List(); } /// /// Modify dialog, "Calculate": the tax of one saved row for this bonus amount /// (api/Bonus/calculateRowTax). Nothing is saved. /// 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; } } /// /// 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. /// public class BonusProcessRowSaveRequest { public int BonusProcessDetailID { get; set; } public double BonusAmount { get; set; } public double TaxAmount { get; set; } public bool CalculateTax { get; set; } /// /// "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. /// public double? EditedTaxAmount { get; set; } } /// /// 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. /// public class BonusProcessRowRemoveResult { public int BonusProcessDetailID { get; set; } public int BonusProcessID { get; set; } public bool ProcessDeleted { get; set; } } }