Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESWE-1080] publish expression of interest api #581

Closed
wants to merge 10 commits into from

Conversation

gbmojo
Copy link
Contributor

@gbmojo gbmojo commented Jan 17, 2025

No description provided.

@gbmojo gbmojo changed the title Eswe 1080 publish expression of interest api ESWE 1080 publish expression of interest api Jan 17, 2025
@rickchoijd rickchoijd self-requested a review January 21, 2025 09:20
@rickchoijd rickchoijd changed the title ESWE 1080 publish expression of interest api [ESWE-1080] publish expression of interest api Jan 21, 2025
Comment on lines +48 to +51
if (hmppsIdCheck.hasError(UpstreamApiError.Type.ENTITY_NOT_FOUND)) {
logger.info("Could not find nomis number for hmppsId: $hmppsId")
return ResponseEntity.badRequest().build()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we return 404 instead of 400?

Comment on lines +53 to +55
if (hmppsIdCheck.hasError(UpstreamApiError.Type.BAD_REQUEST)) {
logger.info("Invalid hmppsId: $hmppsId")
return ResponseEntity.badRequest().build()
Copy link
Contributor

Choose a reason for hiding this comment

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

similar question... is this 404 or 400?
if the hmpps ID isn't found

val jobId = "5678"

describe("PUT $basePath/{hmppsId}/expression-of-interest/jobs/{jobId}") {
it("should return 400 Bad Request if ENTITY_NOT_FOUND error occurs") {
Copy link
Contributor

Choose a reason for hiding this comment

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

404 vs 400

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a case for invalid Job ID?
Is this testable here? probably not (unless we validate it with JobsBoard API)

.andExpect(content().json(getExpectedResponse("person-adjudications"), true))
.andExpect(content().json(getExpectedResponse("person-adjudications")))
Copy link
Contributor

Choose a reason for hiding this comment

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

May I recall what this was fixing?
This is not our test.

describe("sendExpressionOfInterest") {
it("should send a valid message successfully to SQS") {
val expressionInterest = ExpressionInterest(jobId = "12345", hmppsId = "H1234")
val messageBody = """{"jobId":"12345","verifiedHmppsId":"H1234"}"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's review the message body format and define it at the JIRA ticket first.
I do not prefer verifiedHmppsId as the field name.

Copy link
Contributor

Choose a reason for hiding this comment

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

This file is too big to read line by line. I did not locate our actual changes.
It seems formatting the whole file without a need (No actual non-formatting change).

Could you rollback this whole file?

@rickchoijd
Copy link
Contributor

Let's dismiss this PR and start with the new branch (more clean there)

@rickchoijd rickchoijd closed this Jan 23, 2025
@gbmojo gbmojo deleted the ESWE-1080-publish-expression-of-interest-api branch January 23, 2025 16:21
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.

2 participants