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

/**
 * Emitted when a user requests to feature (boost) a listing. Carries enough
 * context for downstream listeners (analytics, audit, anti-fraud) to react
 * without coupling them to the listings module.
 *
 * The actual payment is initiated synchronously through the
 * `IPaymentInitiator` port — see A-10. This event is the audit trail.
 */
export class FeaturedListingPaymentRequestedEvent implements DomainEvent {
  readonly eventName = 'listing.featured-payment-requested';
  readonly occurredAt: Date;

  constructor(
    /** The listing being featured (used as `aggregateId`). */
    public readonly aggregateId: string,
    public readonly userId: string,
    public readonly package_: '3_days' | '7_days' | '30_days',
    public readonly priceVND: bigint,
    public readonly provider: string,
  ) {
    this.occurredAt = new Date();
  }
}
