Files
standardnotes-server/packages/revisions/src/Domain/Event/DomainEventFactory.ts
T
Karol SójkoandGitHub 25ffd6b803 feat: add a way to trigger transition procedure for revisions (#798)
* feat: add a way to trigger transition procedure for revisions

* fix: localstack linking

* fix: revisions endpoints
2023-08-30 13:14:49 +02:00

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,
}
}
}