@@ -13,7 +13,7 @@ import { Deps } from "../deps";
1313import { EnvVars } from "../env" ;
1414import mapLetterToCloudEvent from "../mappers/letter-mapper" ;
1515import { LetterStatus } from "../../../api-handler/src/contracts/letters" ;
16- import { LetterWithSupplierId } from "../types" ;
16+ import { LetterForEventPub } from "../types" ;
1717
1818// Make crypto return consistent values, since we"re calling it in both prod and test code and comparing the values
1919const realCrypto = jest . requireActual ( "crypto" ) ;
@@ -148,7 +148,7 @@ describe("letter-updates-transformer Lambda", () => {
148148 it ( "does not publish invalid letter data" , async ( ) => {
149149 const handler = createHandler ( mockedDeps ) ;
150150 const oldLetter = generateLetter ( "ACCEPTED" ) ;
151- const newLetter = { id : oldLetter . id } as LetterWithSupplierId ;
151+ const newLetter = { id : oldLetter . id } as LetterForEventPub ;
152152
153153 const testData = generateKinesisEvent ( [
154154 generateModifyRecord ( oldLetter , newLetter ) ,
@@ -252,33 +252,31 @@ describe("letter-updates-transformer Lambda", () => {
252252 } ) ;
253253} ) ;
254254
255- function generateLetter (
256- status : LetterStatus ,
257- id ?: string ,
258- ) : LetterWithSupplierId {
255+ function generateLetter ( status : LetterStatus , id ?: string ) : LetterForEventPub {
259256 return {
260257 id : id || "1" ,
261258 status,
262259 specificationId : "spec1" ,
263260 supplierId : "supplier1" ,
264261 groupId : "group1" ,
262+ updatedAt : "2025-12-10T11:13:54Z" ,
265263 } ;
266264}
267265
268266function generateLetters (
269267 numLetters : number ,
270268 status : LetterStatus ,
271- ) : LetterWithSupplierId [ ] {
272- const letters : LetterWithSupplierId [ ] = Array . from ( { length : numLetters } ) ;
269+ ) : LetterForEventPub [ ] {
270+ const letters : LetterForEventPub [ ] = Array . from ( { length : numLetters } ) ;
273271 for ( let i = 0 ; i < numLetters ; i ++ ) {
274272 letters [ i ] = generateLetter ( status , String ( i + 1 ) ) ;
275273 }
276274 return letters ;
277275}
278276
279277function generateModifyRecord (
280- oldLetter : LetterWithSupplierId ,
281- newLetter : LetterWithSupplierId ,
278+ oldLetter : LetterForEventPub ,
279+ newLetter : LetterForEventPub ,
282280) : DynamoDBRecord {
283281 const oldImage = Object . fromEntries (
284282 Object . entries ( oldLetter ) . map ( ( [ key , value ] ) => [ key , { S : value } ] ) ,
0 commit comments