Projects (GanjooRazor -> DivanRazor, GanjoorService.sln -> DivanService.sln), files, folders, classes, namespaces, settings, API routes (/api/divan) and DB tables (Divan*). External addresses (ganjoor.net, github.com/ganjoor) unchanged. Migrations renamed consistently (no pending model changes); requires a fresh database. Upstream RUNNING_LOCALLY/SEMANTIC_SEARCH docs archived unmodified under docs/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
110 lines
3.6 KiB
C#
110 lines
3.6 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace RMuseum.Models.Divan.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
|
|
/// DivanPoemGeoDateTagCorrection.SuggestedPersonGraphJson), served by GET api/people/{id}/relations
|
|
/// </summary>
|
|
public class DivanPersonRelationsViewModel
|
|
{
|
|
/// <summary>
|
|
/// the subject person
|
|
/// </summary>
|
|
public DivanRelatedPerson Person { get; set; }
|
|
|
|
/// <summary>
|
|
/// kinship edges touching Person (either side)
|
|
/// </summary>
|
|
public List<DivanPersonRelationInfo> Relations { get; set; }
|
|
|
|
/// <summary>
|
|
/// non-family ties touching Person (either side)
|
|
/// </summary>
|
|
public List<DivanPersonAffiliationInfo> Affiliations { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// one DivanPersonRelation row, resolved from Person's point of view
|
|
/// </summary>
|
|
public class DivanPersonRelationInfo
|
|
{
|
|
/// <summary>
|
|
/// the underlying DivanPersonRelation row's own id - needed by the client to link to
|
|
/// /User/SuggestPersonRelationEdit?relationId={id} for suggesting a change/removal of this specific edge
|
|
/// </summary>
|
|
public int Id { get; set; }
|
|
|
|
/// <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 DivanPersonRelation.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 DivanPersonRelation row -
|
|
/// needed by the client to render directional types (Parent, Ancestor) correctly
|
|
/// </summary>
|
|
public bool SubjectIsPerson1 { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// one DivanPersonAffiliation row, resolved from Person's point of view - same shape/purpose
|
|
/// as DivanPersonRelationInfo above, but for a non-family tie
|
|
/// </summary>
|
|
public class DivanPersonAffiliationInfo
|
|
{
|
|
/// <summary>
|
|
/// the underlying DivanPersonAffiliation row's own id - used to link to
|
|
/// /User/SuggestPersonRelationEdit?affiliationId={Id} for suggesting a change/removal of
|
|
/// this edge, same role RelationId plays on DivanPersonRelationInfo
|
|
/// </summary>
|
|
public int Id { get; set; }
|
|
|
|
/// <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 DivanPersonAffiliation row
|
|
/// </summary>
|
|
public bool SubjectIsPerson1 { get; set; }
|
|
}
|
|
}
|