Skip to content

Commit

Permalink
Update SubmitUktr to use header for pillar2Id
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMMiller committed Dec 9, 2024
1 parent 0b9f69a commit d5d9fba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 356 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class LiabilityController @Inject() (
) extends BackendController(cc)
with Logging {

def submitUktr(plrReference: String): Action[String] = (Action(parse.tolerantText) andThen authFilter).async { implicit request =>
def submitUktr: Action[String] = (Action(parse.tolerantText) andThen authFilter).async { implicit request =>
val plrReference = request.headers.get("X-Pillar2-Id").get //TODO: Update this to just return an error if the header is not present
if (plrReference != "XTC01234123412") {
logger.warn(s"Invalid PLR Reference provided: $plrReference")
Future.successful(NotFound(Json.obj("error" -> "No liabilities found for the given reference")))
Expand Down
4 changes: 2 additions & 2 deletions conf/app.routes
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ GET /enterprise/financial-data/:idType/:idNumber/:regimeType

GET /get-obligation/:plrReference/:dateFrom/:dateTo uk.gov.hmrc.pillar2stubs.controllers.ObligationController.getObligation(plrReference: String, dateFrom: String, dateTo: String)

POST /pillar2/liability/:plrReference uk.gov.hmrc.pillar2stubs.controllers.LiabilityController.submitUktr(plrReference: String)
POST /RESTAdapter/plr/below-threshold-notification uk.gov.hmrc.pillar2stubs.controllers.BTNController.submitBTN(pillar2ID:String)

POST /RESTAdapter/plr/below-threshold-notification uk.gov.hmrc.pillar2stubs.controllers.BTNController.submitBTN(pillar2ID:String)
POST /submit-uk-tax-return uk.gov.hmrc.pillar2stubs.controllers.LiabilityController.submitUktr

This file was deleted.

0 comments on commit d5d9fba

Please sign in to comment.