feat: Из dal перенесены все модели в Domain. Из dal переименованы service в repository, вынесены в Core.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
using PARR.Core.Repositories.Base;
|
||||
using PARR.Domain.Entities.Unit;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces.Unit
|
||||
{
|
||||
public interface IUnitFieldRepository : IBaseRepository<UnitField>
|
||||
{
|
||||
Task<UnitField?> GetByAihitNameAsync(string name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using PARR.Core.Repositories.Base;
|
||||
using PARR.Domain.Entities.Unit;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces.Unit
|
||||
{
|
||||
public interface IUnitFieldValueRepository: IBaseRepository<UnitFieldValue>
|
||||
{
|
||||
Task<UnitFieldValue?> GetByValueNameAsync(string? value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using PARR.Domain.Entities.Unit;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces.Unit
|
||||
{
|
||||
public interface IUnitInUnitRepository
|
||||
{
|
||||
Task<List<UnitInUnit>> GetByParentIdAsync(Guid parentId);
|
||||
Task<List<UnitInUnit>> GetByChildIdAsync(Guid childId);
|
||||
|
||||
/// <summary>
|
||||
/// Получает связи, где ChildUnitId unitIds (для IsParent=True).
|
||||
/// </summary>
|
||||
Task<List<UnitInUnit>> GetParentLinksByChildIdsAsync(IEnumerable<Guid> childUnitIds);
|
||||
|
||||
/// <summary>
|
||||
/// Получает связи, где ParentUnitId unitIds (для IsParent=False).
|
||||
/// </summary>
|
||||
Task<List<UnitInUnit>> GetChildLinksByParentIdsAsync(IEnumerable<Guid> parentUnitIds);
|
||||
|
||||
|
||||
IQueryable<UnitInUnit> Get();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using PARR.Domain.Entities.Unit;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces.Unit
|
||||
{
|
||||
public interface IUnitInValueRepository
|
||||
{
|
||||
Task<List<UnitInValue>> GetByUnitIdsAsync(IEnumerable<Guid> unitIds);
|
||||
|
||||
Task<List<UnitInValue>> GetByUnitIdAsync(Guid unitId);
|
||||
|
||||
Task<List<(string FieldName, string? Value)>> GetFieldValuesAsync(Guid unitId, IReadOnlyCollection<string> aihitNames);
|
||||
|
||||
/// <summary>
|
||||
/// Получает UnitInValue (с Value) для заданных UnitId и FieldId.
|
||||
/// </summary>
|
||||
Task<List<UnitInValue>> GetByUnitIdsAndFieldIdsAsync(IEnumerable<Guid> unitIds, IEnumerable<Guid> fieldIds);
|
||||
|
||||
/// <summary>
|
||||
/// Находит наиболее часто встречающееся непустое значение указанного поля среди переданных юнитов.
|
||||
/// </summary>
|
||||
/// <param name="unitIds">Список Id юнитов для анализа.</param>
|
||||
/// <param name="fieldName">Имя поля (AihitName) для поиска значения.</param>
|
||||
/// <returns>Наиболее частое значение поля или null, если не найдено.</returns>
|
||||
Task<string?> GetMostFrequentValueForFieldAsync(List<Guid> unitIds, string fieldName);
|
||||
|
||||
IQueryable<UnitInValue> Get();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using PARR.Domain.Entities.Unit;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces.Unit
|
||||
{
|
||||
public interface IUnitKiiUnitRepository
|
||||
{
|
||||
IQueryable<UnitKiiUnit> Get();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using PARR.Domain.Entities.Unit;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces.Unit
|
||||
{
|
||||
public interface IUnitRegionalEkPtkGroupRepository
|
||||
{
|
||||
IQueryable<UnitRegionalEkPtkGroup> Get();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using PARR.Core.Repositories.Base;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces.Unit
|
||||
{
|
||||
public interface IUnitRepository : IBaseRepository<Domain.Entities.Unit.Unit>
|
||||
{
|
||||
IQueryable<Domain.Entities.Unit.Unit> GetWithIncludes();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user