Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-britton-moj authored Jan 19, 2024
1 parent 05a2c89 commit b8d163a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object ContactGenerator {
}.associateBy { it.code }
val OUTCOMES = ContactOutcome.Code.entries.map {
when (it) {
ContactOutcome.Code.COMPLIED, ContactOutcome.Code.SENT_HOME -> generateOutcome(
ContactOutcome.Code.COMPLIED, ContactOutcome.Code.SENT_HOME, ContactOutcome.Code.APPOINTMENT_KEPT -> generateOutcome(
it.value,
attendance = true,
compliantAcceptable = true
Expand All @@ -37,7 +37,7 @@ object ContactGenerator {
compliantAcceptable = false
)

ContactOutcome.Code.RESCHEDULED_SERVICE_REQUEST, ContactOutcome.Code.RESCHEDULED_POP_REQUEST -> generateOutcome(
ContactOutcome.Code.RESCHEDULED_SERVICE_REQUEST -> generateOutcome(
it.value,
attendance = false,
compliantAcceptable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ class ContactOutcome(
val id: Long
) {
enum class Code(val value: String) {
APPOINTMENT_KEPT("APPK"),
COMPLIED("ATTC"),
FAILED_TO_COMPLY("AFTC"),
FAILED_TO_ATTEND("AFTA"),
RESCHEDULED_SERVICE_REQUEST("RSSR"),
RESCHEDULED_POP_REQUEST("RSOF"),
SENT_HOME("ATSS"),
WITHDRAWN("APPW")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class AppointmentService(

private fun noSession(outcome: Outcome) = when (outcome.noSessionReasonType) {
NoSessionReasonType.POP_UNACCEPTABLE -> Code.FAILED_TO_COMPLY
NoSessionReasonType.POP_ACCEPTABLE -> Code.RESCHEDULED_POP_REQUEST
NoSessionReasonType.POP_ACCEPTABLE -> Code.APPOINTMENT_KEPT
NoSessionReasonType.LOGISTICS -> Code.SENT_HOME
else -> throw IllegalArgumentException("Outcome Scenario Not Mapped: $outcome")
}
Expand Down

0 comments on commit b8d163a

Please sign in to comment.