@@ -93,19 +93,22 @@ export const decideOrchestrationCommand = Effect.fn("decideOrchestrationCommand"
9393 }
9494
9595 const archiveEvents : Omit < OrchestrationEvent , "sequence" > [ ] = projectsToArchive . map (
96- ( project ) => ( {
97- ...withEventBase ( {
98- aggregateKind : "project" as const ,
99- aggregateId : project . id ,
100- occurredAt : command . createdAt ,
101- commandId : command . commandId ,
102- } ) ,
103- type : "project.deleted" as const ,
104- payload : {
105- projectId : project . id ,
106- deletedAt : command . createdAt ,
107- } ,
108- } ) ,
96+ ( project ) =>
97+ Object . assign (
98+ withEventBase ( {
99+ aggregateKind : "project" as const ,
100+ aggregateId : project . id ,
101+ occurredAt : command . createdAt ,
102+ commandId : command . commandId ,
103+ } ) ,
104+ {
105+ type : "project.deleted" as const ,
106+ payload : {
107+ projectId : project . id ,
108+ deletedAt : command . createdAt ,
109+ } ,
110+ } ,
111+ ) ,
109112 ) ;
110113 return [ ...archiveEvents , projectCreatedEvent ] ;
111114 }
@@ -198,20 +201,22 @@ export const decideOrchestrationCommand = Effect.fn("decideOrchestrationCommand"
198201 return threadCreatedEvent ;
199202 }
200203
201- const archiveEvents : Omit < OrchestrationEvent , "sequence" > [ ] = threadsToArchive . map (
202- ( thread ) => ( {
203- ... withEventBase ( {
204+ const archiveEvents : Omit < OrchestrationEvent , "sequence" > [ ] = threadsToArchive . map ( ( thread ) =>
205+ Object . assign (
206+ withEventBase ( {
204207 aggregateKind : "thread" as const ,
205208 aggregateId : thread . id ,
206209 occurredAt : command . createdAt ,
207210 commandId : command . commandId ,
208211 } ) ,
209- type : "thread.deleted" as const ,
210- payload : {
211- threadId : thread . id ,
212- deletedAt : command . createdAt ,
212+ {
213+ type : "thread.deleted" as const ,
214+ payload : {
215+ threadId : thread . id ,
216+ deletedAt : command . createdAt ,
217+ } ,
213218 } ,
214- } ) ,
219+ ) ,
215220 ) ;
216221 return [ ...archiveEvents , threadCreatedEvent ] ;
217222 }
0 commit comments