package com.pj.constants;

import com.pj.current.satoken.AuthConst;
import com.pj.project.tb_business.TbBusiness;
import com.pj.project.tb_costomer.TbCostomer;
import com.pj.project.tb_notices.TbNotices;
import com.pj.project.tb_pass_record.TbPassRecord;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;


@Getter
@AllArgsConstructor
public enum RoleEnum {
    INPUT_ROLE("input","业务录入",
            Arrays.asList(AuthConst.ADMIN_LIST, TbCostomer.PERMISSION_CODE, TbCostomer.PERMISSION_INFO, TbBusiness.PERMISSION_CODE, TbBusiness.PERMISSION_LIST, TbBusiness.PERMISSION_INPUT)),
    CONFIRM_ROLE("confirm","业务确认",
            Arrays.asList(AuthConst.ADMIN_LIST, TbCostomer.PERMISSION_CODE, TbCostomer.PERMISSION_INFO, TbBusiness.PERMISSION_CODE, TbBusiness.PERMISSION_LIST, TbBusiness.PERMISSION_CONFIRM)),
    PAY_ROLE("pay","业务支付",
            Arrays.asList(AuthConst.ADMIN_LIST, TbCostomer.PERMISSION_CODE, TbCostomer.PERMISSION_INFO, TbBusiness.PERMISSION_CODE, TbBusiness.PERMISSION_LIST, TbBusiness.PERMISSION_PAY)),
    ADMIN_ROLE("admin","管理员", Collections.emptyList()),
    SUPER_ROLE("super","超级管理员", Collections.emptyList()),
    COMMON_ROLE_PER("common","共同",Arrays.asList(TbPassRecord.PERMISSION_CODE, TbPassRecord.PERMISSION_LIST, TbNotices.PERMISSION_CODE, TbNotices.PERMISSION_LIST))
    ;
    private String type;
    private String name;
    private List<String>perCode;

    public static List<RoleEnum>getCustomerInitRoleList(){
        return Arrays.asList(INPUT_ROLE,CONFIRM_ROLE, PAY_ROLE);
    }
}
