mirror of
https://github.com/standardnotes/server
synced 2026-07-14 00:01:54 -04:00
* feat: add a way to trigger transition procedure for revisions * fix: localstack linking * fix: revisions endpoints
28 lines
878 B
TypeScript
28 lines
878 B
TypeScript
/* istanbul ignore file */
|
|
import { DomainEventService, TransitionStatusUpdatedEvent } from '@standardnotes/domain-events'
|
|
import { TimerInterface } from '@standardnotes/time'
|
|
import { DomainEventFactoryInterface } from './DomainEventFactoryInterface'
|
|
|
|
export class DomainEventFactory implements DomainEventFactoryInterface {
|
|
constructor(private timer: TimerInterface) {}
|
|
|
|
createTransitionStatusUpdatedEvent(dto: {
|
|
userUuid: string
|
|
transitionType: 'items' | 'revisions'
|
|
status: 'STARTED' | 'FAILED' | 'FINISHED'
|
|
}): TransitionStatusUpdatedEvent {
|
|
return {
|
|
type: 'TRANSITION_STATUS_UPDATED',
|
|
createdAt: this.timer.getUTCDate(),
|
|
meta: {
|
|
correlation: {
|
|
userIdentifier: dto.userUuid,
|
|
userIdentifierType: 'uuid',
|
|
},
|
|
origin: DomainEventService.SyncingServer,
|
|
},
|
|
payload: dto,
|
|
}
|
|
}
|
|
}
|