Skip to content

Commit 21f9121

Browse files
updating confirm match request parameters
1 parent 3799710 commit 21f9121

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/main/kotlin/uk/gov/justice/digital/hmpps/learnerrecordsapi/models/request/ConfirmMatchRequest.kt

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ import uk.gov.justice.digital.hmpps.learnerrecordsapi.models.db.MatchEntity
66
class ConfirmMatchRequest(
77

88
@field:Pattern(regexp = "^[0-9]{1,10}\$")
9-
val matchingUln: String,
9+
val matchingUln: String? = null,
1010

1111
@field:Pattern(regexp = "^[A-Za-z' ,.-]{3,35}$")
12-
val givenName: String,
12+
val givenName: String? = null,
1313

1414
@field:Pattern(regexp = "^[A-Za-z' ,.-]{3,35}$")
15-
val familyName: String,
15+
val familyName: String? = null,
1616

17-
val matchType: MatchType? = null,
17+
val matchType: MatchType,
1818

19-
val countOfMatchedUlns: String? = null,
19+
val countOfMatchedUlns: String,
2020

2121
) {
2222
fun asMatchEntity(nomisId: String): MatchEntity = MatchEntity(
2323
null,
2424
nomisId,
25-
matchingUln,
26-
givenName,
27-
familyName,
25+
matchingUln.orEmpty(),
26+
givenName.orEmpty(),
27+
familyName.orEmpty(),
2828
matchType.toString(),
29-
countOfMatchedUlns.orEmpty(),
29+
countOfMatchedUlns,
3030
)
3131
}

src/test/kotlin/uk/gov/justice/digital/hmpps/learnerrecordsapi/service/MatchServiceTest.kt

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ class MatchServiceTest {
2222
private val matchedUln = "a1234"
2323
private val givenName = "John"
2424
private val familyName = "Smith"
25-
private val dateOfBirth = LocalDate.now().toISOFormat()
26-
private val gender = Gender.MALE.name
2725

2826
private lateinit var mockMatchRepository: MatchRepository
2927
private lateinit var matchService: MatchService

0 commit comments

Comments
 (0)