feat(console): add tenant DTOs

This commit is contained in:
Sam 2026-02-05 14:13:47 +08:00
parent 50c443fdfa
commit 8a20a3368e
4 changed files with 83 additions and 0 deletions

View File

@ -0,0 +1,29 @@
using System.ComponentModel.DataAnnotations;
namespace Fengling.Console.Models.Dtos;
public class CreateTenantDto
{
[Required]
public string TenantId { get; set; } = string.Empty;
[Required]
public string Name { get; set; } = string.Empty;
[Required]
public string ContactName { get; set; } = string.Empty;
[Required]
[EmailAddress]
public string ContactEmail { get; set; } = string.Empty;
public string? ContactPhone { get; set; }
public int? MaxUsers { get; set; }
public string? Description { get; set; }
public string Status { get; set; } = "active";
public DateTime? ExpiresAt { get; set; }
}

17
Models/Dtos/TenantDto.cs Normal file
View File

@ -0,0 +1,17 @@
namespace Fengling.Console.Models.Dtos;
public class TenantDto
{
public long Id { get; set; }
public string TenantId { get; set; } = "";
public string Name { get; set; } = "";
public string ContactName { get; set; } = "";
public string ContactEmail { get; set; } = "";
public string? ContactPhone { get; set; }
public int? MaxUsers { get; set; }
public int UserCount { get; set; }
public string Status { get; set; } = "active";
public DateTime? ExpiresAt { get; set; }
public string? Description { get; set; }
public DateTime CreatedAt { get; set; }
}

View File

@ -0,0 +1,11 @@
namespace Fengling.Console.Models.Dtos;
public class TenantSettingsDto
{
public bool AllowRegistration { get; set; }
public string AllowedEmailDomains { get; set; } = string.Empty;
public long? DefaultRoleId { get; set; }
public List<string> PasswordPolicy { get; set; } = new();
public int MinPasswordLength { get; set; } = 8;
public int SessionTimeout { get; set; } = 120;
}

View File

@ -0,0 +1,26 @@
using System.ComponentModel.DataAnnotations;
namespace Fengling.Console.Models.Dtos;
public class UpdateTenantDto
{
[Required]
public string Name { get; set; } = string.Empty;
[Required]
public string ContactName { get; set; } = string.Empty;
[Required]
[EmailAddress]
public string ContactEmail { get; set; } = string.Empty;
public string? ContactPhone { get; set; }
public int? MaxUsers { get; set; }
public string? Description { get; set; }
public string Status { get; set; } = "active";
public DateTime? ExpiresAt { get; set; }
}