Skip to content

Commit

Permalink
Merge pull request #971 from hmrc/DL-8837
Browse files Browse the repository at this point in the history
make communicationsDate optional
  • Loading branch information
scott-goodwin authored Dec 15, 2022
2 parents 6c9aed4 + dbdbc0c commit c43a6d0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/v1/connectors/PenaltiesConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class PenaltiesConnector @Inject()(val http: HttpClient,
correlationId: String): Future[Outcome[FinancialDataResponse]] = {
val vrn = request.vrn.vrn
val searchItem = request.searchItem
val url = appConfig.penaltiesBaseUrl + s"/penalties/penalty/financial-data/VRN/$vrn/VATC?searchType=CHGREF&searchItem=${searchItem}"
val url = appConfig.penaltiesBaseUrl + s"/penalties/penalty/financial-data/VRN/$vrn/VATC?searchType=CHGREF&searchItem=${searchItem}&addPostedInterestDetails=true&addAccruingInterestDetails=true"


def doGet(implicit hc: HeaderCarrier): Future[Outcome[FinancialDataResponse]] = {
Expand Down
8 changes: 4 additions & 4 deletions app/v1/models/response/penalties/PenaltiesResponse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ case class LatePaymentPenaltyDetails(
latePaymentPenalty2Days: Option[String],
latePaymentPenalty2Percentage: Option[BigDecimal],
penaltyChargeCreationDate: Option[String],
communicationsDate: String,
communicationsDate: Option[String],
penaltyChargeReference: Option[String],
penaltyChargeDueDate: Option[String],
appealInformation: Option[Seq[AppealInformation]],
Expand Down Expand Up @@ -75,7 +75,7 @@ object LatePaymentPenaltyDetails {
lPP2Days <- (JsPath \ "LPP2Days").readNullable[String]
lPP2Percentage <- (JsPath \ "LPP2Percentage").readNullable[BigDecimal]
penaltyChargeCreationDate <- (JsPath \ "penaltyChargeCreationDate").readNullable[String]
communicationsDate <- (JsPath \ "communicationsDate").read[String]
communicationsDate <- (JsPath \ "communicationsDate").readNullable[String]
penaltyChargeReference <- (JsPath \ "penaltyChargeReference").readNullable[String]
penaltyChargeDueDate <- (JsPath \ "penaltyChargeDueDate").readNullable[String]
appealInformation <- (JsPath \ "appealInformation").readNullable[Seq[AppealInformation]]
Expand Down Expand Up @@ -226,7 +226,7 @@ case class LateSubmissionPenaltyDetails(
penaltyCreationDate: String,
penaltyExpiryDate: String,
expiryReason: Option[ExpiryReasonUpstream],
communicationsDate: String,
communicationsDate: Option[String],
lateSubmissions: Option[Seq[LateSubmissions]],
appealInformation: Option[Seq[AppealInformation]],
chargeReference: Option[String],
Expand All @@ -245,7 +245,7 @@ object LateSubmissionPenaltyDetails {
penaltyCreationDate <- (JsPath \ "penaltyCreationDate").read[String]
penaltyExpiryDate <- (JsPath \ "penaltyExpiryDate").read[String]
expiryReason <- (JsPath \ "expiryReason").readNullable[ExpiryReasonDownstream]
communicationsDate <- (JsPath \ "communicationsDate").read[String]
communicationsDate <- (JsPath \ "communicationsDate").readNullable[String]
lateSubmissions <- (JsPath \ "lateSubmissions").readNullable[Seq[LateSubmissions]]
appealInformation <- (JsPath \ "appealInformation").readNullable[Seq[AppealInformation]]
chargeReference <- (JsPath \ "chargeReference").readNullable[String]
Expand Down
2 changes: 1 addition & 1 deletion test/v1/constants/FinancialDataConstants.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object FinancialDataConstants {

def financialDataUrl(vrn: String = vrn)(implicit appConfig: AppConfig): String = s"/penalties/penalty/financial-data/VRN/$vrn/VATC"

def financialDataUrlWithConfig(vrn: String = vrn)(implicit appConfig: AppConfig): String = appConfig.penaltiesBaseUrl + s"/penalties/penalty/financial-data/VRN/$vrn/VATC?searchType=CHGREF&searchItem=${searchItem}"
def financialDataUrlWithConfig(vrn: String = vrn)(implicit appConfig: AppConfig): String = appConfig.penaltiesBaseUrl + s"/penalties/penalty/financial-data/VRN/$vrn/VATC?searchType=CHGREF&searchItem=${searchItem}&addPostedInterestDetails=true&addAccruingInterestDetails=true"


val testDownstreamFinancialDetailsNoDocumentDetails: JsValue = {
Expand Down
4 changes: 2 additions & 2 deletions test/v1/constants/PenaltiesConstants.scala
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ object PenaltiesConstants {
penaltyCreationDate = "123",
penaltyExpiryDate = "123",
expiryReason = Some(ExpiryReasonUpstream.`appeal`),
communicationsDate = "123",
communicationsDate = Some("123"),
lateSubmissions = Some(List(LateSubmissions(
lateSubmissionID = "123",
taxReturnStatus = TaxReturnStatus.`Open`,
Expand Down Expand Up @@ -122,7 +122,7 @@ object PenaltiesConstants {
latePaymentPenalty2Days = Some("123"),
latePaymentPenalty2Percentage = Some(123),
penaltyChargeCreationDate = Some("2022-10-11"),
communicationsDate = "2022-10-11",
communicationsDate = Some("2022-10-11"),
penaltyChargeReference = Some("123"),
penaltyChargeDueDate = Some("2022-10-11"),
appealInformation = Some(Seq(
Expand Down

0 comments on commit c43a6d0

Please sign in to comment.