public async Task ExecuteAsync(RaiseEmployeeSalaryUseCaseInput input)
        {
            var employee = await _employeeRepository.GetAsync(input.Id);

            if (employee == null)
            {
                throw new InvalidOperationException("Employee not found");
            }

            employee.RaiseSalary(input.Salary);

            await _employeeRepository.UpdateAsync(employee);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> RaiseSalary(RaiseEmployeeSalaryUseCaseInput input)
        {
            await _raiseEmployeeSalaryUseCase.ExecuteAsync(input);

            return(Ok());
        }