feat(Backend): update API gateway and websocket hubs
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace FinlyticBackend.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Persisted service configuration setting stored in PostgreSQL.
|
||||
/// </summary>
|
||||
[Table("service_configurations")]
|
||||
public class ServiceConfigurationEntity
|
||||
{
|
||||
[Key]
|
||||
[Column("id")]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
[Column("service_name")]
|
||||
public string ServiceName { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
[Column("config_key")]
|
||||
public string ConfigKey { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[Column("config_value")]
|
||||
public string ConfigValue { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(50)]
|
||||
[Column("data_type")]
|
||||
public string DataType { get; set; } = "string"; // string, int, double, boolean, json
|
||||
|
||||
[MaxLength(255)]
|
||||
[Column("description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
[Column("updated_at")]
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace FinlyticBackend.Entities;
|
||||
|
||||
[Table("user_device_tokens")]
|
||||
public class UserDeviceTokenEntity
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public UserEntity? User { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(500)]
|
||||
public string FcmToken { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(100)]
|
||||
public string DeviceName { get; set; } = "MobileDevice";
|
||||
|
||||
public DateTime RegisteredAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime LastUsedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace FinlyticBackend.Entities;
|
||||
|
||||
[Table("users")]
|
||||
public class UserEntity
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
[MaxLength(150)]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string PasswordHash { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(100)]
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[MaxLength(30)]
|
||||
public string Role { get; set; } = "User"; // "Admin" | "User"
|
||||
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
public bool RequiresPasswordChange { get; set; } = false;
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? LastLoginAt { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string ThemePreference { get; set; } = "dark_classic";
|
||||
|
||||
public List<UserDeviceTokenEntity> DeviceTokens { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace FinlyticBackend.Entities;
|
||||
|
||||
[Table("user_favorite_assets")]
|
||||
public class UserFavoriteAssetEntity
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public UserEntity? User { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(30)]
|
||||
public string Isin { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(50)]
|
||||
public string? SelectedTicker { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
Reference in New Issue
Block a user