rwadurian/backend/services/auth-service/src/domain/events/legacy-user-migrated.event.ts

24 lines
578 B
TypeScript

/**
* 1.0 用户迁移事件
*/
export class LegacyUserMigratedEvent {
static readonly EVENT_TYPE = 'user.legacy.migrated';
constructor(
public readonly accountSequence: string,
public readonly phone: string,
public readonly nickname: string,
public readonly migratedAt: Date,
) {}
toPayload(): Record<string, unknown> {
return {
eventType: LegacyUserMigratedEvent.EVENT_TYPE,
accountSequence: this.accountSequence,
phone: this.phone,
nickname: this.nickname,
migratedAt: this.migratedAt.toISOString(),
};
}
}