Skip to content

Commit

Permalink
VEIOSS-600 Use iossNumber instead of VRN (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmrcvmu authored Apr 11, 2024
1 parent 54f5988 commit cde1565
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions app/connectors/SaveForLaterHttpParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import logging.Logging
import models._
import play.api.http.Status._
import play.api.libs.json._
import uk.gov.hmrc.domain.Vrn
import uk.gov.hmrc.http.{HttpReads, HttpResponse}

import java.time.Instant
Expand Down Expand Up @@ -79,7 +78,7 @@ object SaveForLaterHttpParser extends Logging {
}

case class SavedUserAnswers(
vrn: Vrn,
iossNumber: String,
period: Period,
data: JsObject,
lastUpdated: Instant
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/CheckYourAnswersController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class CheckYourAnswersController @Inject()(
private def saveUserAnswersOnCoreError(redirectLocation: Call)(implicit request: DataRequest[AnyContent]): Future[Result] =
Future.fromTry(request.userAnswers.set(SavedProgressPage, routes.CheckYourAnswersController.onPageLoad().url)).flatMap {
updatedAnswers =>
val saveForLateRequest = SaveForLaterRequest(updatedAnswers, request.vrn, request.userAnswers.period)
val saveForLateRequest = SaveForLaterRequest(updatedAnswers, request.iossNumber, request.userAnswers.period)

saveForLaterConnector.submit(saveForLateRequest).flatMap {
case Right(Some(_)) =>
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/SavedProgressController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SavedProgressController @Inject()(

Future.fromTry(request.userAnswers.set(SavedProgressPage, safeContinueUrl)).flatMap {
updatedAnswers =>
val s4LRequest = SaveForLaterRequest(updatedAnswers, request.vrn, period)
val s4LRequest = SaveForLaterRequest(updatedAnswers, request.iossNumber, period)
(for{
maybeSavedExternalUrl <- vatReturnConnector.getSavedExternalEntry()
s4laterResult <- connector.submit(s4LRequest)
Expand Down
4 changes: 2 additions & 2 deletions app/models/requests/SaveForLaterRequest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import play.api.libs.json.{JsValue, Json, OFormat}
import uk.gov.hmrc.domain.Vrn

case class SaveForLaterRequest(
vrn: Vrn,
iossNumber: String,
period: Period,
data: JsValue
)
Expand All @@ -30,5 +30,5 @@ object SaveForLaterRequest {

implicit val format: OFormat[SaveForLaterRequest] = Json.format[SaveForLaterRequest]

def apply(answers: UserAnswers, vrn: Vrn, period: Period): SaveForLaterRequest = SaveForLaterRequest(vrn, period, answers.data)
def apply(answers: UserAnswers, iossNumber: String, period: Period): SaveForLaterRequest = SaveForLaterRequest(iossNumber, period, answers.data)
}

0 comments on commit cde1565

Please sign in to comment.