Skip to content

Conversation

@varsha-vanbatte-nhs
Copy link

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@varsha-vanbatte-nhs varsha-vanbatte-nhs requested a review from a team as a code owner December 30, 2025 13:08
Copy link
Contributor

@francisco-videira-nhs francisco-videira-nhs left a comment

Choose a reason for hiding this comment

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

Looks OK to me, left some minor comments.

Another thing I noticed is that names like postRequestHeaders, PostMessageRequestBody, etc, would ideally be postLettersRequestHeaders, PostLettersMessageRequestBody, as if we have more Post endpoints in the future, these names could become ambiguous. Will leave some example in comments.

} from "../../../helpers/common-types";
import { SupplierApiLetters } from "../../../helpers/generate-fetch-test-data";

export type PostMessageResponseBody = {
Copy link
Contributor

Choose a reason for hiding this comment

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

The response body of the POST /letters is empty - it only returns a 202 (accepted).See https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier#post-/letters

): PostMessageRequestBody {
let requestBody: PostMessageRequestBody;

requestBody = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth including the reasonText and reasonCode in at least one of these?

} from "../../../helpers/common-types";
import { SupplierApiLetters } from "../../../helpers/generate-fetch-test-data";

export type PostMessageResponseBody = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export type PostMessageResponseBody = {
export type PostLettersMessageResponseBody = {

};
};

export function postRequestHeaders(): RequestHeaders {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export function postRequestHeaders(): RequestHeaders {
export function postLettersRequestHeaders(): RequestHeaders {

return requestHeaders;
}

export function postInvalidRequestHeaders(): RequestHeaders {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export function postInvalidRequestHeaders(): RequestHeaders {
export function postLettersInvalidRequestHeaders(): RequestHeaders {

data: PostRequest[];
};

type PostRequest = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
type PostRequest = {
type PostLettersRequest = {

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