@serenity-js/core
Version:
The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure
27 lines (24 loc) • 883 B
text/typescript
import { ensure, isDefined } from 'tiny-types';
import type { ActivityDetails, CorrelationId, Outcome } from '../model';
import type { Timestamp } from '../screenplay';
import { DomainEvent } from './DomainEvent';
/**
* Emitted when an [`Activity`](https://serenity-js.org/api/core/class/Activity/) is finished.
*
* @group Events
*/
export abstract class ActivityFinished extends DomainEvent {
constructor(
public readonly sceneId: CorrelationId,
public readonly activityId: CorrelationId,
public readonly details: ActivityDetails,
public readonly outcome: Outcome,
timestamp?: Timestamp,
) {
super(timestamp);
ensure('sceneId', sceneId, isDefined());
ensure('activityId', activityId, isDefined());
ensure('details', details, isDefined());
ensure('outcome', outcome, isDefined());
}
}