generated from ministryofjustice/hmpps-template-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HMAI-286 Make LinkedPrisoner and PrisonerContactRestrictions models c…
…onsistent with new naming (#727) * change model names to adhere to naming convention * update class names * update class name * fix tests * refactor models
- Loading branch information
1 parent
3efd2a1
commit 265f394
Showing
9 changed files
with
151 additions
and
54 deletions.
There are no files selected for viewing
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
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
2 changes: 1 addition & 1 deletion
2
...ationships/PrisonerContactRestrictions.kt → ...dels/hmpps/PrisonerContactRestrictions.kt
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
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
93 changes: 93 additions & 0 deletions
93
...l/hmpps/hmppsintegrationapi/models/personalRelationships/PRPrisonerContactRestrictions.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.personalRelationships | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.ContactGlobalRestriction | ||
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.PrisonerContactRestriction | ||
|
||
data class PRPrisonerContactRestrictions( | ||
var prisonerContactRestrictions: MutableList<PRPrisonerContactRestriction>? = mutableListOf(), | ||
var contactGlobalRestrictions: List<PRContactGlobalRestriction>? = listOf(), | ||
) | ||
|
||
data class PRPrisonerContactRestriction( | ||
val prisonerContactRestrictionId: Long, | ||
val prisonerContactId: Long, | ||
val contactId: Long, | ||
val prisonerNumber: String, | ||
val restrictionType: String, | ||
val restrictionTypeDescription: String, | ||
val startDate: String, | ||
val expiryDate: String, | ||
val comments: String, | ||
val enteredByUsername: String, | ||
val enteredByDisplayName: String, | ||
val createdBy: String, | ||
val createdTime: String, | ||
val updatedBy: String, | ||
val updatedTime: String, | ||
) { | ||
fun toPrisonerContactRestriction() = | ||
PrisonerContactRestriction( | ||
prisonerContactRestrictionId = this.prisonerContactRestrictionId, | ||
prisonerContactId = this.prisonerContactId, | ||
contactId = this.contactId, | ||
prisonerNumber = this.prisonerNumber, | ||
restrictionType = this.restrictionType, | ||
restrictionTypeDescription = this.restrictionTypeDescription, | ||
startDate = this.startDate, | ||
expiryDate = this.expiryDate, | ||
comments = this.comments, | ||
enteredByUsername = this.enteredByUsername, | ||
enteredByDisplayName = this.enteredByDisplayName, | ||
createdBy = this.createdBy, | ||
createdTime = this.createdTime, | ||
updatedBy = this.updatedBy, | ||
updatedTime = this.updatedTime, | ||
) | ||
} | ||
|
||
data class PRContactGlobalRestriction( | ||
@JsonProperty("contactRestrictionId") | ||
val contactRestrictionId: Long, | ||
@JsonProperty("contactId") | ||
val contactId: Long, | ||
@JsonProperty("restrictionType") | ||
val restrictionType: String, | ||
@JsonProperty("restrictionTypeDescription") | ||
val restrictionTypeDescription: String, | ||
@JsonProperty("startDate") | ||
val startDate: String, | ||
@JsonProperty("expiryDate") | ||
val expiryDate: String, | ||
@JsonProperty("comments") | ||
val comments: String, | ||
@JsonProperty("enteredByUsername") | ||
val enteredByUsername: String, | ||
@JsonProperty("enteredByDisplayName") | ||
val enteredByDisplayName: String, | ||
@JsonProperty("createdBy") | ||
val createdBy: String, | ||
@JsonProperty("createdTime") | ||
val createdTime: String, | ||
@JsonProperty("updatedBy") | ||
val updatedBy: String, | ||
@JsonProperty("updatedTime") | ||
val updatedTime: String, | ||
) { | ||
fun toContactGlobalRestriction() = | ||
ContactGlobalRestriction( | ||
contactRestrictionId = this.contactRestrictionId, | ||
contactId = this.contactId, | ||
restrictionType = this.restrictionType, | ||
restrictionTypeDescription = this.restrictionTypeDescription, | ||
startDate = this.startDate, | ||
expiryDate = this.expiryDate, | ||
comments = this.comments, | ||
enteredByUsername = this.enteredByUsername, | ||
enteredByDisplayName = this.enteredByDisplayName, | ||
createdBy = this.createdBy, | ||
createdTime = this.createdTime, | ||
updatedBy = this.updatedBy, | ||
updatedTime = this.updatedTime, | ||
) | ||
} |
6 changes: 0 additions & 6 deletions
6
...s/hmppsintegrationapi/models/personalRelationships/PrisonerContactRestrictionsResponse.kt
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.