@@ -4,8 +4,8 @@ import path from 'node:path';
44import { DynamoDBClient } from '@aws-sdk/client-dynamodb' ;
55import { PutCommand , DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb' ;
66import { generate } from 'generate-password' ;
7- import { TemplateStatus , VirusScanStatus } from 'nhs-notify-backend-client' ;
8- import { LetterTemplate } from 'nhs-notify-web-template-management-utils' ;
7+ import { TemplateStatus , TemplateType , VirusScanStatus } from 'nhs-notify-backend-client' ;
8+ import { LetterTemplate , NHSAppTemplate , EmailTemplate , SMSTemplate } from 'nhs-notify-web-template-management-utils' ;
99import { BackendConfigHelper } from 'nhs-notify-web-template-management-util-backend-config' ;
1010import { TestUserClient } from './test-user-client' ;
1111
@@ -40,7 +40,7 @@ const generateLetterTemplateData = (
4040 currentVersion : randomUUID ( ) ,
4141 virusScanStatus,
4242 } ,
43- ...( templateStatus === 'PROOF_AVAILABLE' && {
43+ ...( [ 'PROOF_AVAILABLE' , 'SUBMITTED' ] . includes ( templateStatus ) && {
4444 proofs : {
4545 proof1 : {
4646 fileName : 'proof1.pdf' ,
@@ -64,6 +64,30 @@ const generateLetterTemplateData = (
6464 } ;
6565} ;
6666
67+ const generateDigitalTemplateData = (
68+ name : string ,
69+ clientId : string ,
70+ templateType : TemplateType ,
71+ templateStatus : TemplateStatus
72+ ) => {
73+ const now = new Date ( ) . toISOString ( ) ;
74+
75+ return {
76+ name,
77+ message : 'template-message' ,
78+ owner : `CLIENT#${ clientId } ` ,
79+ clientId,
80+ id : randomUUID ( ) ,
81+ templateType,
82+ createdAt : now ,
83+ updatedAt : now ,
84+ templateStatus,
85+ ...( templateType === 'EMAIL' && {
86+ subject : 'template-subject' ,
87+ } )
88+ } ;
89+ } ;
90+
6791const setup = async ( ) => {
6892 const backendConfig = BackendConfigHelper . fromTerraformOutputsFile (
6993 path . join ( __dirname , '..' , '..' , 'sandbox_tf_outputs.json' )
@@ -146,6 +170,30 @@ const setup = async () => {
146170 'PASSED' ,
147171 'PROOF_AVAILABLE'
148172 ) ,
173+ generateLetterTemplateData (
174+ 'pa11y-letter-proof-submitted' ,
175+ clientId ,
176+ 'PASSED' ,
177+ 'SUBMITTED'
178+ ) ,
179+ generateDigitalTemplateData (
180+ 'pa11y-email-proof-submitted' ,
181+ clientId ,
182+ 'EMAIL' ,
183+ 'SUBMITTED'
184+ ) ,
185+ generateDigitalTemplateData (
186+ 'pa11y-sms-proof-submitted' ,
187+ clientId ,
188+ 'SMS' ,
189+ 'SUBMITTED'
190+ ) ,
191+ generateDigitalTemplateData (
192+ 'pa11y-nhsapp-proof-submitted' ,
193+ clientId ,
194+ 'NHS_APP' ,
195+ 'SUBMITTED'
196+ ) ,
149197 ] ;
150198
151199 await Promise . all (
0 commit comments