using Microsoft.AspNetCore.Identity;

using Fengling.Platform.Domain.AggregatesModel.GatewayAggregate;

namespace Fengling.Platform.Infrastructure;

/// <summary>
/// 路由存储接口
/// </summary>
public interface IRouteStore
{
    Task<GwTenantRoute?> FindByIdAsync(long? id, CancellationToken cancellationToken = default);
    Task<GwTenantRoute?> FindByTenantCodeAsync(string tenantCode, CancellationToken cancellationToken = default);
    Task<GwTenantRoute?> FindByClusterIdAsync(string clusterId, CancellationToken cancellationToken = default);
    Task<IList<GwTenantRoute>> GetAllAsync(CancellationToken cancellationToken = default);
    Task<IList<GwTenantRoute>> GetPagedAsync(int page, int pageSize, string? tenantCode = null, 
        string? serviceName = null, RouteStatus? status = null, CancellationToken cancellationToken = default);
    Task<int> GetCountAsync(string? tenantCode = null, string? serviceName = null, 
        RouteStatus? status = null, CancellationToken cancellationToken = default);
    Task<IdentityResult> CreateAsync(GwTenantRoute route, CancellationToken cancellationToken = default);
    Task<IdentityResult> UpdateAsync(GwTenantRoute route, CancellationToken cancellationToken = default);
    Task<IdentityResult> DeleteAsync(GwTenantRoute route, CancellationToken cancellationToken = default);
}
