-
Notifications
You must be signed in to change notification settings - Fork 0
Ngr 1126 - Adding Page Rent Interim Court details #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests for NGRMonthYear, RaldRepo, InputDateForMonthYear. Missing creating InterimRentSetByTheCourt model also missing to add to RaldUserAnswers. Please address PR bot.
app/uk/gov/hmrc/ngrraldfrontend/controllers/InterimRentSetByTheCourtController.scala
Outdated
Show resolved
Hide resolved
app/uk/gov/hmrc/ngrraldfrontend/controllers/InterimRentSetByTheCourtController.scala
Outdated
Show resolved
Hide resolved
app/uk/gov/hmrc/ngrraldfrontend/models/forms/CommonFormValidators.scala
Outdated
Show resolved
Hide resolved
app/uk/gov/hmrc/ngrraldfrontend/models/forms/CommonFormValidators.scala
Outdated
Show resolved
Hide resolved
app/uk/gov/hmrc/ngrraldfrontend/models/forms/InterimRentSetByTheCourtForm.scala
Outdated
Show resolved
Hide resolved
app/uk/gov/hmrc/ngrraldfrontend/views/InterimRentSetByTheCourtView.scala.html
Outdated
Show resolved
Hide resolved
app/uk/gov/hmrc/ngrraldfrontend/views/InterimRentSetByTheCourtView.scala.html
Outdated
Show resolved
Hide resolved
test/uk/gov/hmrc/ngrraldfrontend/controllers/InterimRentSetByTheCourtControllerSpec.scala
Show resolved
Hide resolved
app/uk/gov/hmrc/ngrraldfrontend/models/forms/InterimRentSetByTheCourtForm.scala
Show resolved
Hide resolved
app/uk/gov/hmrc/ngrraldfrontend/models/forms/ProvideDetailsOfFirstSecondRentPeriodForm.scala
Show resolved
Hide resolved
|
||
import play.api.libs.json.{Json, OFormat} | ||
|
||
case class InterimRentSetByTheCourt(amount: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add spec for this?
regexp(amountRegex.pattern(), howMuchFormatError) | ||
) | ||
) | ||
.transform[BigDecimal](BigDecimal(_).setScale(2, RoundingMode.UP), _.toString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably need to change to RoundingMode.HALF_UP. Because RoundingMode.UP will round up even it's less than 5. Ex. 3.3 will become 4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even with the half round it still dropping the last decimal
"insert interim rent amount and start date" in { | ||
await(repository.insertInterimRentSetByTheCourt(credId, 10000.00, "2020-1")) | ||
val actual = await(repository.findByCredId(credId)) | ||
actual shouldBe Some(RaldUserAnswers(credId, NewAgreement, property, interimRentSetByTheCourt = Some(InterimRentSetByTheCourt(amount = "10000.0", date = "2020-1")))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't feel right for me. I checked that BigDecimal from your form is scale to 2. But toString is missing one decimal. What do you think?
226fda9
to
7403545
Compare
|
No description provided.