@@ -211,11 +211,19 @@ describe("createUpsertLetterHandler", () => {
211211 test ( "processes all records successfully and returns no batch failures" , async ( ) => {
212212 const v2message = {
213213 letterEvent : createPreparedV2Event ( ) ,
214- supplierSpec : { supplierId : "supplier1" , specId : "spec1" } ,
214+ supplierSpec : {
215+ supplierId : "supplier1" ,
216+ specId : "spec1" ,
217+ billingId : "billing1" ,
218+ } ,
215219 } ;
216220 const v1message = {
217221 letterEvent : createPreparedV1Event ( ) ,
218- supplierSpec : { supplierId : "supplier1" , specId : "spec1" } ,
222+ supplierSpec : {
223+ supplierId : "supplier1" ,
224+ specId : "spec1" ,
225+ billingId : "billing1" ,
226+ } ,
219227 } ;
220228
221229 const evt : SQSEvent = createSQSEvent ( [
@@ -249,6 +257,7 @@ describe("createUpsertLetterHandler", () => {
249257 expect ( insertedV2Letter . status ) . toBe ( "PENDING" ) ;
250258 expect ( insertedV2Letter . groupId ) . toBe ( "client1campaign1template1" ) ;
251259 expect ( insertedV2Letter . source ) . toBe ( "/data-plane/letter-rendering/test" ) ;
260+ expect ( insertedV2Letter . specificationBillingId ) . toBe ( "billing1" ) ;
252261
253262 const insertedV1Letter = ( mockedDeps . letterRepo . putLetter as jest . Mock ) . mock
254263 . calls [ 1 ] [ 0 ] ;
@@ -260,6 +269,7 @@ describe("createUpsertLetterHandler", () => {
260269 expect ( insertedV1Letter . status ) . toBe ( "PENDING" ) ;
261270 expect ( insertedV1Letter . groupId ) . toBe ( "client1campaign1template1" ) ;
262271 expect ( insertedV1Letter . source ) . toBe ( "/data-plane/letter-rendering/test" ) ;
272+ expect ( insertedV1Letter . specificationBillingId ) . toBe ( "billing1" ) ;
263273
264274 const updatedLetter = (
265275 mockedDeps . letterRepo . updateLetterStatus as jest . Mock
@@ -472,14 +482,22 @@ describe("createUpsertLetterHandler", () => {
472482 id : "7b9a03ca-342a-4150-b56b-989109c45615" ,
473483 domainId : "ok" ,
474484 } ) ,
475- supplierSpec : { supplierId : "supplier1" , specId : "spec1" } ,
485+ supplierSpec : {
486+ supplierId : "supplier1" ,
487+ specId : "spec1" ,
488+ billingId : "billing1" ,
489+ } ,
476490 } ;
477491 const message2 = {
478492 letterEvent : createPreparedV2Event ( {
479493 id : "7b9a03ca-342a-4150-b56b-989109c45616" ,
480494 domainId : "fail" ,
481495 } ) ,
482- supplierSpec : { supplierId : "supplier1" , specId : "spec1" } ,
496+ supplierSpec : {
497+ supplierId : "supplier1" ,
498+ specId : "spec1" ,
499+ billingId : "billing1" ,
500+ } ,
483501 } ;
484502 const evt : SQSEvent = createSQSEvent ( [
485503 createSqsRecord ( "ok-msg" , JSON . stringify ( message1 ) ) ,
0 commit comments