Skip to content

Commit

Permalink
Split returns into declareDuty, returns and payments packages (#189)
Browse files Browse the repository at this point in the history
* Split returns into declareDuty, returns and payments packages

* Further package updates from code review
  • Loading branch information
davidfes authored Oct 25, 2024
1 parent 31ee020 commit a1adab5
Show file tree
Hide file tree
Showing 151 changed files with 543 additions and 559 deletions.
2 changes: 1 addition & 1 deletion app/connectors/AlcoholDutyCalculatorConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package connectors

import config.FrontendAppConfig
import models.adjustment.{AdjustmentDuty, AdjustmentTypes}
import models.returns.AlcoholDuty
import models.declareDuty.AlcoholDuty
import models.{AlcoholRegime, RateBand, RatePeriod}
import play.api.http.Status.OK
import play.api.libs.json.Json
Expand Down
3 changes: 2 additions & 1 deletion app/connectors/AlcoholDutyReturnsConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ package connectors
import cats.data.EitherT
import config.FrontendAppConfig
import models.ObligationData
import models.returns.{AdrReturnCreatedDetails, AdrReturnSubmission, ReturnDetails}
import models.checkAndSubmit.{AdrReturnCreatedDetails, AdrReturnSubmission}
import models.returns.{ReturnDetails}
import play.api.Logging
import uk.gov.hmrc.http.{HeaderCarrier, HttpReadsInstances, HttpResponse, StringContextOps, UpstreamErrorResponse}

Expand Down
2 changes: 1 addition & 1 deletion app/connectors/DutyCalculation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package connectors

import models.returns.VolumeAndRateByTaxType
import models.declareDuty.VolumeAndRateByTaxType
import models.adjustment.AdjustmentTypes
import play.api.libs.json.{Json, OFormat}

Expand Down
3 changes: 1 addition & 2 deletions app/controllers/BeforeStartReturnController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import services.AuditService
import uk.gov.hmrc.alcoholdutyreturns.models.ReturnAndUserDetails
import uk.gov.hmrc.http.HeaderCarrier
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.BeforeStartReturnViewModel
import viewmodels.returns.ReturnPeriodViewModel
import viewmodels.{BeforeStartReturnViewModel, ReturnPeriodViewModel}
import views.html.BeforeStartReturnView

import java.time.{Clock, Instant, LocalDate}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import models.requests.DataRequest
import play.api.Logging
import play.api.data.Form
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.returns.RateBandHelper.rateBandContent
import viewmodels.declareDuty.RateBandHelper.rateBandContent
import views.html.adjustment.AdjustmentVolumeView

import scala.concurrent.{ExecutionContext, Future}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import models.requests.DataRequest
import play.api.Logging
import play.api.data.Form
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.returns.RateBandHelper.rateBandContent
import viewmodels.declareDuty.RateBandHelper.rateBandContent
import views.html.adjustment.AdjustmentVolumeWithSPRView

import scala.concurrent.{ExecutionContext, Future}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import connectors.AlcoholDutyReturnsConnector
import controllers.actions._
import models.UserAnswers
import models.audit.AuditReturnSubmitted
import models.returns.AdrReturnSubmission
import models.checkAndSubmit.AdrReturnSubmission
import play.api.Logging

import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.libs.json.Json
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.DateTimeHelper
import viewmodels.returns.ReturnPeriodViewModel
import viewmodels.{DateTimeHelper, ReturnPeriodViewModel}
import views.html.checkAndSubmit.ReturnSubmittedView

class ReturnSubmittedController @Inject() (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import controllers.actions._
import forms.returns.AlcoholTypeFormProvider
import forms.declareDuty.AlcoholTypeFormProvider

import javax.inject.Inject
import models.{AlcoholRegime, Mode, UserAnswers}
import navigation.ReturnsNavigator
import pages.returns.{AlcoholTypePage, nextPages}
import pages.declareDuty.{AlcoholTypePage, nextPages}
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import connectors.CacheConnector
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import views.html.returns.AlcoholTypeView
import views.html.declareDuty.AlcoholTypeView

import scala.concurrent.{ExecutionContext, Future}
import scala.util.Try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import controllers.actions._
import models.AlcoholRegime
Expand All @@ -24,8 +24,8 @@ import javax.inject.Inject
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.returns.CheckYourAnswersSummaryListHelper
import views.html.returns.CheckYourAnswersView
import viewmodels.declareDuty.CheckYourAnswersSummaryListHelper
import views.html.declareDuty.CheckYourAnswersView

class CheckYourAnswersController @Inject() (
override val messagesApi: MessagesApi,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import connectors.CacheConnector
import controllers.actions._
import models.returns.VolumeAndRateByTaxType
import models.declareDuty.VolumeAndRateByTaxType
import models.{AlcoholRegime, UserAnswers}
import pages.returns.{MultipleSPRListPage, TellUsAboutMultipleSPRRatePage}
import pages.declareDuty.{MultipleSPRListPage, TellUsAboutMultipleSPRRatePage}
import play.api.Logging

import javax.inject.Inject
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.returns.CheckYourAnswersSPRSummaryListHelper
import views.html.returns.CheckYourAnswersSPRView
import viewmodels.declareDuty.CheckYourAnswersSPRSummaryListHelper
import views.html.declareDuty.CheckYourAnswersSPRView

import scala.concurrent.{ExecutionContext, Future}
import scala.util.Try
Expand Down Expand Up @@ -68,7 +68,7 @@ class CheckYourAnswersSPRController @Inject() (
updatedUserAnswers <- Future.fromTry(updateUserAnswer(request.userAnswers, regime, sprRateEntry, index))
cleanedUserAnswers <- Future.fromTry(updatedUserAnswers.removeByKey(TellUsAboutMultipleSPRRatePage, regime))
_ <- cacheConnector.set(cleanedUserAnswers)
} yield Redirect(controllers.returns.routes.MultipleSPRListController.onPageLoad(regime))
} yield Redirect(controllers.declareDuty.routes.MultipleSPRListController.onPageLoad(regime))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import connectors.CacheConnector
import controllers.actions._
import forms.returns.DeclareAlcoholDutyQuestionFormProvider
import forms.declareDuty.DeclareAlcoholDutyQuestionFormProvider
import models.AlcoholRegime.{Beer, Cider, OtherFermentedProduct, Spirits, Wine}
import models.{AlcoholRegime, Mode, UserAnswers}
import navigation.ReturnsNavigator
import pages.returns.{AlcoholTypePage, DeclareAlcoholDutyQuestionPage, sectionPages}
import pages.declareDuty.{AlcoholTypePage, DeclareAlcoholDutyQuestionPage, sectionPages}
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import views.html.returns.DeclareAlcoholDutyQuestionView
import views.html.declareDuty.DeclareAlcoholDutyQuestionView

import javax.inject.Inject
import scala.concurrent.{ExecutionContext, Future}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import controllers.actions._
import forms.returns.DeleteMultipleSPREntryFormProvider
import forms.declareDuty.DeleteMultipleSPREntryFormProvider

import javax.inject.Inject
import models.{AlcoholRegime, NormalMode}
import pages.returns.{DeleteMultipleSPREntryPage, MultipleSPRListPage}
import pages.declareDuty.{DeleteMultipleSPREntryPage, MultipleSPRListPage}
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import connectors.CacheConnector
import navigation.ReturnsNavigator
import play.api.Logging
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import views.html.returns.DeleteMultipleSPREntryView
import views.html.declareDuty.DeleteMultipleSPREntryView

import scala.concurrent.{ExecutionContext, Future}

Expand Down Expand Up @@ -80,7 +80,8 @@ class DeleteMultipleSPREntryController @Inject() (
navigator.nextPageWithRegime(DeleteMultipleSPREntryPage, NormalMode, updatedAnswers, regime)
)
} else {
Future.successful(Redirect(controllers.returns.routes.MultipleSPRListController.onPageLoad(regime)))
Future
.successful(Redirect(controllers.declareDuty.routes.MultipleSPRListController.onPageLoad(regime)))
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import controllers.actions._
import forms.returns.DoYouHaveMultipleSPRDutyRatesFormProvider
import forms.declareDuty.DoYouHaveMultipleSPRDutyRatesFormProvider

import javax.inject.Inject
import models.{AlcoholRegime, Mode}
import navigation.ReturnsNavigator
import pages.returns.{DoYouHaveMultipleSPRDutyRatesPage, nextPages}
import pages.declareDuty.{DoYouHaveMultipleSPRDutyRatesPage, nextPages}
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import connectors.CacheConnector
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import views.html.returns.DoYouHaveMultipleSPRDutyRatesView
import views.html.declareDuty.DoYouHaveMultipleSPRDutyRatesView

import scala.concurrent.{ExecutionContext, Future}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import connectors.{AlcoholDutyCalculatorConnector, CacheConnector, TotalDutyCalculationRequest}
import controllers.actions._
import models.returns.VolumeAndRateByTaxType
import models.declareDuty.VolumeAndRateByTaxType
import models.{AlcoholRegime, UserAnswers}
import pages.QuestionPage
import pages.returns.{AlcoholDutyPage, DoYouHaveMultipleSPRDutyRatesPage, DutyCalculationPage, HowMuchDoYouNeedToDeclarePage, MultipleSPRListPage, TellUsAboutSingleSPRRatePage}
import pages.declareDuty.{AlcoholDutyPage, DoYouHaveMultipleSPRDutyRatesPage, DutyCalculationPage, HowMuchDoYouNeedToDeclarePage, MultipleSPRListPage, TellUsAboutSingleSPRRatePage}
import play.api.Logging

import javax.inject.Inject
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.returns.DutyCalculationHelper
import views.html.returns.DutyCalculationView
import viewmodels.declareDuty.DutyCalculationHelper
import views.html.declareDuty.DutyCalculationView

import scala.concurrent.{ExecutionContext, Future}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import controllers.actions._
import forms.returns.HowMuchDoYouNeedToDeclareFormProvider
import forms.declareDuty.HowMuchDoYouNeedToDeclareFormProvider

import javax.inject.Inject
import models.{AlcoholRegime, Mode, RateBand}
import navigation.ReturnsNavigator
import pages.returns.{HowMuchDoYouNeedToDeclarePage, WhatDoYouNeedToDeclarePage}
import pages.declareDuty.{HowMuchDoYouNeedToDeclarePage, WhatDoYouNeedToDeclarePage}
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import connectors.CacheConnector
import models.returns.{VolumeAndRateByTaxType, VolumesByTaxType}
import models.declareDuty.{VolumeAndRateByTaxType, VolumesByTaxType}
import play.api.Logging
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.returns.CategoriesByRateTypeHelper
import views.html.returns.HowMuchDoYouNeedToDeclareView
import viewmodels.declareDuty.CategoriesByRateTypeHelper
import views.html.declareDuty.HowMuchDoYouNeedToDeclareView

import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success, Try}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import controllers.actions._
import forms.returns.MultipleSPRListFormProvider
import forms.declareDuty.MultipleSPRListFormProvider

import javax.inject.Inject
import models.{AlcoholRegime, NormalMode}
import navigation.ReturnsNavigator
import pages.returns.DoYouWantToAddMultipleSPRToListPage
import pages.declareDuty.DoYouWantToAddMultipleSPRToListPage
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import connectors.CacheConnector
import play.api.Logging
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.returns.MultipleSPRListHelper
import views.html.returns.MultipleSPRListView
import viewmodels.declareDuty.MultipleSPRListHelper
import views.html.declareDuty.MultipleSPRListView

import scala.concurrent.{ExecutionContext, Future}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import models.AlcoholRegime
import models.requests.DataRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import controllers.actions._
import forms.returns.TellUsAboutMultipleSPRRateFormProvider
import forms.declareDuty.TellUsAboutMultipleSPRRateFormProvider

import javax.inject.Inject
import models.{AlcoholRegime, CheckMode, Mode, NormalMode, UserAnswers}
import navigation.ReturnsNavigator
import pages.returns.{MultipleSPRListPage, TellUsAboutMultipleSPRRatePage, WhatDoYouNeedToDeclarePage}
import pages.declareDuty.{MultipleSPRListPage, TellUsAboutMultipleSPRRatePage, WhatDoYouNeedToDeclarePage}
import play.api.i18n.{I18nSupport, Messages, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import connectors.CacheConnector
import models.returns.VolumeAndRateByTaxType
import models.declareDuty.VolumeAndRateByTaxType
import play.api.Logging
import play.api.data.Form
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.returns.TellUsAboutMultipleSPRRateHelper
import views.html.returns.TellUsAboutMultipleSPRRateView
import viewmodels.declareDuty.TellUsAboutMultipleSPRRateHelper
import views.html.declareDuty.TellUsAboutMultipleSPRRateView

import scala.concurrent.{ExecutionContext, Future}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
* limitations under the License.
*/

package controllers.returns
package controllers.declareDuty

import controllers.actions._
import forms.returns.TellUsAboutSingleSPRRateFormProvider
import forms.declareDuty.TellUsAboutSingleSPRRateFormProvider

import javax.inject.Inject
import models.{AlcoholRegime, Mode}
import navigation.ReturnsNavigator
import pages.returns.{TellUsAboutSingleSPRRatePage, WhatDoYouNeedToDeclarePage}
import pages.declareDuty.{TellUsAboutSingleSPRRatePage, WhatDoYouNeedToDeclarePage}
import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import connectors.CacheConnector
import models.returns.VolumeAndRateByTaxType
import models.declareDuty.VolumeAndRateByTaxType
import play.api.Logging
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController
import viewmodels.returns.CategoriesByRateTypeHelper
import views.html.returns.TellUsAboutSingleSPRRateView
import viewmodels.declareDuty.CategoriesByRateTypeHelper
import views.html.declareDuty.TellUsAboutSingleSPRRateView

import scala.concurrent.{ExecutionContext, Future}

Expand Down
Loading

0 comments on commit a1adab5

Please sign in to comment.