src/events/RetryableSceneDetected.ts
import { ensure, isDefined, JSONObject } from 'tiny-types';
import { CorrelationId, Timestamp } from '../model';
import { DomainEvent } from './DomainEvent';
export class RetryableSceneDetected extends DomainEvent {
static fromJSON(o: JSONObject): RetryableSceneDetected {
return new RetryableSceneDetected(
CorrelationId.fromJSON(o.sceneId as string),
Timestamp.fromJSON(o.timestamp as string),
);
}
constructor(
public readonly sceneId: CorrelationId,
timestamp?: Timestamp,
) {
super(timestamp);
ensure('sceneId', sceneId, isDefined());
}
}