38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
/**
|
|
* Forgot Password View Data Builder
|
|
*
|
|
* Transforms ForgotPasswordPageDTO into ViewData for the forgot password template.
|
|
* Deterministic, side-effect free, no business logic.
|
|
*/
|
|
|
|
import { ForgotPasswordPageDTO } from '@/lib/services/auth/types/ForgotPasswordPageDTO';
|
|
|
|
export interface ForgotPasswordViewData {
|
|
returnTo: string;
|
|
showSuccess: boolean;
|
|
successMessage?: string;
|
|
magicLink?: string;
|
|
formState: any; // Will be managed by client component
|
|
isSubmitting: boolean;
|
|
submitError?: string;
|
|
}
|
|
|
|
export class ForgotPasswordViewDataBuilder {
|
|
static build(data: ForgotPasswordPageDTO): ForgotPasswordViewData {
|
|
return {
|
|
returnTo: data.returnTo,
|
|
showSuccess: false,
|
|
formState: {
|
|
fields: {
|
|
email: { value: '', error: undefined, touched: false, validating: false },
|
|
},
|
|
isValid: true,
|
|
isSubmitting: false,
|
|
submitError: undefined,
|
|
submitCount: 0,
|
|
},
|
|
isSubmitting: false,
|
|
submitError: undefined,
|
|
};
|
|
}
|
|
} |