diff --git a/app/uk/gov/hmrc/epayeapi/MicroserviceHelloWorld.scala b/app/uk/gov/hmrc/epayeapi/MicroserviceHelloWorld.scala index 377afd6..792302b 100644 --- a/app/uk/gov/hmrc/epayeapi/MicroserviceHelloWorld.scala +++ b/app/uk/gov/hmrc/epayeapi/MicroserviceHelloWorld.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/config/AppContext.scala b/app/uk/gov/hmrc/epayeapi/config/AppContext.scala index 8314152..b3076b2 100644 --- a/app/uk/gov/hmrc/epayeapi/config/AppContext.scala +++ b/app/uk/gov/hmrc/epayeapi/config/AppContext.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/config/EpayeApiAppLoader.scala b/app/uk/gov/hmrc/epayeapi/config/EpayeApiAppLoader.scala index 09f7bc4..fdd1ce4 100644 --- a/app/uk/gov/hmrc/epayeapi/config/EpayeApiAppLoader.scala +++ b/app/uk/gov/hmrc/epayeapi/config/EpayeApiAppLoader.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/config/microserviceGlobal.scala b/app/uk/gov/hmrc/epayeapi/config/microserviceGlobal.scala index 6511dc3..4fb9525 100644 --- a/app/uk/gov/hmrc/epayeapi/config/microserviceGlobal.scala +++ b/app/uk/gov/hmrc/epayeapi/config/microserviceGlobal.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/config/microserviceWiring.scala b/app/uk/gov/hmrc/epayeapi/config/microserviceWiring.scala index 566bb6f..7002bfd 100644 --- a/app/uk/gov/hmrc/epayeapi/config/microserviceWiring.scala +++ b/app/uk/gov/hmrc/epayeapi/config/microserviceWiring.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/connectors/ConnectorBase.scala b/app/uk/gov/hmrc/epayeapi/connectors/ConnectorBase.scala index eec9c95..2b8d511 100644 --- a/app/uk/gov/hmrc/epayeapi/connectors/ConnectorBase.scala +++ b/app/uk/gov/hmrc/epayeapi/connectors/ConnectorBase.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/connectors/EpayeConnector.scala b/app/uk/gov/hmrc/epayeapi/connectors/EpayeConnector.scala index dbe9745..e9dfad6 100644 --- a/app/uk/gov/hmrc/epayeapi/connectors/EpayeConnector.scala +++ b/app/uk/gov/hmrc/epayeapi/connectors/EpayeConnector.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/connectors/ServiceLocatorConnector.scala b/app/uk/gov/hmrc/epayeapi/connectors/ServiceLocatorConnector.scala index 1b14b1b..4a61e9f 100644 --- a/app/uk/gov/hmrc/epayeapi/connectors/ServiceLocatorConnector.scala +++ b/app/uk/gov/hmrc/epayeapi/connectors/ServiceLocatorConnector.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/connectors/stub/FakeAuthConnector.scala b/app/uk/gov/hmrc/epayeapi/connectors/stub/FakeAuthConnector.scala index b4a2790..06eb1fb 100644 --- a/app/uk/gov/hmrc/epayeapi/connectors/stub/FakeAuthConnector.scala +++ b/app/uk/gov/hmrc/epayeapi/connectors/stub/FakeAuthConnector.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/controllers/ApiController.scala b/app/uk/gov/hmrc/epayeapi/controllers/ApiController.scala index 6ac998c..061e0bd 100644 --- a/app/uk/gov/hmrc/epayeapi/controllers/ApiController.scala +++ b/app/uk/gov/hmrc/epayeapi/controllers/ApiController.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/controllers/DocumentationController.scala b/app/uk/gov/hmrc/epayeapi/controllers/DocumentationController.scala index 440183d..12796e6 100644 --- a/app/uk/gov/hmrc/epayeapi/controllers/DocumentationController.scala +++ b/app/uk/gov/hmrc/epayeapi/controllers/DocumentationController.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/controllers/GetAnnualStatementController.scala b/app/uk/gov/hmrc/epayeapi/controllers/GetAnnualStatementController.scala index 8755cb6..0201b33 100644 --- a/app/uk/gov/hmrc/epayeapi/controllers/GetAnnualStatementController.scala +++ b/app/uk/gov/hmrc/epayeapi/controllers/GetAnnualStatementController.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/controllers/GetEmpRefsController.scala b/app/uk/gov/hmrc/epayeapi/controllers/GetEmpRefsController.scala index cdc8967..6da67b9 100644 --- a/app/uk/gov/hmrc/epayeapi/controllers/GetEmpRefsController.scala +++ b/app/uk/gov/hmrc/epayeapi/controllers/GetEmpRefsController.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/controllers/GetMonthlyStatementController.scala b/app/uk/gov/hmrc/epayeapi/controllers/GetMonthlyStatementController.scala index cc863c1..89c0d89 100644 --- a/app/uk/gov/hmrc/epayeapi/controllers/GetMonthlyStatementController.scala +++ b/app/uk/gov/hmrc/epayeapi/controllers/GetMonthlyStatementController.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/controllers/GetSummaryController.scala b/app/uk/gov/hmrc/epayeapi/controllers/GetSummaryController.scala index 8c0e620..5543aae 100644 --- a/app/uk/gov/hmrc/epayeapi/controllers/GetSummaryController.scala +++ b/app/uk/gov/hmrc/epayeapi/controllers/GetSummaryController.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/Formats.scala b/app/uk/gov/hmrc/epayeapi/models/Formats.scala index 830dd3f..50179ff 100644 --- a/app/uk/gov/hmrc/epayeapi/models/Formats.scala +++ b/app/uk/gov/hmrc/epayeapi/models/Formats.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/TaxMonth.scala b/app/uk/gov/hmrc/epayeapi/models/TaxMonth.scala index 410c3fa..0ba7749 100644 --- a/app/uk/gov/hmrc/epayeapi/models/TaxMonth.scala +++ b/app/uk/gov/hmrc/epayeapi/models/TaxMonth.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/TaxYear.scala b/app/uk/gov/hmrc/epayeapi/models/TaxYear.scala index d4c18bd..303a5d9 100644 --- a/app/uk/gov/hmrc/epayeapi/models/TaxYear.scala +++ b/app/uk/gov/hmrc/epayeapi/models/TaxYear.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/in/EpayeAnnualStatement.scala b/app/uk/gov/hmrc/epayeapi/models/in/EpayeAnnualStatement.scala index 7dcdafc..77b3dfa 100644 --- a/app/uk/gov/hmrc/epayeapi/models/in/EpayeAnnualStatement.scala +++ b/app/uk/gov/hmrc/epayeapi/models/in/EpayeAnnualStatement.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -25,6 +25,7 @@ case class LineItem( charges: BigDecimal, payments: BigDecimal, credits: BigDecimal, + writeOffs: BigDecimal, balance: BigDecimal, dueDate: LocalDate, isSpecified: Boolean = false, @@ -36,6 +37,7 @@ case class AnnualTotal( charges: BigDecimal, payments: BigDecimal, credits: BigDecimal, + writeOffs: BigDecimal, balance: BigDecimal ) diff --git a/app/uk/gov/hmrc/epayeapi/models/in/EpayeCode.scala b/app/uk/gov/hmrc/epayeapi/models/in/EpayeCode.scala index a4c6063..de54359 100644 --- a/app/uk/gov/hmrc/epayeapi/models/in/EpayeCode.scala +++ b/app/uk/gov/hmrc/epayeapi/models/in/EpayeCode.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/in/EpayeMonthlyStatement.scala b/app/uk/gov/hmrc/epayeapi/models/in/EpayeMonthlyStatement.scala index a081855..208a2d5 100644 --- a/app/uk/gov/hmrc/epayeapi/models/in/EpayeMonthlyStatement.scala +++ b/app/uk/gov/hmrc/epayeapi/models/in/EpayeMonthlyStatement.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -22,6 +22,7 @@ case class EpayeMonthlyStatement( charges: EpayeMonthlyCharges, credits: EpayeMonthlyCredits, payments: EpayeMonthlyPaymentDetails, + writeOffs: EpayeMonthlyChargesDetails, hasSpecifiedCharges: Boolean, balance: EpayeMonthlyBalance ) diff --git a/app/uk/gov/hmrc/epayeapi/models/in/EpayeReads.scala b/app/uk/gov/hmrc/epayeapi/models/in/EpayeReads.scala index 1565808..a79b8f8 100644 --- a/app/uk/gov/hmrc/epayeapi/models/in/EpayeReads.scala +++ b/app/uk/gov/hmrc/epayeapi/models/in/EpayeReads.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/in/EpayeResponse.scala b/app/uk/gov/hmrc/epayeapi/models/in/EpayeResponse.scala index 4b7732c..8f99780 100644 --- a/app/uk/gov/hmrc/epayeapi/models/in/EpayeResponse.scala +++ b/app/uk/gov/hmrc/epayeapi/models/in/EpayeResponse.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/in/EpayeTaxMonth.scala b/app/uk/gov/hmrc/epayeapi/models/in/EpayeTaxMonth.scala index 951d94c..5530ad1 100644 --- a/app/uk/gov/hmrc/epayeapi/models/in/EpayeTaxMonth.scala +++ b/app/uk/gov/hmrc/epayeapi/models/in/EpayeTaxMonth.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/in/EpayeTotalsResponse.scala b/app/uk/gov/hmrc/epayeapi/models/in/EpayeTotalsResponse.scala index 3c3e630..682be83 100644 --- a/app/uk/gov/hmrc/epayeapi/models/in/EpayeTotalsResponse.scala +++ b/app/uk/gov/hmrc/epayeapi/models/in/EpayeTotalsResponse.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/out/AnnualStatementJson.scala b/app/uk/gov/hmrc/epayeapi/models/out/AnnualStatementJson.scala index 25c0492..a0ead45 100644 --- a/app/uk/gov/hmrc/epayeapi/models/out/AnnualStatementJson.scala +++ b/app/uk/gov/hmrc/epayeapi/models/out/AnnualStatementJson.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -28,6 +28,7 @@ case class NonRtiChargesJson( amount: BigDecimal, clearedByCredits: BigDecimal, clearedByPayments: BigDecimal, + clearedByWriteOffs: BigDecimal, balance: BigDecimal, dueDate: LocalDate ) @@ -41,21 +42,18 @@ object NonRtiChargesJson { amount = lineItem.charges, clearedByCredits = lineItem.credits, clearedByPayments = lineItem.payments, + clearedByWriteOffs = lineItem.writeOffs, balance = lineItem.balance, dueDate = lineItem.dueDate ) } } -case class PaymentsAndCreditsJson( - payments: BigDecimal, - credits: BigDecimal -) - case class EarlierYearUpdateJson( amount: BigDecimal, clearedByCredits: BigDecimal, clearedByPayments: BigDecimal, + clearedByWriteOffs: BigDecimal, balance: BigDecimal, dueDate: LocalDate ) @@ -66,11 +64,12 @@ object EarlierYearUpdateJson { .find(_.itemType.contains("eyu")) .map { lineItem => EarlierYearUpdateJson( - lineItem.charges, - lineItem.credits, - lineItem.payments, - lineItem.balance, - lineItem.dueDate + amount = lineItem.charges, + clearedByCredits = lineItem.credits, + clearedByPayments = lineItem.payments, + clearedByWriteOffs = lineItem.writeOffs, + balance = lineItem.balance, + dueDate = lineItem.dueDate ) } } @@ -86,6 +85,7 @@ case class MonthlyChargesJson( amount: BigDecimal, clearedByCredits: BigDecimal, clearedByPayments: BigDecimal, + clearedByWriteOffs: BigDecimal, balance: BigDecimal, dueDate: LocalDate, isSpecified: Boolean, @@ -103,6 +103,7 @@ object MonthlyChargesJson { amount = lineItem.charges, clearedByCredits = lineItem.credits, clearedByPayments = lineItem.payments, + clearedByWriteOffs = lineItem.writeOffs, balance = lineItem.balance, dueDate = lineItem.dueDate, isSpecified = lineItem.isSpecified, diff --git a/app/uk/gov/hmrc/epayeapi/models/out/ApiErrorJson.scala b/app/uk/gov/hmrc/epayeapi/models/out/ApiErrorJson.scala index bdcb72e..e73984a 100644 --- a/app/uk/gov/hmrc/epayeapi/models/out/ApiErrorJson.scala +++ b/app/uk/gov/hmrc/epayeapi/models/out/ApiErrorJson.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/out/EmpRefsJson.scala b/app/uk/gov/hmrc/epayeapi/models/out/EmpRefsJson.scala index 127b735..bd92ac0 100644 --- a/app/uk/gov/hmrc/epayeapi/models/out/EmpRefsJson.scala +++ b/app/uk/gov/hmrc/epayeapi/models/out/EmpRefsJson.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/out/JsonWrites.scala b/app/uk/gov/hmrc/epayeapi/models/out/JsonWrites.scala index 1006b7a..8814890 100644 --- a/app/uk/gov/hmrc/epayeapi/models/out/JsonWrites.scala +++ b/app/uk/gov/hmrc/epayeapi/models/out/JsonWrites.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -58,7 +58,6 @@ trait JsonWrites { implicit lazy val selfLinkWrites: Writes[SelfLink] = writes[SelfLink] implicit lazy val monthlyChargesJsonWrites: Writes[MonthlyChargesJson] = writes[MonthlyChargesJson] implicit lazy val embeddedRtiChargesJsonWrites: Writes[EmbeddedRtiChargesJson] = writes[EmbeddedRtiChargesJson] - implicit lazy val paymentsAndCreditsJsonWrites: Writes[PaymentsAndCreditsJson] = writes[PaymentsAndCreditsJson] implicit lazy val earlierYearUpdateJsonWrites: Writes[EarlierYearUpdateJson] = writes[EarlierYearUpdateJson] implicit lazy val periodJsonWrites: Writes[PeriodJson] = writes[PeriodJson] implicit lazy val nonRtiChargesJsonWrites: Writes[NonRtiChargesJson] = writes[NonRtiChargesJson] diff --git a/app/uk/gov/hmrc/epayeapi/models/out/Link.scala b/app/uk/gov/hmrc/epayeapi/models/out/Link.scala index 241039e..9722d58 100644 --- a/app/uk/gov/hmrc/epayeapi/models/out/Link.scala +++ b/app/uk/gov/hmrc/epayeapi/models/out/Link.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/models/out/MonthlyStatementJson.scala b/app/uk/gov/hmrc/epayeapi/models/out/MonthlyStatementJson.scala index da6b655..7baefee 100644 --- a/app/uk/gov/hmrc/epayeapi/models/out/MonthlyStatementJson.scala +++ b/app/uk/gov/hmrc/epayeapi/models/out/MonthlyStatementJson.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -30,7 +30,8 @@ case class MonthlyStatementJson( interest: Seq[ChargeJson], allocatedCredits: Seq[ChargeJson], allocatedPayments: Seq[PaymentJson], - dueDate: LocalDate, + writeOffs: Seq[ChargeJson], +dueDate: LocalDate, summary: MonthlySummaryJson, _links: MonthlyStatementLinksJson ) @@ -50,6 +51,7 @@ case class MonthlySummaryJson( interest: BigDecimal, clearedByCredits: BigDecimal, clearedByPayments: BigDecimal, + clearedByWriteOffs: BigDecimal, balance: BigDecimal ) @@ -73,6 +75,7 @@ object MonthlyStatementJson { interest = if (json.charges.others == 0) Seq.empty else Seq(ChargeJson("INTEREST", json.charges.others)), allocatedCredits = Charges(json.credits.fps) ++ Charges(json.credits.cis) ++ Charges(json.credits.eps), allocatedPayments = Payments(json.payments), + writeOffs = Charges(json.writeOffs), dueDate = json.balance.dueDate, summary = MonthlySummaryJson(json), _links = MonthlyStatementLinksJson(apiBaseUrl, empRef, taxYear, taxMonth) @@ -102,11 +105,12 @@ object PaymentJson { object MonthlySummaryJson { def apply(json: EpayeMonthlyStatement): MonthlySummaryJson = MonthlySummaryJson( - json.charges.total - json.charges.others, - json.charges.others, - json.credits.total, - json.payments.total, - json.balance.total + amount = json.charges.total - json.charges.others, + interest = json.charges.others, + clearedByCredits = json.credits.total, + clearedByPayments = json.payments.total, + clearedByWriteOffs = json.writeOffs.total, + balance = json.balance.total ) } diff --git a/app/uk/gov/hmrc/epayeapi/models/out/SummaryJson.scala b/app/uk/gov/hmrc/epayeapi/models/out/SummaryJson.scala index 6575fc1..ec9e516 100644 --- a/app/uk/gov/hmrc/epayeapi/models/out/SummaryJson.scala +++ b/app/uk/gov/hmrc/epayeapi/models/out/SummaryJson.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/modules/AppModule.scala b/app/uk/gov/hmrc/epayeapi/modules/AppModule.scala index 1a58078..e8b2a8d 100644 --- a/app/uk/gov/hmrc/epayeapi/modules/AppModule.scala +++ b/app/uk/gov/hmrc/epayeapi/modules/AppModule.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/router/ApiRouter.scala b/app/uk/gov/hmrc/epayeapi/router/ApiRouter.scala index 7ba6918..eb76636 100644 --- a/app/uk/gov/hmrc/epayeapi/router/ApiRouter.scala +++ b/app/uk/gov/hmrc/epayeapi/router/ApiRouter.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/router/RoutesProvider.scala b/app/uk/gov/hmrc/epayeapi/router/RoutesProvider.scala index 3871efd..1e5e51b 100644 --- a/app/uk/gov/hmrc/epayeapi/router/RoutesProvider.scala +++ b/app/uk/gov/hmrc/epayeapi/router/RoutesProvider.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/app/uk/gov/hmrc/epayeapi/syntax/JsonOps.scala b/app/uk/gov/hmrc/epayeapi/syntax/JsonOps.scala index 02e63c4..00db1bf 100644 --- a/app/uk/gov/hmrc/epayeapi/syntax/JsonOps.scala +++ b/app/uk/gov/hmrc/epayeapi/syntax/JsonOps.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/conf/application.conf b/conf/application.conf index 22be4ec..9831c3b 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -1,4 +1,4 @@ -# Copyright 2017 HM Revenue & Customs +# Copyright 2018 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. diff --git a/resources/public/api/conf/1.0/examples/AnnualStatement.get.json b/resources/public/api/conf/1.0/examples/AnnualStatement.get.json index 912d07c..a1c7dda 100644 --- a/resources/public/api/conf/1.0/examples/AnnualStatement.get.json +++ b/resources/public/api/conf/1.0/examples/AnnualStatement.get.json @@ -10,6 +10,7 @@ "amount": 5000, "clearedByCredits": 500, "clearedByPayments": 2000, + "clearedByWriteOffs": 0, "balance": 2500, "dueDate": "2016-07-22" } @@ -19,6 +20,7 @@ "amount": 2000, "clearedByCredits": 300, "clearedByPayments": 200, + "clearedByWriteOffs": 0, "balance": 1500, "dueDate": "2016-05-22" }, @@ -32,6 +34,7 @@ "amount": 1200, "clearedByCredits": 100, "clearedByPayments": 200, + "clearedByWriteOffs": 0, "balance": 900, "dueDate": "2016-08-22", "isSpecified": false, diff --git a/resources/public/api/conf/1.0/examples/MonthlyStatement.get.json b/resources/public/api/conf/1.0/examples/MonthlyStatement.get.json index a83a6e5..858034a 100644 --- a/resources/public/api/conf/1.0/examples/MonthlyStatement.get.json +++ b/resources/public/api/conf/1.0/examples/MonthlyStatement.get.json @@ -39,12 +39,14 @@ "amount": 500 } ], + "writeOffs": [], "dueDate": "2016-05-22", "summary": { "amount": 1000, "interest": 200, "clearedByCredits": 200, "clearedByPayments": 200, + "clearedByWriteOffs": 0, "balance": 800 }, diff --git a/resources/public/api/conf/1.0/schemas/AnnualStatement.get.schema.json b/resources/public/api/conf/1.0/schemas/AnnualStatement.get.schema.json index 88c1de3..3fc9dc2 100644 --- a/resources/public/api/conf/1.0/schemas/AnnualStatement.get.schema.json +++ b/resources/public/api/conf/1.0/schemas/AnnualStatement.get.schema.json @@ -172,6 +172,10 @@ "type": "number", "description": "The amount cleared by payments" }, + "clearedByWriteOffs": { + "type": "number", + "description": "The amount cleared by write-offs" + }, "balance": { "type": "number", "description": "Charge balance" @@ -181,6 +185,7 @@ "amount", "clearedByCredits", "clearedByPayments", + "clearedByWriteOffs", "balance" ] } diff --git a/resources/public/api/conf/1.0/schemas/MonthlyStatement.get.schema.json b/resources/public/api/conf/1.0/schemas/MonthlyStatement.get.schema.json index dfa6621..1fd5410 100644 --- a/resources/public/api/conf/1.0/schemas/MonthlyStatement.get.schema.json +++ b/resources/public/api/conf/1.0/schemas/MonthlyStatement.get.schema.json @@ -41,6 +41,9 @@ ] } }, + "writeOffs": { + "$ref": "#/definitions/monthlyItems" + }, "dueDate": { "$ref": "Definitions.schema.json#/definitions/date" }, @@ -58,6 +61,9 @@ "clearedByPayments": { "type": "number" }, + "clearedByWriteOffs": { + "type": "number" + }, "balance": { "type": "number" } @@ -67,6 +73,7 @@ "interest", "clearedByCredits", "clearedByPayments", + "clearedByWriteOffs", "balance" ] }, @@ -109,6 +116,7 @@ "interest", "allocatedCredits", "allocatedPayments", + "writeOffs", "dueDate", "summary", "_links" diff --git a/test/common/EmpRefGenerator.scala b/test/common/EmpRefGenerator.scala index da47053..5214347 100644 --- a/test/common/EmpRefGenerator.scala +++ b/test/common/EmpRefGenerator.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/common/Fixtures.scala b/test/common/Fixtures.scala index 2ffc397..270dd2b 100644 --- a/test/common/Fixtures.scala +++ b/test/common/Fixtures.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -36,6 +36,7 @@ object Fixtures { | "charges":1200, | "payments": 0, | "credits": 0, + | "writeOffs": 0, | "balance": 1200, | "dueDate": "2017-11-22", | "isSpecified": false, @@ -45,9 +46,10 @@ object Fixtures { | "taxYear": { | "yearFrom": 2017 | }, - | "charges":700, + | "charges":750, | "payments": 300, | "credits": 200, + | "writeOffs": 50, | "balance": 200, | "dueDate": "2017-04-22", | "isSpecified": false, @@ -60,19 +62,21 @@ object Fixtures { | "taxMonth": { | "month": 3 | }, - | "charges":700, + | "charges":750, | "payments": 300, | "credits": 200, + | "writeOffs": 50, | "balance": 200, | "dueDate": "2017-07-22", | "isSpecified": true | } | ], | "totals": { - | "charges":1900, - | "payments": 300, - | "credits": 200, - | "balance": 1400 + | "charges":3200, + | "payments": 600, + | "credits": 400, + | "writeOffs": 100, + | "balance": 2100 | } | }, | "nonRti": { @@ -84,6 +88,7 @@ object Fixtures { | "charges":300, | "payments": 30, | "credits": 70, + | "writeOffs": 0, | "balance": 200, | "dueDate": "2017-07-22", | "isSpecified": false, @@ -95,6 +100,7 @@ object Fixtures { | "charges":0, | "payments": 0, | "credits": 0, + | "writeOffs": 0, | "balance": 0 | } | }, @@ -116,15 +122,17 @@ object Fixtures { | "amount": 300, | "clearedByCredits": 70, | "clearedByPayments": 30, + | "clearedByWriteOffs": 0, | "balance": 200, | "dueDate": "2017-07-22" | } | ], | "_embedded": { | "earlierYearUpdate": { - | "amount": 700, + | "amount": 750, | "clearedByCredits": 200, | "clearedByPayments": 300, + | "clearedByWriteOffs": 50, | "balance": 200, | "dueDate": "2017-04-22" | }, @@ -138,6 +146,7 @@ object Fixtures { | "amount": 1200, | "clearedByCredits": 0, | "clearedByPayments": 0, + | "clearedByWriteOffs": 0, | "balance": 1200, | "dueDate": "2017-11-22", | "isSpecified": false, @@ -153,9 +162,10 @@ object Fixtures { | "firstDay": "2017-06-06", | "lastDay": "2017-07-05" | }, - | "amount": 700, + | "amount": 750, | "clearedByCredits": 200, | "clearedByPayments": 300, + | "clearedByWriteOffs": 50, | "balance": 200, | "dueDate": "2017-07-22", | "isSpecified": true, diff --git a/test/common/RestAssertions.scala b/test/common/RestAssertions.scala index 72feab8..e632dae 100644 --- a/test/common/RestAssertions.scala +++ b/test/common/RestAssertions.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -141,7 +141,7 @@ case class RequestExecutor(request: WSRequest) { class When(wsClient: WSClient) { def get(url: String): RequestExecutor = { RequestExecutor( - wsClient.url(url).withRequestTimeout(Duration(2, SECONDS)) + wsClient.url(url).withRequestTimeout(Duration(3, SECONDS)) ) } } diff --git a/test/common/Schema.scala b/test/common/Schema.scala index 4040306..af7bfdd 100644 --- a/test/common/Schema.scala +++ b/test/common/Schema.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/common/WSClientSetup.scala b/test/common/WSClientSetup.scala index 442a717..e5a096e 100644 --- a/test/common/WSClientSetup.scala +++ b/test/common/WSClientSetup.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/common/WiremockSetup.scala b/test/common/WiremockSetup.scala index b84fd58..c614e3e 100644 --- a/test/common/WiremockSetup.scala +++ b/test/common/WiremockSetup.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/contract/GetAnnualStatementSpec.scala b/test/contract/GetAnnualStatementSpec.scala index db82359..f09f8e1 100644 --- a/test/contract/GetAnnualStatementSpec.scala +++ b/test/contract/GetAnnualStatementSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/contract/GetMonthlyStatementSpec.scala b/test/contract/GetMonthlyStatementSpec.scala index 989cbe0..cf6d878 100644 --- a/test/contract/GetMonthlyStatementSpec.scala +++ b/test/contract/GetMonthlyStatementSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -47,7 +47,7 @@ class GetMonthlyStatementSpec "/organisations/epaye/{ton}/{tor}/statements/{taxYear}/{taxMonth}" should { - "returns a response body that conforms with the Monthly Statement schema" in { + "return a response body that conforms with the Monthly Statement schema" in { val empRef = EmpRefGenerator.getEmpRef val monthlyStatementUrl = s"$baseUrl/${empRef.taxOfficeNumber}/${empRef.taxOfficeReference}/statements/2017-18/3" val inputJsonString = getResourceAsString("/epaye/monthly-statement/in/2017-3.json") diff --git a/test/contract/GetSummarySpec.scala b/test/contract/GetSummarySpec.scala index 1c64df5..0495db3 100644 --- a/test/contract/GetSummarySpec.scala +++ b/test/contract/GetSummarySpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/integration/GetAnnualStatementSpec.scala b/test/integration/GetAnnualStatementSpec.scala index 78a54b5..2bfd2f1 100644 --- a/test/integration/GetAnnualStatementSpec.scala +++ b/test/integration/GetAnnualStatementSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -37,8 +37,8 @@ class GetAnnualStatementSpec extends WordSpec override implicit lazy val app: Application = new GuiceApplicationBuilder().overrides(bind[Router].toProvider[RoutesProvider]).build() - "AnnualStatement API should return a statement " should { - "containing EYU data" in { + "AnnualStatement API" should { + "return a statement containing EYU data" in { val apiBaseUrl = app.configuration.underlying.getString("api.baseUrl") val empRef = EmpRefGenerator.getEmpRef diff --git a/test/integration/PingPingSpec.scala b/test/integration/PingPingSpec.scala index 78b6ecf..d315498 100644 --- a/test/integration/PingPingSpec.scala +++ b/test/integration/PingPingSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/resources/epaye/annual-statement/annual-statement.json b/test/resources/epaye/annual-statement/annual-statement.json index a3746fd..95dd06f 100644 --- a/test/resources/epaye/annual-statement/annual-statement.json +++ b/test/resources/epaye/annual-statement/annual-statement.json @@ -11,6 +11,7 @@ "charges": 100.2, "payments": 0, "credits": 0, + "writeOffs": 0, "balance": 100.2, "dueDate": "2017-05-22", "isSpecified": false @@ -20,6 +21,7 @@ "charges": 100.2, "payments": 0, "credits": 0, + "writeOffs": 0, "balance": 100.2 } }, @@ -32,6 +34,7 @@ "charges": 20.0, "payments": 0, "credits": 0, + "writeOffs": 0, "balance": 20.0, "dueDate": "2018-02-22", "isSpecified": false, @@ -42,6 +45,7 @@ "charges": 20.0, "payments": 0, "credits": 0, + "writeOffs": 0, "balance": 20.0 } } diff --git a/test/resources/epaye/monthly-statement/in/2017-3.json b/test/resources/epaye/monthly-statement/in/2017-3.json index ae7f0e0..b88ee23 100644 --- a/test/resources/epaye/monthly-statement/in/2017-3.json +++ b/test/resources/epaye/monthly-statement/in/2017-3.json @@ -8,7 +8,7 @@ "sub": "1020", "name": "RTI_IN_YEAR_CHARGE_NIC1" }, - "amount": 200 + "amount": 300 }, { "code": { @@ -27,7 +27,7 @@ "amount": 500 } ], - "total": 1000 + "total": 1100 }, "cis": { "items": [], @@ -38,7 +38,7 @@ "total": 0 }, "others": 0, - "total": 1000 + "total": 1100 }, "credits": { "fps": { @@ -81,9 +81,22 @@ ], "total": 500 }, + "writeOffs": { + "items": [ + { + "code": { + "main": "2000", + "sub": "1020", + "name": "RTI_IN_YEAR_CHARGE_NIC1" + }, + "amount": 50 + } + ], + "total": 50 + }, "hasSpecifiedCharges": false, "balance": { - "total": 0, + "total": 50, "dueDate": "2017-07-22" } } \ No newline at end of file diff --git a/test/resources/epaye/monthly-statement/out/2017-3.json b/test/resources/epaye/monthly-statement/out/2017-3.json index 1b7c3a4..78c56b6 100644 --- a/test/resources/epaye/monthly-statement/out/2017-3.json +++ b/test/resources/epaye/monthly-statement/out/2017-3.json @@ -14,7 +14,7 @@ "rtiCharges": [ { "code": "RTI_IN_YEAR_CHARGE_NIC1", - "amount": 200 + "amount": 300 }, { "code": "RTI_IN_YEAR_CHARGE_STUDENT_LOAN_DEDUCTION", @@ -42,13 +42,20 @@ "amount": 500 } ], + "writeOffs": [ + { + "code": "RTI_IN_YEAR_CHARGE_NIC1", + "amount": 50 + } + ], "dueDate": "2017-07-22", "summary": { - "amount": 1000, + "amount": 1100, "interest": 0, "clearedByCredits": 500, "clearedByPayments": 500, - "balance": 0 + "clearedByWriteOffs": 50, + "balance": 50 }, "_links": { "empRefs": { diff --git a/test/uk/gov/hmrc/epayeapi/config/AppContextSpec.scala b/test/uk/gov/hmrc/epayeapi/config/AppContextSpec.scala index a43d52c..6bc53c5 100644 --- a/test/uk/gov/hmrc/epayeapi/config/AppContextSpec.scala +++ b/test/uk/gov/hmrc/epayeapi/config/AppContextSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/uk/gov/hmrc/epayeapi/connectors/ConnectorSpec.scala b/test/uk/gov/hmrc/epayeapi/connectors/ConnectorSpec.scala index 3be3fc6..a9927cd 100644 --- a/test/uk/gov/hmrc/epayeapi/connectors/ConnectorSpec.scala +++ b/test/uk/gov/hmrc/epayeapi/connectors/ConnectorSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/uk/gov/hmrc/epayeapi/connectors/EpayeConnectorSpec.scala b/test/uk/gov/hmrc/epayeapi/connectors/EpayeConnectorSpec.scala index cb3e8a7..44181c9 100644 --- a/test/uk/gov/hmrc/epayeapi/connectors/EpayeConnectorSpec.scala +++ b/test/uk/gov/hmrc/epayeapi/connectors/EpayeConnectorSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -92,12 +92,52 @@ class EpayeConnectorSpec extends UnitSpec with MockitoSugar with ScalaFutures { EpayeSuccess( EpayeAnnualStatement( rti = AnnualStatementTable( - List(LineItem(TaxYear(2017), Some(EpayeTaxMonth(1)), 100.2, 0, 0, 100.2, new LocalDate(2017, 5, 22), isSpecified = false, codeText = None)), - AnnualTotal(100.2, 0, 0, 100.2) + List( + LineItem( + taxYear = TaxYear(2017), + taxMonth = Some(EpayeTaxMonth(1)), + charges = 100.2, + payments = 0, + credits = 0, + writeOffs = 0, + balance = 100.2, + dueDate = new LocalDate(2017, 5, 22), + isSpecified = false, + codeText = None, + itemType = None + ) + ), + AnnualTotal( + charges = 100.2, + payments = 0, + credits = 0, + writeOffs = 0, + balance = 100.2 + ) ), nonRti = AnnualStatementTable( - List(LineItem(TaxYear(2017), None, 20.0, 0, 0, 20.0, new LocalDate(2018, 2, 22), false, Some("P11D_CLASS_1A_CHARGE"))), - AnnualTotal(20.0, 0, 0, 20.0) + List( + LineItem( + taxYear = TaxYear(2017), + taxMonth = None, + charges = 20.0, + payments = 0, + credits = 0, + writeOffs = 0, + balance = 20.0, + dueDate = new LocalDate(2018, 2, 22), + isSpecified = false, + codeText = Some("P11D_CLASS_1A_CHARGE"), + itemType = None + ) + ), + AnnualTotal( + charges = 20.0, + payments = 0, + credits = 0, + writeOffs = 0, + balance = 20.0 + ) ), unallocated = None ) diff --git a/test/uk/gov/hmrc/epayeapi/connectors/ServiceLocatorConnectorSpec.scala b/test/uk/gov/hmrc/epayeapi/connectors/ServiceLocatorConnectorSpec.scala index 55adc5c..f09f71c 100644 --- a/test/uk/gov/hmrc/epayeapi/connectors/ServiceLocatorConnectorSpec.scala +++ b/test/uk/gov/hmrc/epayeapi/connectors/ServiceLocatorConnectorSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/uk/gov/hmrc/epayeapi/controllers/DocumentationSpec.scala b/test/uk/gov/hmrc/epayeapi/controllers/DocumentationSpec.scala index 976cfd3..7220000 100644 --- a/test/uk/gov/hmrc/epayeapi/controllers/DocumentationSpec.scala +++ b/test/uk/gov/hmrc/epayeapi/controllers/DocumentationSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/uk/gov/hmrc/epayeapi/controllers/GetEmpRefsSpec.scala b/test/uk/gov/hmrc/epayeapi/controllers/GetEmpRefsSpec.scala index 0f968d9..db37cbb 100644 --- a/test/uk/gov/hmrc/epayeapi/controllers/GetEmpRefsSpec.scala +++ b/test/uk/gov/hmrc/epayeapi/controllers/GetEmpRefsSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/uk/gov/hmrc/epayeapi/controllers/GetSummarySpec.scala b/test/uk/gov/hmrc/epayeapi/controllers/GetSummarySpec.scala index 9aa3de8..1335310 100644 --- a/test/uk/gov/hmrc/epayeapi/controllers/GetSummarySpec.scala +++ b/test/uk/gov/hmrc/epayeapi/controllers/GetSummarySpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/uk/gov/hmrc/epayeapi/controllers/MonthlyStatementSpec.scala b/test/uk/gov/hmrc/epayeapi/controllers/MonthlyStatementSpec.scala index f4e25b3..768744b 100644 --- a/test/uk/gov/hmrc/epayeapi/controllers/MonthlyStatementSpec.scala +++ b/test/uk/gov/hmrc/epayeapi/controllers/MonthlyStatementSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/uk/gov/hmrc/epayeapi/models/JsonFixtures.scala b/test/uk/gov/hmrc/epayeapi/models/JsonFixtures.scala index 97efbd6..145815e 100644 --- a/test/uk/gov/hmrc/epayeapi/models/JsonFixtures.scala +++ b/test/uk/gov/hmrc/epayeapi/models/JsonFixtures.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -37,6 +37,7 @@ object JsonFixtures { charges = 0, payments = 0, credits = 0, + writeOffs = 0, balance = 0 ) ), @@ -46,6 +47,7 @@ object JsonFixtures { charges = 0, payments = 0, credits = 0, + writeOffs = 0, balance = 0 ) ), diff --git a/test/uk/gov/hmrc/epayeapi/models/TaxMonthSpec.scala b/test/uk/gov/hmrc/epayeapi/models/TaxMonthSpec.scala index be38b64..b583051 100644 --- a/test/uk/gov/hmrc/epayeapi/models/TaxMonthSpec.scala +++ b/test/uk/gov/hmrc/epayeapi/models/TaxMonthSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/uk/gov/hmrc/epayeapi/models/TaxYearSpec.scala b/test/uk/gov/hmrc/epayeapi/models/TaxYearSpec.scala index ffd2434..f4cf3a8 100644 --- a/test/uk/gov/hmrc/epayeapi/models/TaxYearSpec.scala +++ b/test/uk/gov/hmrc/epayeapi/models/TaxYearSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/uk/gov/hmrc/epayeapi/models/out/AnnualStatementJsonSpec.scala b/test/uk/gov/hmrc/epayeapi/models/out/AnnualStatementJsonSpec.scala index 5265371..c90f89d 100644 --- a/test/uk/gov/hmrc/epayeapi/models/out/AnnualStatementJsonSpec.scala +++ b/test/uk/gov/hmrc/epayeapi/models/out/AnnualStatementJsonSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. @@ -49,6 +49,7 @@ class AnnualStatementJsonSpec extends WordSpec with Matchers { charges = 0, payments = 0, credits = 0, + writeOffs = 0, balance = 0 ) @@ -59,13 +60,15 @@ class AnnualStatementJsonSpec extends WordSpec with Matchers { AnnualStatementTable( lineItems = Seq( LineItem( - taxYear, - None, - 100, - 10, - 20, - 100 - 20 - 10, - dueDate, + taxYear = taxYear, + taxMonth = None, + charges = 100, + payments = 10, + credits = 20, + writeOffs = 0, + balance = 100 - 20 - 10, + dueDate = dueDate, + isSpecified = false, codeText = None, itemType = Some("eyu") ) @@ -79,6 +82,7 @@ class AnnualStatementJsonSpec extends WordSpec with Matchers { amount = 100, clearedByCredits = 20, clearedByPayments = 10, + clearedByWriteOffs = 0, balance = 100 - 10 - 20, dueDate = dueDate )) @@ -99,10 +103,12 @@ class AnnualStatementJsonSpec extends WordSpec with Matchers { charges = 100, payments = 10, credits = 20, + writeOffs = 0, balance = 100 - 30, dueDate = dueDate, isSpecified = true, - codeText = None + codeText = None, + itemType = None ) MonthlyChargesJson.from(apiBaseUrl, lineItem, empRef, taxYear) shouldBe @@ -111,6 +117,7 @@ class AnnualStatementJsonSpec extends WordSpec with Matchers { amount = 100, clearedByCredits = 20, clearedByPayments = 10, + clearedByWriteOffs = 0, balance = 100 - 10 - 20, dueDate = dueDate, isSpecified = true, @@ -126,9 +133,12 @@ class AnnualStatementJsonSpec extends WordSpec with Matchers { charges = 100, payments = 10, credits = 20, + writeOffs = 0, balance = 100 - 30, dueDate = dueDate, - codeText = None + isSpecified = false, + codeText = None, + itemType = None ) MonthlyChargesJson.from(apiBaseUrl, lineItem, empRef, taxYear) shouldBe None @@ -146,9 +156,12 @@ class AnnualStatementJsonSpec extends WordSpec with Matchers { charges = 100, payments = 10, credits = 20, + writeOffs = 0, balance = 100 - 30, dueDate = dueDate, - codeText = Some(code) + isSpecified = false, + codeText = Some(code), + itemType = None ) NonRtiChargesJson.from(lineItem, taxYear) shouldBe @@ -157,6 +170,7 @@ class AnnualStatementJsonSpec extends WordSpec with Matchers { amount = 100, clearedByCredits = 20, clearedByPayments = 10, + clearedByWriteOffs = 0, balance = 100 - 10 - 20, dueDate = dueDate )) diff --git a/test/uk/gov/hmrc/epayeapi/models/out/LinkSpecs.scala b/test/uk/gov/hmrc/epayeapi/models/out/LinkSpecs.scala index 92b2454..145b2b5 100644 --- a/test/uk/gov/hmrc/epayeapi/models/out/LinkSpecs.scala +++ b/test/uk/gov/hmrc/epayeapi/models/out/LinkSpecs.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/unit/AppSpec.scala b/test/unit/AppSpec.scala index 9f337a9..f98c788 100644 --- a/test/unit/AppSpec.scala +++ b/test/unit/AppSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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. diff --git a/test/unit/auth/AuthComponents.scala b/test/unit/auth/AuthComponents.scala index 2b81005..3f24270 100644 --- a/test/unit/auth/AuthComponents.scala +++ b/test/unit/auth/AuthComponents.scala @@ -1,5 +1,5 @@ /* - * Copyright 2017 HM Revenue & Customs + * Copyright 2018 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.