Skip to content

CCM-7942: Proof requested event#876

Open
bhansell1 wants to merge 17 commits intomainfrom
feature/CCM-7942-proofing-publish
Open

CCM-7942: Proof requested event#876
bhansell1 wants to merge 17 commits intomainfrom
feature/CCM-7942-proofing-publish

Conversation

@bhansell1
Copy link
Contributor

@bhansell1 bhansell1 commented Mar 12, 2026

Description

  • adds and publishes ProofRequestedV1 events
  • adds ProofRequests DynamoDB table, stream and pipe from CCM-7941

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
  • If I have used the 'skip-trivy-package' label I have done so responsibly and in the knowledge that this is being fixed as part of a separate ticket/PR.

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.

@bhansell1 bhansell1 marked this pull request as ready for review March 16, 2026 11:10
@bhansell1 bhansell1 requested review from a team as code owners March 16, 2026 11:10
alexnuttall
alexnuttall previously approved these changes Mar 16, 2026
},
"additionalProperties": {
"type": "string"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

taking these out aren't we?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After digging a bit more to understand this because I've not explicitly added these fields.

They are generated because we are defining personalisation as a generic record as z.record(z.string(), z.string(). The same can be seen for /schemas/TemplateDrafted/v1.json.supplierReferences.

While confusing the JSON schema is correct. I'll mention this on the refcom.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh so you mean they get added as part of the auto generating?

}
},
"description": "Contact details to send the proof to"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be gone?

},
"additionalProperties": {
"type": "string"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

get rid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see

},
"email": {
"type": "string"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

remove?

},
"additionalProperties": {
"type": "string"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

get rid

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see

"properties": {
"sms": {
"type": "string"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

can this go?

templateType: z.literal('SMS').meta({
description: 'Template type for the template being proofed',
}),
contactDetails: $ProofContactDetails.extend({
Copy link
Contributor

Choose a reason for hiding this comment

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

but doesnt this keep email as optional?

templateType: z.literal('NHS_APP').meta({
description: 'Template type for the template being proofed',
}),
contactDetails: $ProofContactDetails.optional(),
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 want this here?

}),
});

const $ProofContactDetails = z
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if this is valuable like this is it? there's no scenario where we'd ever expect both, so should this be one or the other? or do we even need it?

templateType: z.literal('EMAIL').meta({
description: 'Template type for the template being proofed',
}),
contactDetails: $ProofContactDetails.extend({
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

await proofRequestsStorageHelper.seed([
{
id: proofRequestId,
owner: `CLIENT#${user.clientId}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

should this still be here?


export type DigitalProofRequest = {
id: string;
owner: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a type for the DB record. Client ownership on this seems useful?

It doesn't seem unseful on the event because notify core int environment only has 1 client.

/**
* Breaks a list into chunks of upto 25 items
*/
private static chunk<T>(list: T[], size = 25): T[][] {
Copy link
Contributor

Choose a reason for hiding this comment

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

in case you haven't seen, Michael's PR has split this out into its own file, maybe could align the approach across both PRs so we don't end up with duplicates?

}
);

it('fails when SMS proof request does not include contactDetails.sms', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

what about the inverse?
fails when SMS proof contains email? email proof contains sms?
apap contains either? dont we expect those to fail too?

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.

4 participants