package jnpf.authority.service;

import jnpf.authority.utils.PermissionsApplicableObject;
import jnpf.permission.dto.v2.organzie.QueryOrganizeNodeDTO;
import jnpf.permission.eum.v2.OrganizeCategoryEnums;
import jnpf.permission.eum.v2.UserWorkStatusEnums;
import jnpf.permission.vo.store.StoreBaseListInfo;
import jnpf.permission.vo.v2.TargetAuthIdsVO;
import jnpf.permission.vo.v2.organzie.OrganizeGeneralDetailVO;
import jnpf.permission.vo.v2.organzie.OrganizeManagerFilterNodeVO;
import jnpf.permission.vo.v2.organzie.OrganizeManagerNodeVO;

import java.util.List;
import java.util.Map;

/**
 * 加入权限的组织查询功能
 *
 * @author Flynn Chan
 * @create 2025-05-06
 */
public interface FtbPermissionOrganizeService {

    List<OrganizeManagerNodeVO> allOrganizeUsersTree(QueryOrganizeNodeDTO dto);

    /**
     * 人员权限过滤后的组织(公司,部门,门店,班主),人员
     *
     * @return
     */
    List<OrganizeManagerNodeVO> listOrganizeTreeUsers(List<OrganizeCategoryEnums> organizeCategoryEnums, List<UserWorkStatusEnums> workStatusEnums, String organizeKeyword, Boolean withEmployee, Boolean includeResigned);

    List<OrganizeManagerFilterNodeVO> listOrganizeTreeUsersFilterNodeJson(List<OrganizeCategoryEnums> organizeCategoryEnums,
                                                                          List<UserWorkStatusEnums> workStatusEnums,
                                                                          Boolean withEmployee,
                                                                          Boolean filterBindOtherStore,
                                                                          Boolean filterBindPayStore
    );

    /**
     * 人员权限过滤后的组织列表
     *
     * @return
     */
    List<OrganizeGeneralDetailVO> authOrganizesByUserBound(List<OrganizeCategoryEnums> organizeCategoryEnums,
                                                           String organizeKeyword,
                                                           Boolean filterBindOtherStore,
                                                           Boolean filterBindPayStore
    );

    /**
     * 批量用户有权限的门店
     *
     * @param userIds 用户ids
     * @param status  状态 1：禁用 0：启用 -1-所有
     * @return
     */
    Map<String, List<String>> batchAuthOrganizesForUserIds(List<String> userIds, Integer status);

    Map<String, List<String>> batchAuthOrganizesAllForUserIdsAndTenantId(List<String> userIds, Integer status, String moduleId, String tenantId);

    /**
     * 获取门店基础信息列表auth api
     *
     * @return
     */
    List<StoreBaseListInfo> authStoreBaseListInfo();

    /**
     * 批量用户有权限的门店
     *
     * @param userIds 用户ids
     * @param status  状态 1：禁用 0：启用 -1-所有
     * @param moduleId 模块id
     * @param tenantId 租户id
     * @return
     */
    Map<String, List<String>> batchAuthOrganizesForUserIdsAndTenantId(List<String> userIds, Integer status,String moduleId, String tenantId);

    Map<String, PermissionsApplicableObject> batchAuthOrganizesAllForUserIds(List<String> userIds);

    /**
     * 获取用户权限
     * @return jnpf.permission.vo.v2.TargetAuthIdsVO
     */
    TargetAuthIdsVO getUserAuth();
}
