back photo + event tags and persons

This commit is contained in:
2025-08-10 20:07:40 +02:00
parent 0cc8bddfa1
commit f61b48fa4b
46 changed files with 1438 additions and 189 deletions

View File

@@ -0,0 +1,38 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace back.DataModels;
[Table("Users")]
public class UserModel : PersonModel
{
[Required]
public string Email { get; set; }
[Required, MinLength(8)]
public string Password { get; set; }
public List<RoleModel> Role { get; set; }
public UserModel(string id, string email, string password, string name, List<RoleModel> role, DateTime createdAt, DateTime updatedAt)
: base(id, name)
{
Email = email;
Password = password;
Role = role;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
}
public bool IsAdmin => Role.Exists(r => r.IsAdmin);
public bool IsContentManager => Role.Exists(r => r.IsContentManager);
public bool IsUser => Role.Exists(r => r.IsUser);
public static readonly UserModel DefaultUser = new(
"0",
"default@example.com",
string.Empty,
"Default User",
[RoleModel.UserRole],
DateTime.UtcNow,
DateTime.UtcNow
);
}