import 'package:shuffle/features/auth/domain/email_link_type.dart'; /// Parameters of a mail link `/auth/confirm?token_hash=…&type=…`. class EmailLinkRequest { const EmailLinkRequest({required this.tokenHash, required this.type}); final String tokenHash; final EmailLinkType type; /// `null` if the token is missing or the type is unknown. static EmailLinkRequest? tryParse(String? tokenHash, String? type) { final parsedType = EmailLinkType.tryParse(type); final token = tokenHash?.trim(); if (token == null || token.isEmpty || parsedType == null) { return null; } return EmailLinkRequest(tokenHash: token, type: parsedType); } }