64 lines
1.2 KiB
C#
64 lines
1.2 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Fengling.AuthService.Models;
|
|
|
|
public class Tenant
|
|
{
|
|
private long _id;
|
|
private string _tenantId;
|
|
private string _name;
|
|
|
|
[Key]
|
|
public long Id
|
|
{
|
|
get => _id;
|
|
set => _id = value;
|
|
}
|
|
|
|
[MaxLength(50)]
|
|
[Required]
|
|
public string TenantId
|
|
{
|
|
get => _tenantId;
|
|
set => _tenantId = value;
|
|
}
|
|
|
|
[MaxLength(100)]
|
|
[Required]
|
|
public string Name
|
|
{
|
|
get => _name;
|
|
set => _name = value;
|
|
}
|
|
|
|
[MaxLength(50)]
|
|
[Required]
|
|
public string ContactName { get; set; } = string.Empty;
|
|
|
|
[MaxLength(100)]
|
|
[Required]
|
|
[EmailAddress]
|
|
public string ContactEmail { get; set; } = string.Empty;
|
|
|
|
[MaxLength(20)]
|
|
public string? ContactPhone { get; set; }
|
|
|
|
public int? MaxUsers { get; set; }
|
|
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
[MaxLength(500)]
|
|
public string? Description { get; set; }
|
|
|
|
[MaxLength(20)]
|
|
public string Status { get; set; } = "active";
|
|
|
|
public DateTime? ExpiresAt { get; set; }
|
|
|
|
public DateTime? UpdatedAt { get; set; }
|
|
|
|
public bool IsDeleted { get; set; }
|
|
|
|
public TenantInfo Info => new(Id, TenantId, Name);
|
|
}
|