Beispiel #1
0
        public IActionResult Generatepayslip([FromBody] string input)
        {
            var employee = ValidateInputGetEmployee(input);

            if (employee != null)
            {
                var paydetails = _payslipService.GetPayslip(employee.FirstName, employee.LastName, employee.PayPeriod, employee.SuperPercentage, employee.AnnualSalary);

                return(Ok($"{paydetails.FullName},{paydetails.PayPeriod},{paydetails.GrossIncome},{paydetails.IncomeTax},{paydetails.NetIncome},{paydetails.Super}"));
            }
            else
            {
                return(BadRequest("Invalid Input"));
            }
        }
Beispiel #2
0
        public void PayslipValidInputTest()
        {
            var result = _payslipService.GetPayslip("Badri", "Bharath", "1 Sep - 30 Sep", 15, 80000);

            Assert.IsNotNull(result);
        }