Skip to content

Commit

Permalink
Merge pull request #128 from hmrc/sbaFix
Browse files Browse the repository at this point in the history
update sba to match api spec
  • Loading branch information
tapiwa-tiyemba authored Jan 16, 2025
2 parents ff86dab + ee83f84 commit d0d794d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package models.request.foreign

import models.errors.ServiceError
import models.request.foreign.allowances.ForeignPropertyAllowancesWithCountryCode
import models.responses.StructuredBuildingAllowance
import monocle.Optional
import monocle.macros.GenLens
import play.api.libs.json._
Expand All @@ -37,7 +38,7 @@ case class ForeignPropertyAllowances(
annualInvestmentAllowance: Option[BigDecimal],
propertyAllowance: Option[BigDecimal],
electricChargePointAllowance: Option[BigDecimal],
structuredBuildingAllowance: Option[BigDecimal]
structuredBuildingAllowance: Option[Seq[StructuredBuildingAllowance]]
)

object ForeignPropertyAllowances {
Expand Down
36 changes: 32 additions & 4 deletions test/services/MergeServiceSpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 HM Revenue & Customs
* Copyright 2025 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ package services
import models.domain.JourneyAnswers
import models.request.foreign.{AnnualForeignProperty, ForeignPropertyAllowances}
import models.request.{DeductingTax, PropertyRentalsIncome}
import models.responses.{PeriodicSubmissionId, PropertyAnnualSubmission, PropertyPeriodicSubmission, UkOtherProperty, UkOtherPropertyIncome}
import models.responses._
import org.mockito.Mockito.when
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.mockito.MockitoSugar
Expand Down Expand Up @@ -88,7 +88,18 @@ class MergeServiceSpec extends UnitTest with Matchers with MockitoSugar with Sca
zeroEmissionsGoodsVehicleAllowance = Some(35.35),
otherCapitalAllowance = Some(45.45),
electricChargePointAllowance = Some(55.55),
structuredBuildingAllowance = Some(65.65),
structuredBuildingAllowance = Some(
Seq(
StructuredBuildingAllowance(
amount = 65.65,
Some(
StructuredBuildingAllowanceDate(qualifyingDate = LocalDate.now(), qualifyingAmountExpenditure = 50.00)
),
building =
StructuredBuildingAllowanceBuilding(name = Some("name"), number = Some("number"), postCode = "AB1 2XY")
)
)
),
zeroEmissionsCarAllowance = Some(75.75),
propertyAllowance = Some(85.85)
)
Expand All @@ -108,7 +119,24 @@ class MergeServiceSpec extends UnitTest with Matchers with MockitoSugar with Sca
zeroEmissionsGoodsVehicleAllowance = Some(35.35),
otherCapitalAllowance = Some(45.45),
electricChargePointAllowance = Some(55.55),
structuredBuildingAllowance = Some(65.65),
structuredBuildingAllowance = Some(
Seq(
StructuredBuildingAllowance(
amount = 65.65,
Some(
StructuredBuildingAllowanceDate(
qualifyingDate = LocalDate.now(),
qualifyingAmountExpenditure = 50.00
)
),
building = StructuredBuildingAllowanceBuilding(
name = Some("name"),
number = Some("number"),
postCode = "AB1 2XY"
)
)
)
),
zeroEmissionsCarAllowance = Some(75.75),
propertyAllowance = Some(85.85)
)
Expand Down

0 comments on commit d0d794d

Please sign in to comment.