/**
 * Reset Password ViewModel Builder
 * 
 * Transforms API DTOs into ResetPasswordViewModel for client-side state management.
 * Deterministic, side-effect free, no business logic.
 */

import { ResetPasswordViewData } from '@/lib/builders/view-data/types/ResetPasswordViewData';
import { ResetPasswordViewModel, ResetPasswordFormState, ResetPasswordUIState } from '@/lib/view-models/auth/ResetPasswordViewModel';

export class ResetPasswordViewModelBuilder {
  static build(viewData: ResetPasswordViewData): ResetPasswordViewModel {
    const formState: ResetPasswordFormState = {
      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,
    };

    const uiState: ResetPasswordUIState = {
      showPassword: false,
      showConfirmPassword: false,
    };

    return new ResetPasswordViewModel(
      viewData.token,
      viewData.returnTo,
      formState,
      uiState,
      false,
      null,
      false,
      null
    );
  }
}