divan/RMuseum/Models/Ganjoor/ViewModels/GanjoorPersonRelationsViewModel.cs
Hamid Reza Mohammadi 8110e09a07 people tags #387
2026-09-28 14:41:47 +03:30

97 lines
3.1 KiB
C#

using System.Collections.Generic;
namespace RMuseum.Models.Ganjoor.ViewModels
{
/// <summary>
/// a person plus their kinship/affiliation edges, resolved with the other side's name - the
/// read-only counterpart of the pending-suggestion PersonGraphSuggestion (see
/// GanjoorPoemGeoDateTagCorrection.SuggestedPersonGraphJson), served by GET api/people/{id}/relations
/// </summary>
public class GanjoorPersonRelationsViewModel
{
/// <summary>
/// the subject person
/// </summary>
public GanjoorRelatedPerson Person { get; set; }
/// <summary>
/// kinship edges touching Person (either side)
/// </summary>
public List<GanjoorPersonRelationInfo> Relations { get; set; }
/// <summary>
/// non-family ties touching Person (either side)
/// </summary>
public List<GanjoorPersonAffiliationInfo> Affiliations { get; set; }
}
/// <summary>
/// one GanjoorPersonRelation row, resolved from Person's point of view
/// </summary>
public class GanjoorPersonRelationInfo
{
/// <summary>
/// the other person in this relation
/// </summary>
public int OtherPersonId { get; set; }
/// <summary>
/// the other person's name (denormalized here so the client doesn't need a second lookup)
/// </summary>
public string OtherPersonName { get; set; }
/// <summary>
/// the kind of kinship edge
/// </summary>
public PersonRelationType RelationType { get; set; }
/// <summary>
/// see GanjoorPersonRelation.DegreeHint
/// </summary>
public int? DegreeHint { get; set; }
/// <summary>
/// free-text note
/// </summary>
public string Note { get; set; }
/// <summary>
/// true if the subject person is Person1 in the underlying GanjoorPersonRelation row -
/// needed by the client to render directional types (Parent, Ancestor) correctly
/// </summary>
public bool SubjectIsPerson1 { get; set; }
}
/// <summary>
/// one GanjoorPersonAffiliation row, resolved from Person's point of view - same shape/purpose
/// as GanjoorPersonRelationInfo above, but for a non-family tie
/// </summary>
public class GanjoorPersonAffiliationInfo
{
/// <summary>
/// the other person in this tie
/// </summary>
public int OtherPersonId { get; set; }
/// <summary>
/// the other person's name
/// </summary>
public string OtherPersonName { get; set; }
/// <summary>
/// the kind of non-family tie
/// </summary>
public PersonAffiliationType AffiliationType { get; set; }
/// <summary>
/// free-text note
/// </summary>
public string Note { get; set; }
/// <summary>
/// true if the subject person is Person1 in the underlying GanjoorPersonAffiliation row
/// </summary>
public bool SubjectIsPerson1 { get; set; }
}
}