@@ -64,6 +64,34 @@ const generateLetterTemplateData = (
6464 } ;
6565} ;
6666
67+ const generateRoutingConfig = ( {
68+ clientId,
69+ now,
70+ } : {
71+ clientId : string ;
72+ now : string ;
73+ } ) => ( {
74+ owner : `CLIENT#${ clientId } ` ,
75+ id : randomUUID ( ) ,
76+ campaignId : 'campaignId' ,
77+ cascade : [
78+ {
79+ cascadeGroups : [ 'standard' ] ,
80+ channel : 'EMAIL' ,
81+ channelType : 'primary' ,
82+ defaultTemplateId : 'email_id' ,
83+ } ,
84+ ] ,
85+ cascadeGroupOverrides : [ { name : 'standard' } ] ,
86+ clientId,
87+ createdAt : now ,
88+ createdBy : 'Accessibility tests' ,
89+ name : 'Accessibility Test' ,
90+ status : 'DRAFT' ,
91+ updatedAt : now ,
92+ updatedBy : 'Accessibility tests' ,
93+ } ) ;
94+
6795const setup = async ( ) => {
6896 const backendConfig = BackendConfigHelper . fromTerraformOutputsFile (
6997 path . join ( __dirname , '..' , '..' , 'sandbox_tf_outputs.json' )
@@ -148,25 +176,40 @@ const setup = async () => {
148176 ) ,
149177 ] ;
150178
151- await Promise . all (
152- templates . map ( ( template ) =>
179+ const routingConfigs = [
180+ generateRoutingConfig ( { clientId, now : new Date ( ) . toISOString ( ) } ) ,
181+ ] ;
182+
183+ await Promise . all ( [
184+ ...templates . map ( ( template ) => {
153185 ddbDocClient . send (
154186 new PutCommand ( {
155187 TableName : backendConfig . templatesTableName ,
156188 Item : template ,
157189 } )
190+ ) ;
191+ } ) ,
192+ ...routingConfigs . map ( ( rc ) =>
193+ ddbDocClient . send (
194+ new PutCommand ( {
195+ TableName : backendConfig . routingConfigTableName ,
196+ Item : rc ,
197+ } )
158198 )
159- )
160- ) ;
199+ ) ,
200+ ] ) ;
161201
162202 const templateIds = Object . fromEntries (
163203 templates . map ( ( t ) => [ t . templateStatus , t . id ] )
164204 ) ;
165205
206+ const routingConfigIds = routingConfigs . map ( ( r ) => r . id ) ;
207+
166208 const fixtureData = {
167209 email : testEmail ,
168210 password : testPassword ,
169211 templateIds,
212+ routingConfigIds,
170213 userId,
171214 clientId,
172215 clientName,
0 commit comments