Adds salary specifications with detailed accordion view
Introduces new salary specification feature with interactive accordion component Implements detailed salary breakdown including: - Salary specification JSON data model - Salary specification page with printable view - Accordion component for expanding/collapsing salary details - Localization support for new salary labels Enhances employee salary transparency and detail presentation
This commit is contained in:
parent
f3c54dde35
commit
a1059adf06
14 changed files with 1613 additions and 46 deletions
|
|
@ -0,0 +1,46 @@
|
|||
using System.Text.Json;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using PlanTempus.Application.Features.Employees.Components;
|
||||
|
||||
namespace PlanTempus.Application.Features.Employees.Pages;
|
||||
|
||||
public class SalarySpecificationModel : PageModel
|
||||
{
|
||||
private readonly IWebHostEnvironment _environment;
|
||||
|
||||
public SalarySpecificationModel(IWebHostEnvironment environment)
|
||||
{
|
||||
_environment = environment;
|
||||
}
|
||||
|
||||
public SalarySpecificationDto? Specification { get; private set; }
|
||||
public string EmployeeName { get; private set; } = "Emma Larsen";
|
||||
public string EmployeeNumber { get; private set; } = "EMP-001";
|
||||
public string Department { get; private set; } = "Frisør";
|
||||
public string EmploymentType { get; private set; } = "Fuldtid (37 t/uge)";
|
||||
|
||||
public IActionResult OnGet(string period)
|
||||
{
|
||||
var specs = LoadSalarySpecifications();
|
||||
Specification = specs.FirstOrDefault(s => s.PeriodKey == period);
|
||||
|
||||
if (Specification == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return Page();
|
||||
}
|
||||
|
||||
private List<SalarySpecificationDto> LoadSalarySpecifications()
|
||||
{
|
||||
var jsonPath = Path.Combine(_environment.ContentRootPath, "Features", "Employees", "Data", "salarySpecificationMock.json");
|
||||
var json = System.IO.File.ReadAllText(jsonPath);
|
||||
var root = JsonSerializer.Deserialize<SalarySpecificationRoot>(json, new JsonSerializerOptions
|
||||
{
|
||||
PropertyNameCaseInsensitive = true
|
||||
});
|
||||
return root?.Specifications ?? new List<SalarySpecificationDto>();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue