@@ -6,15 +6,15 @@ import { Record, RecordRepository } from '../../domain/Repository';
66import { Logger } from '../../logger' ;
77import { DeleteStreamRecord } from '../../domain/DeleteStreamRecord' ;
88import { CreateEventStreamRecord , isCreateEventStreamRecord } from '../../domain/CreateEventStreamRecord' ;
9- import { StreamMetadataResponse } from '../../generated/pnapi/StreamMetadataResponse ' ;
9+ import { StreamMetadataResponseV28 } from '../../generated/pnapi/StreamMetadataResponseV28 ' ;
1010import { GetNotificationDetailRecord } from '../../domain/GetNotificationDetailRecord' ;
11- import { FullSentNotificationV21 } from '../../generated/pnapi/FullSentNotificationV21 ' ;
12- import { NotificationStatusEnum } from '../../generated/pnapi/NotificationStatus ' ;
11+ import { FullSentNotificationV27 } from '../../generated/pnapi/FullSentNotificationV27 ' ;
12+ import { NotificationStatusV26Enum } from '../../generated/pnapi/NotificationStatusV26 ' ;
1313
1414const filterByStreamId = ( streamId : string , record : Record ) : boolean =>
1515 O . fold (
1616 ( ) => true ,
17- ( csr : CreateEventStreamRecord ) => ( csr . output . returned as StreamMetadataResponse ) . streamId !== streamId
17+ ( csr : CreateEventStreamRecord ) => ( csr . output . returned as StreamMetadataResponseV28 ) . streamId !== streamId
1818 ) ( isCreateEventStreamRecord ( record ) ) ;
1919
2020// TODO: Instead of mutable variable, try to use the State Monad (or STM)
@@ -51,7 +51,7 @@ export const makeRecordRepository =
5151 ) : TE . TaskEither < Error , ReadonlyArray < Record > > => {
5252 // Filter out CreateEventStreamRecord with matching streamId
5353 const filteredStore = store . filter ( ( record ) =>
54- filterByStreamId ( ( createEvenStreamRecord . output . returned as StreamMetadataResponse ) . streamId , record )
54+ filterByStreamId ( ( createEvenStreamRecord . output . returned as StreamMetadataResponseV28 ) . streamId , record )
5555 ) ;
5656 store = [ ...filteredStore , createEvenStreamRecord ] ;
5757 return TE . of ( store ) ;
@@ -61,7 +61,7 @@ export const makeRecordRepository =
6161 ) : TE . TaskEither < Error , CreateEventStreamRecord > => {
6262 // Filter out CreateEventStreamRecord with matching streamId
6363 const filteredStore = store . filter ( ( record ) =>
64- filterByStreamId ( ( createEvenStreamRecord . output . returned as StreamMetadataResponse ) . streamId , record )
64+ filterByStreamId ( ( createEvenStreamRecord . output . returned as StreamMetadataResponseV28 ) . streamId , record )
6565 ) ;
6666 if ( filteredStore . length === store . length ) {
6767 const error = new Error ( 'No records were updated.' ) ;
@@ -75,7 +75,7 @@ export const makeRecordRepository =
7575 store = [ ...store , element ] ;
7676 const getNotificationDetailRecord : GetNotificationDetailRecord = ( store . filter ( singleRecord => singleRecord . type === 'GetNotificationDetailRecord' ) [ 0 ] as GetNotificationDetailRecord ) ;
7777 if ( getNotificationDetailRecord !== undefined ) {
78- ( getNotificationDetailRecord . output . returned as FullSentNotificationV21 ) . notificationStatus = NotificationStatusEnum . CANCELLED ;
78+ ( getNotificationDetailRecord . output . returned as FullSentNotificationV27 ) . notificationStatus = NotificationStatusV26Enum . CANCELLED ;
7979 }
8080 return TE . of ( element ) ;
8181 }
0 commit comments