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

export interface ConfigUpdatedPayload {
  configKey: string;
  changes: Record<string, any>;
  updatedBy: string;
}

/**
 * 榜单配置更新事件
 */
export class ConfigUpdatedEvent extends DomainEvent {
  constructor(private readonly payload: ConfigUpdatedPayload) {
    super();
  }

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

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

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

  toPayload(): ConfigUpdatedPayload {
    return { ...this.payload };
  }
}
