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

48 lines
1.5 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-09-21 07:12:08 +00:00
public string? AffiliateId { get; set; }
public bool IsDisable { 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 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,
IsDisable = IsDisable,
2024-05-26 01:34:29 +00:00
VerificationCode = VerificationCode,
Verified = Verified,
2024-01-31 19:57:54 +00:00
};
}
2023-08-28 05:28:14 +00:00
}