/** * Signup Mutation * * Framework-agnostic mutation for signup operations. * Called from Server Actions. * * Pattern: Server Action → Mutation → Service → API Client */ import { Result } from '@/lib/contracts/Result'; import { AuthService } from '@/lib/services/auth/AuthService'; import { SessionViewModel } from '@/lib/view-models/SessionViewModel'; import { SignupParamsDTO } from '@/lib/types/generated/SignupParamsDTO'; export class SignupMutation { async execute(params: SignupParamsDTO): Promise> { try { const authService = new AuthService(); const session = await authService.signup(params); return Result.ok(session); } catch (error) { const errorMessage = error instanceof Error ? error.message : 'Signup failed'; return Result.err(errorMessage); } } }