/**
 * ShareRevoked Event
 *
 * Emitted when a share is revoked.
 */

import { DomainEvent } from './domain-event.base';

export class ShareRevokedEvent extends DomainEvent {
  constructor(
    public readonly shareId: string,
    public readonly partyId: string,
    public readonly reason: string,
  ) {
    super();
  }

  get eventType(): string {
    return 'ShareRevoked';
  }

  get aggregateId(): string {
    return this.shareId;
  }

  get aggregateType(): string {
    return 'PartyShare';
  }

  get payload(): Record<string, unknown> {
    return {
      shareId: this.shareId,
      partyId: this.partyId,
      reason: this.reason,
    };
  }
}
