feat(auth): add OTP verification for email changes on profile update

Email changes via PATCH /api/v1/auth/profile now require OTP verification
instead of updating immediately. A 6-digit code is sent to the new email
address and must be confirmed via POST /api/v1/auth/profile/verify-email
within 10 minutes. Also fixes pre-existing web valuation test failures
(formatPrice output format, removed comparables section, missing
QueryClientProvider wrapper).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-16 04:23:06 +07:00
parent baaeb56849
commit 43f9e23b28
19 changed files with 429 additions and 76 deletions

View File

@@ -0,0 +1,12 @@
import { DomainEvent } from '@modules/shared';
export class EmailChangeRequestedEvent implements DomainEvent {
readonly eventName = 'user.email_change_requested';
readonly occurredAt = new Date();
constructor(
public readonly aggregateId: string,
public readonly newEmail: string,
public readonly otpCode: string,
) {}
}

View File

@@ -1,2 +1,3 @@
export { UserRegisteredEvent } from './user-registered.event';
export { AgentVerifiedEvent } from './agent-verified.event';
export { EmailChangeRequestedEvent } from './email-change-requested.event';