@@ -97,6 +97,7 @@ function createSupplierStatusChangeEventWithoutSupplier(
9797 billingRef : "1y3q9v1zzzz" ,
9898 status : "RETURNED" ,
9999 supplierId : "" ,
100+ specificationBillingId : "billing1" ,
100101 } ,
101102 datacontenttype : "application/json" ,
102103 dataschema :
@@ -151,6 +152,7 @@ function createSupplierStatusChangeEvent(
151152 billingRef : "1y3q9v1zzzz" ,
152153 status : "RETURNED" ,
153154 supplierId : "supplier1" ,
155+ specificationBillingId : "billing1" ,
154156 } ,
155157 datacontenttype : "application/json" ,
156158 dataschema :
@@ -211,11 +213,17 @@ describe("createUpsertLetterHandler", () => {
211213 test ( "processes all records successfully and returns no batch failures" , async ( ) => {
212214 const v2message = {
213215 letterEvent : createPreparedV2Event ( ) ,
214- supplierSpec : { supplierId : "supplier1" , specId : "spec1" } ,
216+ supplierSpec : {
217+ supplierId : "supplier1" ,
218+ specId : "spec1" ,
219+ } ,
215220 } ;
216221 const v1message = {
217222 letterEvent : createPreparedV1Event ( ) ,
218- supplierSpec : { supplierId : "supplier1" , specId : "spec1" } ,
223+ supplierSpec : {
224+ supplierId : "supplier1" ,
225+ specId : "spec1" ,
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 ( "spec1" ) ;
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 ( "spec1" ) ;
263273
264274 const updatedLetter = (
265275 mockedDeps . letterRepo . updateLetterStatus as jest . Mock
@@ -472,14 +482,20 @@ 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+ } ,
476489 } ;
477490 const message2 = {
478491 letterEvent : createPreparedV2Event ( {
479492 id : "7b9a03ca-342a-4150-b56b-989109c45616" ,
480493 domainId : "fail" ,
481494 } ) ,
482- supplierSpec : { supplierId : "supplier1" , specId : "spec1" } ,
495+ supplierSpec : {
496+ supplierId : "supplier1" ,
497+ specId : "spec1" ,
498+ } ,
483499 } ;
484500 const evt : SQSEvent = createSQSEvent ( [
485501 createSqsRecord ( "ok-msg" , JSON . stringify ( message1 ) ) ,
0 commit comments