BotSharp/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs

58 lines
1.9 KiB
C#
Raw Normal View History

2024-09-19 00:49:32 +00:00
using BotSharp.Abstraction.Users.Enums;
2024-01-31 19:57:54 +00:00
using BotSharp.Abstraction.Users.Models;
2023-09-01 22:33:36 +00:00
namespace BotSharp.Plugin.MongoStorage.Collections;
2023-08-28 05:28:14 +00:00
public class UserDocument : MongoBase
2023-08-26 04:41:01 +00:00
{
2024-05-31 03:24:34 +00:00
public string UserName { get; set; } = null!;
public string FirstName { get; set; } = null!;
public string? LastName { get; set; }
public string? Email { get; set; }
public string? Phone { get; set; }
public string Salt { get; set; } = null!;
public string Password { get; set; } = null!;
2024-09-21 07:12:08 +00:00
public string Source { get; set; } = UserSource.Internal;
2023-09-06 04:41:49 +00:00
public string? ExternalId { get; set; }
2024-09-19 00:49:32 +00:00
public string Type { get; set; } = UserType.Client;
2024-05-31 03:24:34 +00:00
public string Role { get; set; } = null!;
2024-05-26 01:34:29 +00:00
public string? VerificationCode { get; set; }
public bool Verified { get; set; }
2024-10-21 11:59:05 +00:00
public string? RegionCode { get; set; }
2024-09-21 07:12:08 +00:00
public string? AffiliateId { get; set; }
2024-10-19 10:49:18 +00:00
public string? EmployeeId { get; set; }
2024-09-21 15:00:20 +00:00
public bool IsDisabled { get; set; }
2024-10-31 19:36:26 +00:00
public IEnumerable<string> Permissions { get; set; } = [];
2023-08-28 05:28:14 +00:00
public DateTime CreatedTime { get; set; }
public DateTime UpdatedTime { get; set; }
2024-01-31 19:57:54 +00:00
public Dashboard? Dashboard { get; set; }
2024-01-31 19:57:54 +00:00
public User ToUser()
{
return new User
{
Id = Id,
UserName = UserName,
FirstName = FirstName,
LastName = LastName,
Email = Email,
2024-05-31 03:24:34 +00:00
Phone = Phone,
2024-01-31 19:57:54 +00:00
Password = Password,
Salt = Salt,
Source = Source,
ExternalId = ExternalId,
2024-09-19 00:49:32 +00:00
Type = Type,
2024-05-26 01:34:29 +00:00
Role = Role,
2024-09-21 07:12:08 +00:00
AffiliateId = AffiliateId,
2024-10-20 05:02:13 +00:00
EmployeeId = EmployeeId,
2024-09-21 15:00:20 +00:00
IsDisabled = IsDisabled,
2024-05-26 01:34:29 +00:00
VerificationCode = VerificationCode,
Verified = Verified,
2024-10-21 11:59:05 +00:00
RegionCode = RegionCode,
2024-10-31 19:36:26 +00:00
Permissions = Permissions,
2024-11-20 09:42:22 +00:00
CreatedTime = CreatedTime,
UpdatedTime = UpdatedTime,
2024-01-31 19:57:54 +00:00
};
}
2023-08-28 05:28:14 +00:00
}