using System.ComponentModel.DataAnnotations;
namespace Api.Models.DTOs
{
public class AuthenticateRequest
{
[Required]
public string IdToken { get; set; } = string.Empty;
[Required]
public string Provider { get; set; } = string.Empty; // "Microsoft", "Google", "PocketId"
///
/// Optional access token for API calls (e.g., Microsoft Graph)
///
public string? AccessToken { get; set; }
}
public class AuthenticateResponse
{
public string AccessToken { get; set; } = string.Empty;
public DateTime ExpiresAt { get; set; }
public UserProfile User { get; set; } = null!;
public bool IsNewUser { get; set; }
}
public class UserProfile
{
public int Id { get; set; }
public string Email { get; set; } = string.Empty;
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? ProfilePictureUrl { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? LastLoginAt { get; set; }
public List Providers { get; set; } = new List();
}
// User CRUD DTOs
public class CreateUserRequest
{
[Required]
[EmailAddress]
[StringLength(255)]
public string Email { get; set; } = string.Empty;
[StringLength(255)]
public string? FirstName { get; set; }
[StringLength(255)]
public string? LastName { get; set; }
[StringLength(500)]
public string? ProfilePictureUrl { get; set; }
public bool IsActive { get; set; } = true;
}
public class UpdateUserRequest
{
[StringLength(255)]
public string? FirstName { get; set; }
[StringLength(255)]
public string? LastName { get; set; }
[StringLength(500)]
public string? ProfilePictureUrl { get; set; }
public bool? IsActive { get; set; }
}
public class UserDto
{
public int Id { get; set; }
public string Email { get; set; } = string.Empty;
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? ProfilePictureUrl { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? LastLoginAt { get; set; }
public bool IsActive { get; set; }
public List OAuthProviders { get; set; } = new List();
}
public class UserOAuthProviderDto
{
public int Id { get; set; }
public OAuthProvider Provider { get; set; }
public string ProviderId { get; set; } = string.Empty;
public string? ProviderEmail { get; set; }
public string? ProviderName { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? LastUsedAt { get; set; }
}
public class JwtSettings
{
public string SecretKey { get; set; } = string.Empty;
public string Issuer { get; set; } = string.Empty;
public string Audience { get; set; } = string.Empty;
public int ExpirationMinutes { get; set; } = 60;
}
public class OAuthProviderSettings
{
public Dictionary Providers { get; set; } = new Dictionary();
}
public class ProviderConfig
{
public string Authority { get; set; } = string.Empty;
public string ClientId { get; set; } = string.Empty;
public string? ClientSecret { get; set; }
public List ValidAudiences { get; set; } = new List();
}
}