feat(dal): Создана таблица JobRelationshipFilter для хранения фильров атрибутов связей между ЭК
This commit is contained in:
54
PARR.DAL/Models/Job/JobRelationshipFilter.cs
Normal file
54
PARR.DAL/Models/Job/JobRelationshipFilter.cs
Normal 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; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user