-
-
Save theboreddev/7fab0d460eb4478b9f0142d28b7f9cc1 to your computer and use it in GitHub Desktop.
all together
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun generatePayrollFor(employeeName: String): Either<Problem, Payroll> { | |
return employeeService.findEmployeeByName(employeeName) | |
.flatMap { it?.let { buildPayrollForEmployee(it) } ?: UserDoesNotExistProblem(employeeName).left() } | |
.tapLeft { | |
logger.info("Could not fetch employee: ${it.message()}") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment