website refactor
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Forgot Password ViewModel Builder
|
||||
*
|
||||
* Transforms API DTOs into ForgotPasswordViewModel for client-side state management.
|
||||
* Deterministic, side-effect free, no business logic.
|
||||
*/
|
||||
|
||||
import { ForgotPasswordViewData } from '@/lib/builders/view-data/ForgotPasswordViewDataBuilder';
|
||||
import { ForgotPasswordViewModel, ForgotPasswordFormState } from '@/lib/view-models/auth/ForgotPasswordViewModel';
|
||||
|
||||
export class ForgotPasswordViewModelBuilder {
|
||||
static build(viewData: ForgotPasswordViewData): ForgotPasswordViewModel {
|
||||
const formState: ForgotPasswordFormState = {
|
||||
fields: {
|
||||
email: { value: '', error: undefined, touched: false, validating: false },
|
||||
},
|
||||
isValid: true,
|
||||
isSubmitting: false,
|
||||
submitError: undefined,
|
||||
submitCount: 0,
|
||||
};
|
||||
|
||||
return new ForgotPasswordViewModel(
|
||||
viewData.returnTo,
|
||||
formState,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
null
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user