using RSecurityBackend.Models.Auth.Db; using System; namespace RMuseum.Models.Divan { /// /// a contributor's suggestion to add a brand new kinship edge between two already-approved /// people, change an existing edge's type/degree/note, or remove an existing edge outright - /// the moderated counterpart of DivanPersonEditSuggestion, but for the edges between people /// rather than one person's own fields. Reviewed the same way (see /// DivanRelatedPersonService.ModeratePersonRelationEditSuggestionAsync). /// public class DivanPersonRelationEditSuggestion { /// /// suggestion id /// public int Id { get; set; } /// /// what this suggestion proposes doing /// public PersonRelationSuggestionAction Action { get; set; } /// /// whether this suggestion is about a kinship edge (Family, using SuggestedRelationType / /// ExistingRelationId / ExistingRelation) or a non-family affiliation edge (Affiliation, using /// SuggestedAffiliationType / ExistingAffiliationId / ExistingAffiliation instead). Defaults /// to Family so rows created before this field existed keep working unchanged. /// public PersonRelationSuggestionKind Kind { get; set; } /// /// for Modify/Remove when Kind is Family: the existing DivanPersonRelation row this /// suggestion targets. Null for Add, where there's nothing existing yet, and for any /// Kind == Affiliation suggestion (see ExistingAffiliationId instead). /// public int? ExistingRelationId { get; set; } /// /// the existing relation being modified/removed (for showing a before/after diff to the /// moderator) - null for Add, and for Kind == Affiliation /// public virtual DivanPersonRelation ExistingRelation { get; set; } /// /// for Modify/Remove when Kind is Affiliation: the existing DivanPersonAffiliation row this /// suggestion targets. Null for Add, and for any Kind == Family suggestion (see /// ExistingRelationId instead). /// public int? ExistingAffiliationId { get; set; } /// /// the existing affiliation being modified/removed (for showing a before/after diff to the /// moderator) - null unless Kind is Affiliation and Action is Modify/Remove /// public virtual DivanPersonAffiliation ExistingAffiliation { get; set; } /// /// the pair this suggestion is about. For Add, this and Person2Id define the new relation. /// For Modify/Remove, these are copied from ExistingRelation at submission time, so the /// suggestion always accurately reflects what it targets even if the underlying relation /// changes again before this is reviewed. /// public int Person1Id { get; set; } /// /// first person (navigation) /// public virtual DivanRelatedPerson Person1 { get; set; } /// /// second person id, see Person1Id /// public int Person2Id { get; set; } /// /// second person (navigation) /// public virtual DivanRelatedPerson Person2 { get; set; } /// /// for Add/Modify when Kind is Family: the relation type to create/change to. For Remove: a /// snapshot of the existing relation's type at submission time, purely for display (removing /// doesn't use it). Ignored when Kind is Affiliation - see SuggestedAffiliationType instead. /// public PersonRelationType SuggestedRelationType { get; set; } /// /// for Add/Modify when Kind is Affiliation: the affiliation type to create/change to. For /// Remove: a snapshot of the existing affiliation's type at submission time, purely for /// display. Null/ignored when Kind is Family - see SuggestedRelationType instead. /// public PersonAffiliationType? SuggestedAffiliationType { get; set; } /// /// see DivanPersonRelation.DegreeHint - same for/Add/Modify/Remove-display purpose as /// SuggestedRelationType above /// public int? SuggestedDegreeHint { get; set; } /// /// see DivanPersonRelation.Note - same Add/Modify/Remove-display purpose as /// SuggestedRelationType above /// public string SuggestedNote { get; set; } /// /// suggester's note to the moderator (e.g. why an existing relation is wrong) /// public string SuggestionNote { get; set; } /// /// date /// public DateTime Date { get; set; } /// /// suggester's user id /// public Guid UserId { get; set; } /// /// suggester /// public virtual RAppUser User { get; set; } /// /// reviewed /// public bool Reviewed { get; set; } /// /// review result /// public CorrectionReviewResult Result { get; set; } /// /// review date /// public DateTime ReviewDate { get; set; } /// /// review note /// public string ReviewNote { get; set; } /// /// reviewer's user id /// public Guid? ReviewerUserId { get; set; } /// /// reviewer /// public virtual RAppUser ReviewerUser { get; set; } } }