private IPaySlipDetails GetPaySlipDetails(EmployeeDetailsInput employeeDetailsInput = null) { if (employeeDetailsInput != null) { _employeeDetailsInput = employeeDetailsInput; } _logger.Information( "Employee details input : FirstName: {0}, Last Name: {1}, Annual Salary: {2}, Super rate (%): {3}, Payment Period: {4}", _employeeDetailsInput.FirstName, _employeeDetailsInput.LastName, _employeeDetailsInput.AnnualSalary, _employeeDetailsInput.SuperPercentage, _employeeDetailsInput.TaxPeriod); var employeeDetails = _mapper.Map <EmployeeDetailsInput, IEmployeeDetails>(_employeeDetailsInput); var employeePayDetailsService = new EmployeePayDetailsService.EmployeePayDetailsService(_employeeMonthlyPayslipAppContext, employeeDetails, _mapper); var paySlip = employeePayDetailsService.GetPaySlip(_taxStructure); if (_employeeMonthlyPayslipAppContext.HasErrors) { _employeeMonthlyPayslipAppContext.LogErrors(); return(paySlip); } _logger.Information( "Employee monthly Pay Slip : FullName: {0},Pay Period: {1}, Gross Income: {2}, Income Tax: {3}, Net Income: {4}, Super: {5}", paySlip.FullName, paySlip.TaxPeriod, paySlip.GrossIncome, paySlip.IncomeTax, paySlip.NetIncome, paySlip.Super); return(paySlip); }
private void ExtractCommandLineParametersIntoObject(ICommandLineParserResult parseResult, IFluentCommandLineParser <CommandLineInputParameters> inputArguments) { _commandLineInputParameters = inputArguments.Object; if (_commandLineInputParameters.IsInputInCSVFormat) { _csvParameters = _mapper.Map <CSVParameters>(_commandLineInputParameters); } _employeeDetailsInput = _mapper.Map <EmployeeDetailsInput>(_commandLineInputParameters); }