package cn.iocoder.lyzsys.module.tjt.enums;

/**
 * 合约规划业务类型常量。
 *
 * <p>数据库存储稳定 code，页面和 Excel 按 label 展示。</p>
 *
 * @author Codex
 */
public final class ProjectPlanningBizTypeConstants {

    public static final String OWNERSHIP_TYPE_MAJOR = ProjectPlanningOwnershipTypeEnum.MAJOR.getCode();
    public static final String OWNERSHIP_TYPE_COMPREHENSIVE = ProjectPlanningOwnershipTypeEnum.COMPREHENSIVE.getCode();
    public static final String OWNERSHIP_TYPE_SPECIAL_SUBCONTRACT =
            ProjectPlanningOwnershipTypeEnum.SPECIAL_SUBCONTRACT_MAJOR.getCode();
    public static final String OWNERSHIP_TYPE_SOURCE_COOP_SUBCONTRACT =
            ProjectPlanningOwnershipTypeEnum.SPECIAL_SUBCONTRACT_SOURCE_COOP.getCode();
    public static final String OWNERSHIP_TYPE_COMPREHENSIVE_SUBCONTRACT =
            ProjectPlanningOwnershipTypeEnum.SPECIAL_SUBCONTRACT_COMPREHENSIVE.getCode();

    public static final String DESIGN_PART_REAL_ESTATE = ProjectPlanningDesignPartEnum.ABOVE_GROUND.getCode();
    public static final String DESIGN_PART_UNDERGROUND = ProjectPlanningDesignPartEnum.UNDERGROUND.getCode();
    public static final String DESIGN_PART_OTHER = ProjectPlanningDesignPartEnum.OTHER.getCode();

    public static final String CALCULATION_METHOD_GUIDANCE_PRICE =
            ProjectPlanningCalculationMethodEnum.GUIDANCE_PRICE.getCode();
    public static final String CALCULATION_METHOD_CONTRACT_PRICE =
            ProjectPlanningCalculationMethodEnum.CONTRACT_PRICE.getCode();
    public static final String CALCULATION_METHOD_VIRTUAL_OUTPUT =
            ProjectPlanningCalculationMethodEnum.VIRTUAL_OUTPUT.getCode();

    public static final String VIRTUAL_CALCULATION_METHOD_GUIDANCE_PRICE =
            ProjectPlanningVirtualCalculationMethodEnum.GUIDANCE_PRICE.getCode();
    public static final String VIRTUAL_CALCULATION_METHOD_GUIDANCE_TOTAL_PRICE =
            ProjectPlanningVirtualCalculationMethodEnum.GUIDANCE_TOTAL_PRICE.getCode();
    public static final String VIRTUAL_CALCULATION_METHOD_WORKING_DAY =
            ProjectPlanningVirtualCalculationMethodEnum.WORKING_DAY.getCode();

    private ProjectPlanningBizTypeConstants() {
    }

    public static boolean isValidOwnershipType(String value) {
        return ProjectPlanningOwnershipTypeEnum.contains(value);
    }

    public static boolean isValidCalculationMethod(String value) {
        return ProjectPlanningCalculationMethodEnum.contains(value);
    }

    public static boolean isValidDesignStage(String value) {
        return ProjectPlanningDesignStageEnum.contains(value);
    }

    public static boolean isValidDesignPart(String value) {
        return ProjectPlanningDesignPartEnum.contains(value);
    }

    public static boolean isValidVirtualCalculationMethod(String value) {
        return ProjectPlanningVirtualCalculationMethodEnum.contains(value);
    }

    public static boolean isMajor(String value) {
        return OWNERSHIP_TYPE_MAJOR.equals(value);
    }

    public static boolean isComprehensive(String value) {
        return OWNERSHIP_TYPE_COMPREHENSIVE.equals(value);
    }

    public static boolean isSubcontract(String value) {
        return isSpecialSubcontract(value) || isSourceCoopSubcontract(value) || isComprehensiveSubcontract(value);
    }

    public static boolean isSpecialSubcontract(String value) {
        return OWNERSHIP_TYPE_SPECIAL_SUBCONTRACT.equals(value);
    }

    public static boolean isSourceCoopSubcontract(String value) {
        return OWNERSHIP_TYPE_SOURCE_COOP_SUBCONTRACT.equals(value);
    }

    public static boolean isComprehensiveSubcontract(String value) {
        return OWNERSHIP_TYPE_COMPREHENSIVE_SUBCONTRACT.equals(value);
    }

    public static boolean isGuidancePrice(String value) {
        return CALCULATION_METHOD_GUIDANCE_PRICE.equals(value);
    }

    public static boolean isMajorGuidanceScene(String ownershipType, String calculationMethod) {
        return isMajor(ownershipType) && isGuidancePrice(calculationMethod);
    }

    public static boolean isContractPrice(String value) {
        return CALCULATION_METHOD_CONTRACT_PRICE.equals(value);
    }

    public static boolean isVirtualOutput(String value) {
        return CALCULATION_METHOD_VIRTUAL_OUTPUT.equals(value);
    }

    public static boolean isWorkingDay(String value) {
        return VIRTUAL_CALCULATION_METHOD_WORKING_DAY.equals(value);
    }

    public static boolean isVirtualGuidancePrice(String value) {
        return VIRTUAL_CALCULATION_METHOD_GUIDANCE_PRICE.equals(value);
    }

    public static boolean isVirtualGuidanceTotalPrice(String value) {
        return VIRTUAL_CALCULATION_METHOD_GUIDANCE_TOTAL_PRICE.equals(value);
    }

    public static String getOwnershipTypeLabel(String value) {
        return ProjectPlanningOwnershipTypeEnum.labelOf(value);
    }

    public static String getCalculationMethodLabel(String value) {
        return ProjectPlanningCalculationMethodEnum.labelOf(value);
    }

    public static String getDesignStageLabel(String value) {
        return ProjectPlanningDesignStageEnum.labelOf(value);
    }

    public static String getDesignPartLabel(String value) {
        return ProjectPlanningDesignPartEnum.labelOf(value);
    }

    public static String getVirtualCalculationMethodLabel(String value) {
        return ProjectPlanningVirtualCalculationMethodEnum.labelOf(value);
    }

}
