package com.gxwebsoft.ai.enums;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
@Schema(description = "审计表类型")
public enum AuditMatterTypeEnum {
    EIGHT_REGULATION(1,"eightReg", "八项规定"),
    EXPENSE(1,"expense", "决策支出表"),
    LEADER_LIST(1,"leaderList", "领导班子名单"),
    STRATEGY(2,"strategyAudit", "单位发展战略执行"),
    DECISION_TABLE(3,"decisionTable", "重大经济决策调查表"),
    TRIPLE_ONE(3,"tripleOne", "三重一大"),
    TARGET(4,"target", "目标责任制完成情况表"),
    BUDGET_EXECUTION(5,"budgetExecution", "预算执行情况审计"),
    BUDGET_MANAGE(5,"budgetManage", "预算管理审计"),
    STATE_ASSETS(6,"assets", "国有资产管理审计"),
    INVESTMENT_SITUATION(7,"investmentSituation", "重大投资情况"),
    INTERNAL_CONTROL(8,"internalControl", "内部控制测试表"),
    PERSONNEL_ESTABLISHMENT(9,"personnel", "人员编制管理审计"),
    PARTY_CONDUCT(10,"partyConduct", "党风廉政建设责任制审计"),
    HISTORY(11,"history", "历史审计问题整改");

    private final Integer value;
    private final String code;
    private final String desc;

    public static AuditMatterTypeEnum getByCode(String code) {
        for (AuditMatterTypeEnum type : AuditMatterTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }

    public static AuditMatterTypeEnum getByValue(Integer value) {
        for (AuditMatterTypeEnum type : AuditMatterTypeEnum.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }

    public static AuditMatterTypeEnum getByDesc(String desc) {
        for (AuditMatterTypeEnum type : AuditMatterTypeEnum.values()) {
            if (type.getDesc().equals(desc)) {
                return type;
            }
        }
        return null;
    }
}
