-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/ccm-13151 post endpoint #325
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
base: feature/CCM-12180-TestsOnPipeline
Are you sure you want to change the base?
Feature/ccm-13151 post endpoint #325
Conversation
There was a problem hiding this 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 = { |
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| export type PostMessageResponseBody = { | |
| export type PostLettersMessageResponseBody = { |
| }; | ||
| }; | ||
|
|
||
| export function postRequestHeaders(): RequestHeaders { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| export function postRequestHeaders(): RequestHeaders { | |
| export function postLettersRequestHeaders(): RequestHeaders { |
| return requestHeaders; | ||
| } | ||
|
|
||
| export function postInvalidRequestHeaders(): RequestHeaders { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| export function postInvalidRequestHeaders(): RequestHeaders { | |
| export function postLettersInvalidRequestHeaders(): RequestHeaders { |
| data: PostRequest[]; | ||
| }; | ||
|
|
||
| type PostRequest = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| type PostRequest = { | |
| type PostLettersRequest = { |
Description
Context
Type of changes
Checklist
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.