package com.loan.system.domain.enums;

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

/**
 * 针对特殊环节的标识设置
 * @author : EdwinXu
 * @date : Created in 2021/1/25 16:57
 */
public enum StepPropertyEnum {
    /* ========== 环节定义 ========== */
    BUSINESS_ACCEPT_PARENT(501, "业务受理环节", true),
    BUSINESS_ACCEPT(502, "业务受理", false),

    PRE_TRIAL_PARENT(503, "预审环节", true),
    PRE_TRIAL(504, "预审", false),

    APPROVAL_PARENT(505, "审批环节", true),
    APPROVAL(506, "审批", false),

    CONTRACT_SIGN_PARENT(507, "合同签约环节", true),
    CONTRACT_SIGN(508, "合同签约", false),

    DISBURSE_PARENT(509, "出款环节", true),
    PLAN_REPORT(510, "计划上报", false),
    PLAN_AUDIT(511, "计划审核", false),
    DISBURSE_START(512, "出账启动", false),
    DISBURSE_AUDIT(513, "出账审核", false),
    FINANCE_DISBURSE(514, "财务出账", false),
    DISBURSE_CONFIRM(515, "出账确认", false),

    REPAY_PARENT(516, "回款环节", true),
    REPAY_START(517, "回款启动", false),
    REPAY_APPROVAL(518, "回款审批", false),
    FINANCE_CHECK(519, "财务核算", false),

    COLLATERAL_RECEIVE(520, "押品取证环节", true),
    PLAN_SUBMISSION(521, "计划上报", false),
    APPROVAL_ASSIGNMENT(522, "审批分派", false),
    EVIDENCE_CONFIRMATION(523, "确认取证", false),

    COLLATERAL_DELIVERY(524, "押品送证环节", true),
    PLAN_SUBMISSION_2(525, "计划上报", false),
    APPROVAL_ASSIGNMENT_2(526, "审批分派", false),
    DELIVERY_CONFIRMATION(527, "送证确认", false);

    /* ========== 字段 & 构造 ========== */
    private final int code;
    private final String label;
    private final boolean parent;

    StepPropertyEnum(int code, String label, boolean parent) {
        this.code = code;
        this.label = label;
        this.parent = parent;
    }

    /* ========== getter ========== */
    public int getCode() { return code; }
    public String getLabel() { return label; }
    public boolean isParent() { return parent; }

    public static List<StepPropertyEnum> listAll() {
        return Arrays.asList(values()); // 顺序与源码声明一致
    }

}
