Files
parr_api/PARR.DAL/Services/Interfaces/Unit/IUnitInValueService.cs

29 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using PARR.DAL.Models.Unit;
namespace PARR.DAL.Services.Interfaces.Unit
{
public interface IUnitInValueService
{
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();
}
}