using Microsoft.AspNetCore.Mvc; using PlanTempus.Application.Features.Localization.Services; namespace PlanTempus.Application.Features.Employees.Components; public class EmployeeDetailSalaryViewComponent : ViewComponent { private readonly ILocalizationService _localization; public EmployeeDetailSalaryViewComponent(ILocalizationService localization) { _localization = localization; } public IViewComponentResult Invoke(string key) { var employee = EmployeeDetailCatalog.Get(key); var model = new EmployeeDetailSalaryViewModel { BankAccount = employee.BankAccount, TaxCard = employee.TaxCard, HourlyRate = employee.HourlyRate, MonthlyFixedSalary = employee.MonthlyFixedSalary, LabelPaymentInfo = _localization.Get("employees.detail.salary.paymentinfo"), LabelBankAccount = _localization.Get("employees.detail.salary.bankaccount"), LabelTaxCard = _localization.Get("employees.detail.salary.taxcard"), LabelSalarySettings = _localization.Get("employees.detail.salary.settings"), LabelHourlyRate = _localization.Get("employees.detail.salary.hourlyrate"), LabelMonthlyFixed = _localization.Get("employees.detail.salary.monthlyfixed"), LabelCommission = _localization.Get("employees.detail.salary.commission"), LabelProductCommission = _localization.Get("employees.detail.salary.productcommission") }; return View(model); } } public class EmployeeDetailSalaryViewModel { public required string BankAccount { get; init; } public required string TaxCard { get; init; } public required string HourlyRate { get; init; } public required string MonthlyFixedSalary { get; init; } public required string LabelPaymentInfo { get; init; } public required string LabelBankAccount { get; init; } public required string LabelTaxCard { get; init; } public required string LabelSalarySettings { get; init; } public required string LabelHourlyRate { get; init; } public required string LabelMonthlyFixed { get; init; } public required string LabelCommission { get; init; } public required string LabelProductCommission { get; init; } }