feat(dal): Создана таблица JobRelationshipFilter для хранения фильров атрибутов связей между ЭК

This commit is contained in:
Mikhail Kuznetsov
2025-08-01 17:14:39 +10:00
parent e3b9392d84
commit 46a96c666e
8 changed files with 4012 additions and 6 deletions

View File

@@ -0,0 +1,54 @@
using Microsoft.EntityFrameworkCore;
using PARR.DAL.Context;
using PARR.DAL.Models.Unit;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models.Job
{
[Table("RelationshipFilters", Schema = DataContextSettings.Job)]
[Comment("Таблица фильтров связей ЭК")]
[PrimaryKey(nameof(UnitFilterId), nameof(FieldId))]
public class JobRelationshipFilter //: IBase
{
//[Key]
//public Guid Id { get; set; }
//public DateTimeOffset DateCreated { get; set; }
//public DateTimeOffset? DateModified { get; set; }
public Guid UnitFilterId { get; set; }
/// <summary>
/// Родительская связь - true,
/// Дочерняя связь - false
/// </summary>
public bool IsParent { get; set; }
public Guid FieldId { get; set; }
public required string ValueMask { get; set; }
/// <summary>
/// Полное совпадение или хотябы одно
/// true - list.All()
/// false - list.Any()
/// </summary>
public bool IsFullMatch { get; set; }
/// <summary>
/// Обратный фильтр, что у связи нет таких значений
/// </summary>
public bool IsInverse { get; set; }
[ForeignKey(nameof(UnitFilterId))]
public JobUnitFilter? UnitFilter { get; set; }
[ForeignKey(nameof(FieldId))]
public UnitField? UnitField { get; set; }
}
}

View File

@@ -24,6 +24,8 @@ namespace PARR.DAL.Models.Job
[ForeignKey(nameof(JobId))]
public Job? Job { get; set; }
public ICollection<FieldFilter> fieldFilters { get; set; } = new HashSet<FieldFilter>();
public ICollection<FieldFilter> FieldFilters { get; set; } = new HashSet<FieldFilter>();
public ICollection<JobRelationshipFilter> RelationshipFilters { get; set; } = new HashSet<JobRelationshipFilter>();
}
}

View File

@@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore;
using PARR.DAL.Context;
using PARR.DAL.Models.Base;
using PARR.DAL.Models.Job;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -49,5 +50,6 @@ namespace PARR.DAL.Models.Unit
public ICollection<UnitFieldInUnitFieldValue> FieldValues { get; set; } = new HashSet<UnitFieldInUnitFieldValue>();
public ICollection<JobRelationshipFilter> RelationshipFilters { get; set; } = new HashSet<JobRelationshipFilter>();
}
}