SPMS_API/SPMS.Domain/Interfaces/IDeviceRepository.cs

26 lines
1.2 KiB
C#

using SPMS.Domain.Entities;
using SPMS.Domain.Enums;
namespace SPMS.Domain.Interfaces;
public interface IDeviceRepository : IRepository<Device>
{
Task<Device?> GetByServiceAndTokenAsync(long serviceId, string deviceToken);
Task<Device?> GetByIdAndServiceAsync(long id, long serviceId);
Task<Device?> GetByExternalIdAndServiceAsync(string externalId, long serviceId);
Task<int> GetActiveCountByServiceAsync(long serviceId);
Task<IReadOnlyList<Device>> GetByPlatformAsync(long serviceId, Platform platform);
Task<(IReadOnlyList<Device> Items, int TotalCount)> GetPagedAsync(
long? serviceId, int page, int size,
Platform? platform = null, bool? pushAgreed = null,
bool? isActive = null, List<long>? tagIds = null,
string? keyword = null, bool? marketingAgreed = null);
Task<IReadOnlyList<Device>> GetAllFilteredAsync(
long? serviceId,
Platform? platform = null, bool? pushAgreed = null,
bool? isActive = null, List<long>? tagIds = null,
string? keyword = null, bool? marketingAgreed = null);
Task<Dictionary<long, int>> GetDeviceCountsByTagIdsAsync(IEnumerable<long> tagIds);
Task<IReadOnlyList<Device>> GetDevicesByTagIdAsync(long tagId);
}