Skip to content

Commit

Permalink
Man 108 record if complied (#4445)
Browse files Browse the repository at this point in the history
* MAN-156 - update complied column

* MAN-156 - update note to add created by

* Formatting changes

* MAN-108 - append note when updating contact

* Formatting changes

---------

Co-authored-by: probation-integration-bot[bot] <177347787+probation-integration-bot[bot]@users.noreply.github.com>
  • Loading branch information
1 parent d9d185c commit be7e554
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class AppointmentOutcomeIntegrationTest {
val createdAppointment = appointmentRepository.findById(response.appointments[0].id).get()

assertNull(createdAppointment.attended)
assertNull(createdAppointment.complied)
assertNull(createdAppointment.notes)
assertNull(createdAppointment.outcomeId)
assertNull(createdAppointment.sensitive)
Expand All @@ -106,6 +107,7 @@ class AppointmentOutcomeIntegrationTest {
val updatedAppointment = appointmentRepository.findById(response.appointments[0].id).get()

assertEquals("Y", updatedAppointment.attended)
assertEquals("Y", updatedAppointment.complied)
assertEquals(request.notes, updatedAppointment.notes)
assertEquals(ATTENDED_COMPLIED.id, updatedAppointment.outcomeId)
assertFalse(updatedAppointment.sensitive!!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class Appointment(
@Column(name = "attended", columnDefinition = "char(1)")
var attended: String? = null,

@Column(name = "complied", columnDefinition = "char(1")
var complied: String? = null,

@Column(name = "contact_outcome_type_id")
var outcomeId: Long? = null,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class AppointmentOutcomeService(

appointment.apply {
attended = outcome.attended
notes = outcome.notes
complied = if (contactTypeOutcome.outcome.outcomeCompliantAcceptable!!) "Y" else "N"
notes = listOfNotNull(notes, outcome.notes).joinToString(System.lineSeparator())
outcomeId = contactTypeOutcome.outcome.id
sensitive = outcome.sensitive
}
Expand Down

0 comments on commit be7e554

Please sign in to comment.