/**
 * Reset Password View Data Builder
 *
 * Transforms ResetPasswordPageDTO into ViewData for the reset password template.
 * Deterministic, side-effect free, no business logic.
 */

import { ResetPasswordPageDTO } from '@/lib/services/auth/types/ResetPasswordPageDTO';
import { ResetPasswordViewData } from './types/ResetPasswordViewData';

export class ResetPasswordViewDataBuilder {
  static build(apiDto: ResetPasswordPageDTO): ResetPasswordViewData {
    return {
      token: apiDto.token,
      returnTo: apiDto.returnTo,
      showSuccess: false,
      formState: {
        fields: {
          newPassword: { value: '', error: undefined, touched: false, validating: false },
          confirmPassword: { value: '', error: undefined, touched: false, validating: false },
        },
        isValid: true,
        isSubmitting: false,
        submitError: undefined,
        submitCount: 0,
      },
      isSubmitting: false,
      submitError: undefined,
    };
  }
}