Skip to content

Saod 657/get obligation#8

Draft
jacob-leeming-netcompany wants to merge 12 commits intomainfrom
SAOD-657/get-obligation
Draft

Saod 657/get obligation#8
jacob-leeming-netcompany wants to merge 12 commits intomainfrom
SAOD-657/get-obligation

Conversation

@jacob-leeming-netcompany
Copy link
Contributor

No description provided.

@jacob-leeming-netcompany jacob-leeming-netcompany marked this pull request as draft March 12, 2026 16:13
@platops-pr-bot
Copy link

val stubsUrl: String = config.get[String]("stubs.host")

// TODO: name subject to change
val stubsAuth: String = config.get[String]("stubs.auth")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stubsAuthorizationToken

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or merge my branch into yours & you'll get these bits for free

val appName: String = config.get[String]("appName")

// TODO: name subject to change, probably
val stubsUrl: String = config.get[String]("stubs.host")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stubsBaseUrl

Comment on lines +72 to +74
stubs {
host = "http://localhost:10061"
auth = "Q2xpZW50SWQ6Q2xpZW50U2VjcmV0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update these values to something like:

senior-accounting-officer-stubs {
      host = localhost
      port = 10061
      authorizationToken = "Basic Q2xpZW50SWQ6Q2xpZW50U2VjcmV0"
    }

// TODO: how to deal with failed future gracefully?
// TODO: what error response should be returned?

def getObligation(saoSubscriptionId: String): Action[AnyContent] = Action.async { implicit request =>
Copy link
Contributor

@Nikhilvedi Nikhilvedi Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use parse.tolerantText over AnyContent
you also need the headerCarrier:

    given HeaderCarrier = HeaderCarrierConverter.fromRequest(request)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, the way it works now malformed json wont get sent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do i need the header carrier for?

import javax.inject.Inject

// TODO: change name
class StubConnector @Inject() (appConfig: AppConfig, httpClient: HttpClientV2)(using ExecutionContext) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connectors will be seperate in my mind, so this can be ObligationConnector

@Nikhilvedi
Copy link
Contributor

Nikhilvedi commented Mar 12, 2026

you're missing the "glue" in the app/uk/gov/hmrc/senioraccountingofficer/config/Module.scala file like so for your connector:

bind(classOf[SubscriptionsConnector]).to(classOf[DefaultSubscriptionsConnector])

if you move to using a trait in your connector, see my PR, it makes the testing a little easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants