Skip to content

Conversation

peterdrobinson
Copy link
Contributor

No description provided.

NGRCharacterCount(
id = "landlord-radio-other",
name = "landlord-radio-other",
id = "landlord-yes",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be confused with the yes radio button id. What do you think of landlord-relationship?

import uk.gov.hmrc.ngrraldfrontend.models.forms.mappings.Mappings

final case class LandlordForm(landlordName: String, landLordType: String, landlordOther: Option[String])
final case class LandlordForm(landlordName: String, landLordType: String, landlordYesSelected: Option[String])
Copy link
Contributor

@anna-shen-hmrc anna-shen-hmrc Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change landType to hasRelationship or something? Can you please store as Boolean
Maybe landlordRelationship or relationshipWithLandlord?

val rentBasedOnForm = input.asInstanceOf[LandlordForm]
if (rentBasedOnForm.landLordType.equals("OtherRelationship") && rentBasedOnForm.landlordOther.getOrElse("").isBlank)
if (rentBasedOnForm.landLordType.equals("LandlordYes") && rentBasedOnForm.landlordYesSelected.getOrElse("").isBlank)
Invalid(otherRadioEmptyError)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change the value name as other radio doesn't exist any more?

val rentBasedOnForm = input.asInstanceOf[LandlordForm]
if (rentBasedOnForm.landLordType.equals("OtherRelationship") && rentBasedOnForm.landlordOther.getOrElse("").length > 250)
if (rentBasedOnForm.landLordType.equals("LandlordYes") && rentBasedOnForm.landlordYesSelected.getOrElse("").length > 250)
Invalid(otherRadioTooLongError)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change the error value name?

landlord.name.empty.tooLong.error = Landlord''s full name must be 50 characters or less
landlord.radio.empty.error = Select what your relationship with the landlord is
landlord.radio.other.empty.error = Tell us what your relationship with the landlord is
landlord.radio.yes = Can you tell us what your relationship with the landlord is?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove unused ones? eg. landlord.radio1

}

def validate(form: LandlordForm): Boolean = {
form.landLordType != "OtherRelationship" ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Landlord type would never be OtherRelationship.

@platops-pr-bot
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants