import { type DomainEvent } from '@modules/shared';

/**
 * Fired by the daily expiry-warning cron for each listing that expires
 * within the next 3 days and has not yet received a warning notification.
 */
export class ListingExpiringEvent implements DomainEvent {
  readonly eventName = 'listing.expiring';
  readonly occurredAt = new Date();

  constructor(
    /** Listing ID */
    public readonly aggregateId: string,
    /** ID of the seller who owns the listing */
    public readonly sellerId: string,
    /** When the listing expires */
    public readonly expiresAt: Date,
  ) {}
}
