45 lines
1014 B
C#
45 lines
1014 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using RacePlannerApi.Models;
|
|
|
|
namespace RacePlannerApi.DTOs;
|
|
|
|
public class RegisterRequest
|
|
{
|
|
[Required]
|
|
[EmailAddress]
|
|
public string Email { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[MinLength(8)]
|
|
public string Password { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[MinLength(2)]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
public UserRole Role { get; set; } = UserRole.Participant;
|
|
}
|
|
|
|
public class LoginRequest
|
|
{
|
|
[Required]
|
|
[EmailAddress]
|
|
public string Email { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
public string Password { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class AuthResponse
|
|
{
|
|
public string Token { get; set; } = string.Empty;
|
|
public UserDto User { get; set; } = null!;
|
|
}
|
|
|
|
public class UserDto
|
|
{
|
|
public Guid Id { get; set; }
|
|
public string Email { get; set; } = string.Empty;
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Role { get; set; } = string.Empty;
|
|
} |