IAuthScopeAppService.cs 1.32 KB
using FoodLabeling.Application.Contracts.Dtos.AuthScope;
using Volo.Abp.Application.Services;

namespace FoodLabeling.Application.Contracts.IServices;

/// <summary>
/// 登录后按 Company → Region → Location 级联选店(管理员全量;其它角色按 <c>userlocation</c> 数据范围)。
/// </summary>
public interface IAuthScopeAppService : IApplicationService
{
    /// <summary>
    /// 可选公司列表(UI Company)。
    /// </summary>
    Task<List<AuthScopeCompanyOptionDto>> GetCompaniesAsync();

    /// <summary>
    /// 指定公司下的 Region 列表。
    /// </summary>
    Task<List<AuthScopeRegionOptionDto>> GetRegionsAsync(string partnerId);

    /// <summary>
    /// 指定公司与 Region 下的门店列表。
    /// </summary>
    Task<List<AuthScopeLocationOptionDto>> GetLocationsAsync(string partnerId, string groupId);

    /// <summary>
    /// 确认当前工作门店;管理员写入工作范围缓存,后续 App <c>my-locations</c> 与门店详情校验与绑定账号一致。
    /// </summary>
    Task<AuthScopeSelectLocationOutputDto> SelectLocationAsync(AuthScopeSelectLocationInputVo input);

    /// <summary>
    /// 获取当前已确认的工作门店(未选店时返回 <c>null</c>)。
    /// </summary>
    Task<AuthScopeSelectLocationOutputDto?> GetCurrentScopeAsync();
}