feat(Core): update DTOs and shared models
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FinlyticCore.Models.Auth;
|
||||
|
||||
public class AuthResponseDto
|
||||
{
|
||||
public string Token { get; set; } = string.Empty;
|
||||
public Guid UserId { get; set; }
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
public string Role { get; set; } = "User";
|
||||
public List<string> FcmTokens { get; set; } = new();
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
public bool RequiresPasswordChange { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace FinlyticCore.Models.Auth;
|
||||
|
||||
public class CreateUserRequestDto
|
||||
{
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
public string Role { get; set; } = "User"; // "User" | "Admin"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using FinlyticCore.Models.Trades;
|
||||
|
||||
namespace FinlyticCore.Models.Auth;
|
||||
|
||||
/// <summary>
|
||||
/// Strongly typed SignalR client interface for real-time WebSocket/SSE streaming.
|
||||
/// </summary>
|
||||
public interface ITradeClient
|
||||
{
|
||||
Task OnTradeProposed(TradeProposalDto proposal);
|
||||
Task OnTradeUpdated(TradeHourlyUpdateDto update);
|
||||
Task OnTradeClosed(string tradeId, decimal exitPrice, string reason);
|
||||
Task OnNewsReceived(object newsItem);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace FinlyticCore.Models.Auth;
|
||||
|
||||
public class LoginRequestDto
|
||||
{
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace FinlyticCore.Models.Auth;
|
||||
|
||||
/// <summary>
|
||||
/// DTO representing a request for self-registration by a new user.
|
||||
/// </summary>
|
||||
public class RegisterRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// User email address.
|
||||
/// </summary>
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// User plain-text password.
|
||||
/// </summary>
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// User full name.
|
||||
/// </summary>
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace FinlyticCore.Models.Auth;
|
||||
|
||||
public class UpdateFcmTokenRequestDto
|
||||
{
|
||||
public string FcmToken { get; set; } = string.Empty;
|
||||
public string DeviceName { get; set; } = "MobileDevice";
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace FinlyticCore.Models.Auth;
|
||||
|
||||
/// <summary>
|
||||
/// DTO for updating user role or active status by an admin.
|
||||
/// </summary>
|
||||
public class UpdateUserRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Updated user role (User, Premium, Admin).
|
||||
/// </summary>
|
||||
public string? Role { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Updated active state of user.
|
||||
/// </summary>
|
||||
public bool? IsActive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Updated full name.
|
||||
/// </summary>
|
||||
public string? FullName { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FinlyticCore.Models.Auth;
|
||||
|
||||
public class UserDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
public string Role { get; set; } = "User";
|
||||
public bool IsActive { get; set; } = true;
|
||||
public List<string> FcmTokens { get; set; } = new();
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime? LastLoginAt { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user