website refactor
This commit is contained in:
38
apps/website/lib/builders/view-data/SignupViewDataBuilder.ts
Normal file
38
apps/website/lib/builders/view-data/SignupViewDataBuilder.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Signup View Data Builder
|
||||
*
|
||||
* Transforms SignupPageDTO into ViewData for the signup template.
|
||||
* Deterministic, side-effect free, no business logic.
|
||||
*/
|
||||
|
||||
import { SignupPageDTO } from '@/lib/services/auth/types/SignupPageDTO';
|
||||
|
||||
export interface SignupViewData {
|
||||
returnTo: string;
|
||||
formState: any; // Will be managed by client component
|
||||
isSubmitting: boolean;
|
||||
submitError?: string;
|
||||
}
|
||||
|
||||
export class SignupViewDataBuilder {
|
||||
static build(data: SignupPageDTO): SignupViewData {
|
||||
return {
|
||||
returnTo: data.returnTo,
|
||||
formState: {
|
||||
fields: {
|
||||
firstName: { value: '', error: undefined, touched: false, validating: false },
|
||||
lastName: { value: '', error: undefined, touched: false, validating: false },
|
||||
email: { value: '', error: undefined, touched: false, validating: false },
|
||||
password: { 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,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user