diff --git a/CoviDok/Api/Objects/PublicAssistant.cs b/CoviDok/Api/Objects/PublicAssistant.cs index b66a2af..763731c 100644 --- a/CoviDok/Api/Objects/PublicAssistant.cs +++ b/CoviDok/Api/Objects/PublicAssistant.cs @@ -1,4 +1,5 @@ -using System; +using CoviDok.Data.Model; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -14,5 +15,7 @@ namespace CoviDok.Api.Objects public string Email { get; set; } public int ID { get; set; } public string PictureID { get; set; } + public Gender Gender { get; set; } + public Role Role { get; set; } } } diff --git a/CoviDok/Api/Objects/PublicChild.cs b/CoviDok/Api/Objects/PublicChild.cs index 8a0e5f8..5013c82 100644 --- a/CoviDok/Api/Objects/PublicChild.cs +++ b/CoviDok/Api/Objects/PublicChild.cs @@ -1,7 +1,9 @@ -using System; +using CoviDok.Data.Model; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using static CoviDok.Data.Model.User; namespace CoviDok.Api.Objects { @@ -16,5 +18,7 @@ namespace CoviDok.Api.Objects public string SSN { get; set; } public DateTime BirthDate { get; set; } public string PictureId { get; set; } + public Gender Gender { get; set; } + public Role Role { get; set; } } } diff --git a/CoviDok/Api/Objects/PublicDoctor.cs b/CoviDok/Api/Objects/PublicDoctor.cs index 0cd3e21..ea9c5f8 100644 --- a/CoviDok/Api/Objects/PublicDoctor.cs +++ b/CoviDok/Api/Objects/PublicDoctor.cs @@ -1,4 +1,5 @@ -using System; +using CoviDok.Data.Model; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -13,6 +14,8 @@ namespace CoviDok.Api.Objects public string LastName { get; set; } public string PictureID { get; set; } public string Email { get; set; } + public Gender Gender { get; set; } + public Role Role { get; set; } } } diff --git a/CoviDok/Api/Objects/PublicParent.cs b/CoviDok/Api/Objects/PublicParent.cs index 3866294..b57924c 100644 --- a/CoviDok/Api/Objects/PublicParent.cs +++ b/CoviDok/Api/Objects/PublicParent.cs @@ -1,4 +1,5 @@ -using System; +using CoviDok.Data.Model; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -13,6 +14,8 @@ namespace CoviDok.Api.Objects public string LastName { get; set; } public string Email { get; set; } public ICollection Children { get; set; } = new List(); - public string PictureID { get; internal set; } + public string PictureID { get; set; } + public Gender Gender { get; set; } + public Role Role { get; set; } } } diff --git a/CoviDok/Api/Role.cs b/CoviDok/Api/Role.cs index 5fb4bcb..1a5763d 100644 --- a/CoviDok/Api/Role.cs +++ b/CoviDok/Api/Role.cs @@ -9,6 +9,7 @@ namespace CoviDok.Api { Doc, Ast, - Par + Par, + Chi } } diff --git a/CoviDok/Data/Model/Assistant.cs b/CoviDok/Data/Model/Assistant.cs index ad7d82f..dd9f194 100644 --- a/CoviDok/Data/Model/Assistant.cs +++ b/CoviDok/Data/Model/Assistant.cs @@ -17,6 +17,7 @@ namespace CoviDok.Data.Model Email = assistant.Email; PictureId = assistant.PictureID; DoctorId = assistant.DoctorId; + Gender = assistant.Gender; } public PublicAssistant ToPublic() { @@ -27,7 +28,9 @@ namespace CoviDok.Data.Model Email = Email, PictureID = PictureId, ID = Id, - DoctorId = DoctorId + DoctorId = DoctorId, + Gender = Gender, + Role = Api.Role.Ast }; } } diff --git a/CoviDok/Data/Model/Child.cs b/CoviDok/Data/Model/Child.cs index 5888648..3674bfa 100644 --- a/CoviDok/Data/Model/Child.cs +++ b/CoviDok/Data/Model/Child.cs @@ -23,7 +23,9 @@ namespace CoviDok.Data.Model ParentId = ParentId, SSN = SSN, BirthDate = BirthDate, - PictureId = PictureId + PictureId = PictureId, + Gender = Gender, + Role = Api.Role.Chi }; } public void UpdateSelf(PublicChild newVal) @@ -35,6 +37,7 @@ namespace CoviDok.Data.Model SSN = newVal.SSN; BirthDate = newVal.BirthDate; PictureId = newVal.PictureId; + Gender = newVal.Gender; } } } diff --git a/CoviDok/Data/Model/Doctor.cs b/CoviDok/Data/Model/Doctor.cs index 6d4bcef..dfa46ee 100644 --- a/CoviDok/Data/Model/Doctor.cs +++ b/CoviDok/Data/Model/Doctor.cs @@ -17,6 +17,7 @@ namespace CoviDok.Data.Model LastName = doctor.LastName; Email = doctor.Email; PictureId = doctor.PictureID; + Gender = doctor.Gender; } public PublicDoctor ToPublic() { @@ -26,7 +27,9 @@ namespace CoviDok.Data.Model LastName = LastName, Email = Email, PictureID = PictureId, - ID = Id + ID = Id, + Gender = Gender, + Role = Api.Role.Doc }; } diff --git a/CoviDok/Data/Model/Gender.cs b/CoviDok/Data/Model/Gender.cs new file mode 100644 index 0000000..16ca0fc --- /dev/null +++ b/CoviDok/Data/Model/Gender.cs @@ -0,0 +1,9 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace CoviDok.Data.Model +{ + public enum Gender { Male, Female } +} diff --git a/CoviDok/Data/Model/Parent.cs b/CoviDok/Data/Model/Parent.cs index 9db47c9..45520b6 100644 --- a/CoviDok/Data/Model/Parent.cs +++ b/CoviDok/Data/Model/Parent.cs @@ -16,16 +16,24 @@ namespace CoviDok.Data.Model LastName = parent.LastName; Email = parent.Email; PictureId = parent.PictureID; + Gender = parent.Gender; } public PublicParent ToPublic() { - return new PublicParent { + PublicParent p= new PublicParent { FirstName = FirstName, LastName = LastName, Email = Email, PictureID = PictureId, - ID = Id + ID = Id, + Gender = Gender, + Role = Api.Role.Par }; + foreach (Child child in Children) + { + p.Children.Add(child.ToPublic()); + } + return p; } } } diff --git a/CoviDok/Data/Model/User.cs b/CoviDok/Data/Model/User.cs index 6bb7986..37f0984 100644 --- a/CoviDok/Data/Model/User.cs +++ b/CoviDok/Data/Model/User.cs @@ -15,5 +15,7 @@ namespace CoviDok.Data.Model public DateTime RegistrationDate { get; set; } public string PictureId { get; set; } - } + + public Gender Gender { get; set; } + } }