Skip to content

Commit

Permalink
BST-109841 6048 - Add page "What you'll need" to the start of trading…
Browse files Browse the repository at this point in the history
… history (#1052)
  • Loading branch information
tumakha authored Oct 17, 2024
1 parent 9bde6e9 commit ed2c420
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ class AboutYourTradingHistoryController @Inject() (

private def getBackLink(answers: Session): String =
answers.forType match {
case ForTypes.for6045 | ForTypes.for6046 | ForTypes.for6076 =>
case ForTypes.for6045 | ForTypes.for6046 | ForTypes.for6048 | ForTypes.for6076 =>
controllers.aboutthetradinghistory.routes.WhatYouWillNeedController.show().url
case _ => controllers.routes.TaskListController.show().url + "#about-your-trading-history"
case _ => controllers.routes.TaskListController.show().url + "#about-your-trading-history"
}

}
30 changes: 30 additions & 0 deletions app/views/aboutthetradinghistory/whatYouWillNeed.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,36 @@
<p class="govuk-body">@messages("whatYouWillNeed.6045.p5")</p>
</li>
}
@if(forType == ForTypes.for6048) {
<li>
<strong>@messages("whatYouWillNeed.6048.l1")</strong>
<p class="govuk-body">@messages("whatYouWillNeed.6048.p1")</p>
</li>
<li>
<strong>@messages("whatYouWillNeed.6048.l2")</strong>
<p class="govuk-body">@messages("whatYouWillNeed.6048.p2")</p>
</li>
<li>
<strong>@messages("whatYouWillNeed.6048.l3")</strong>
<p class="govuk-body">@messages("whatYouWillNeed.6048.p3")</p>
</li>
<li>
<strong>@messages("whatYouWillNeed.6048.l4")</strong>
<p class="govuk-body">@messages("whatYouWillNeed.6048.p4")</p>
</li>
<li>
<strong>@messages("whatYouWillNeed.6048.l5")</strong>
<p class="govuk-body">@messages("whatYouWillNeed.6048.p5")</p>
</li>
<li>
<strong>@messages("whatYouWillNeed.6048.l6")</strong>
<p class="govuk-body">@messages("whatYouWillNeed.6048.p6")</p>
</li>
<li>
<strong>@messages("whatYouWillNeed.6048.l7")</strong>
<p class="govuk-body">@messages("whatYouWillNeed.6048.p7")</p>
</li>
}
@if(forType == ForTypes.for6076) {
<li>
<strong>@messages("whatYouWillNeed.l1")</strong>
Expand Down
2 changes: 1 addition & 1 deletion app/views/taskList.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ <h2 id="tradingHistory" class="app-task-list__section">
</h2>
<ul class="app-task-list__items">
@includes.taskListItem("about-your-trading-history", "aboutYourTradingHistory.heading",
if(forType == ForTypes.for6045 || forType == ForTypes.for6046 || forType == ForTypes.for6076) {
if(forType == ForTypes.for6045 || forType == ForTypes.for6046 || forType == ForTypes.for6048 || forType == ForTypes.for6076) {
controllers.aboutthetradinghistory.routes.WhatYouWillNeedController.show()
} else { controllers.aboutthetradinghistory.routes.AboutYourTradingHistoryController.show() },
section3Completed,
Expand Down
14 changes: 14 additions & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -3003,6 +3003,20 @@ whatYouWillNeed.6045.l4 = Income from touring and tenting pitches
whatYouWillNeed.6045.p4 = Including pitches for caravans, motorhomes, tents, rally areas, or glamping pitches for pre-erected or mobile structures like yurts, tipis or shepherd huts.
whatYouWillNeed.6045.l5 = Trading figures from other activities
whatYouWillNeed.6045.p5 = Including shops, catering, bars and clubs, and amusements.
whatYouWillNeed.6048.l1 = Accounting information
whatYouWillNeed.6048.p1 = Your VAT registration status and your financial year end.
whatYouWillNeed.6048.l2 = Income
whatYouWillNeed.6048.p2 = Including all letting income and income from providing services such as electricity, laundry or meals.
whatYouWillNeed.6048.l3 = Fixed costs
whatYouWillNeed.6048.p3 = Details of costs such as insurance, business rates or rent.
whatYouWillNeed.6048.l4 = Cost of sales
whatYouWillNeed.6048.p4 = Details of any costs incurred.
whatYouWillNeed.6048.l5 = Accounting costs
whatYouWillNeed.6048.p5 = Details of any wages, National Insurance, depreciation, accountancy fees and bank charges.
whatYouWillNeed.6048.l6 = Administrative costs
whatYouWillNeed.6048.p6 = Including subscriptions, telephone and broadband, booking agency fees, advertising and printing.
whatYouWillNeed.6048.l7 = Operational costs
whatYouWillNeed.6048.p7 = Including any utilities, laundry and cleaning, repairs and maintenance, TV licences, travelling expenses and other costs.


# CHECK YOUR ANSWERS
Expand Down
14 changes: 14 additions & 0 deletions conf/messages.cy
Original file line number Diff line number Diff line change
Expand Up @@ -2939,6 +2939,20 @@ whatYouWillNeed.6045.l4 = Income from touring and tenting pitches
whatYouWillNeed.6045.p4 = Including pitches for caravans, motorhomes, tents, rally areas, or glamping pitches for pre-erected or mobile structures like yurts, tipis or shepherd huts.
whatYouWillNeed.6045.l5 = Trading figures from other activities
whatYouWillNeed.6045.p5 = Including shops, catering, bars and clubs, and amusements.
whatYouWillNeed.6048.l1 = Accounting information
whatYouWillNeed.6048.p1 = Your VAT registration status and your financial year end.
whatYouWillNeed.6048.l2 = Income
whatYouWillNeed.6048.p2 = Including all letting income and income from providing services such as electricity, laundry or meals.
whatYouWillNeed.6048.l3 = Fixed costs
whatYouWillNeed.6048.p3 = Details of costs such as insurance, business rates or rent.
whatYouWillNeed.6048.l4 = Cost of sales
whatYouWillNeed.6048.p4 = Details of any costs incurred.
whatYouWillNeed.6048.l5 = Accounting costs
whatYouWillNeed.6048.p5 = Details of any wages, National Insurance, depreciation, accountancy fees and bank charges.
whatYouWillNeed.6048.l6 = Administrative costs
whatYouWillNeed.6048.p6 = Including subscriptions, telephone and broadband, booking agency fees, advertising and printing.
whatYouWillNeed.6048.l7 = Operational costs
whatYouWillNeed.6048.p7 = Including any utilities, laundry and cleaning, repairs and maintenance, TV licences, travelling expenses and other costs.


# CHECK YOUR ANSWERS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,66 @@
package controllers.aboutthetradinghistory

import controllers.aboutthetradinghistory
import models.ForTypes._
import play.api.http.Status
import play.api.test.Helpers.{charset, contentType, redirectLocation, status, stubMessagesControllerComponents}
import utils.TestBaseSpec

class WhatYouWillNeedControllerSpec extends TestBaseSpec {

val whatYouWillNeedController = new WhatYouWillNeedController(
def whatYouWillNeedController(forType: String = for6010) = new WhatYouWillNeedController(
stubMessagesControllerComponents(),
aboutYourTradingHistoryNavigator,
whatYouWillNeedView,
preEnrichedActionRefiner(aboutTheTradingHistory = Some(prefilledAboutYourTradingHistory)),
preEnrichedActionRefiner(
forType = forType,
aboutTheTradingHistory = Some(prefilledAboutYourTradingHistory)
),
mockSessionRepo
)

"GET /" should {
"return 200" in {
val result = whatYouWillNeedController.show(fakeRequest)
val result = whatYouWillNeedController().show(fakeRequest)
status(result) shouldBe Status.OK
}

"return HTML" in {
val result = whatYouWillNeedController.show(fakeRequest)
val result = whatYouWillNeedController().show(fakeRequest)
contentType(result) shouldBe Some("text/html")
charset(result) shouldBe Some("utf-8")
}

"return OK for FOR6045 " in {
val result = whatYouWillNeedController(for6045).show(fakeRequest)
status(result) shouldBe Status.OK
contentType(result) shouldBe Some("text/html")
}

"return OK for FOR6046 " in {
val result = whatYouWillNeedController(for6046).show(fakeRequest)
status(result) shouldBe Status.OK
contentType(result) shouldBe Some("text/html")
}

"return OK for FOR6048 " in {
val result = whatYouWillNeedController(for6048).show(fakeRequest)
status(result) shouldBe Status.OK
contentType(result) shouldBe Some("text/html")
}

"return OK for FOR6076 " in {
val result = whatYouWillNeedController(for6076).show(fakeRequest)
status(result) shouldBe Status.OK
contentType(result) shouldBe Some("text/html")
}
}

"SUBMIT /" should {

"redirect if a form is submitted" in {
val res =
whatYouWillNeedController.submit(fakePostRequest.withFormUrlEncodedBody("whatYouWillNeed" -> "confirmed"))
whatYouWillNeedController().submit(fakePostRequest.withFormUrlEncodedBody("whatYouWillNeed" -> "confirmed"))
status(res) shouldBe Status.SEE_OTHER

redirectLocation(res) shouldBe Some(aboutthetradinghistory.routes.AboutYourTradingHistoryController.show().url)
Expand Down

0 comments on commit ed2c420

Please sign in to comment.