using Church.Net.Entity.Interface; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Security.Claims; using System.Text; using System.Threading.Tasks; namespace Church.Net.Entity { [Flags] public enum Role { None = 0, FamilyMember = 1 << 0, // 0001 -- the bitshift is unnecessary, but done for consistency CellGroupLeader = 1 << 1, // 0010 Pastor = 1 << 2, // 0100 Admin = 1 << 3, // 1111 Best = 1 << 4, // 1111 All = ~(~0 << 20) // 1111 } public class FamilyMember : IEntity { public FamilyMember() { } [Key] public string Id { get; set; } public string Email { get; set; } [JsonIgnore] public string Password { get; set; } public string AvatarImage { get; set; } [StringLength(50)] public string FirstName { get; set; } [StringLength(50)] public string LastName { get; set; } public Enumeration.Gender Gender { get; set; } public DateTime? Birthday { get; set; } public bool Married { get; set; } public bool Baptized { get; set; } public DateTime? DateOfBaptized { get; set; } public DateTime? DateOfWalkIn { get; set; } [StringLength(500)] public string Address { get; set; } [StringLength(50)] public string ComunityAppId { get; set; } [ForeignKey("Career")] public string CareerId { get; set; } public Career Career { get; set; } public virtual ICollection PastoralDomains { get; set; } public virtual ICollection OAuthInfos { get; set; } public string Comment { get; set; } public Role Role { get; set; } } }