import { cartItemTypes } from "@/constants/cart-item-types";

export const payWithInsuranceStates = ["AZ", "CT", "FL", "KY", "MA", "MN", "NY", "SC"];

export const cartItemTypesCoveredByInsurance = [
    cartItemTypes.GLASS_PARTS,
    cartItemTypes.SUPPORTING_ITEMS,
    cartItemTypes.RECYCLE_FEE,
    cartItemTypes.REPLACE_FEE,
    cartItemTypes.SUPPLIES_REPAIR,
];

export const coverageStatus = {
    PENDING: "Pending",
    NOCOMP: "NoComp",
    VERIFIED: "Verified",
};

export function coverageStatusValue(intCoverageStatus) {
    switch (intCoverageStatus) {
        case 0:
            return coverageStatus.PENDING;
        case 1:
            return coverageStatus.NOCOMP;
        case 2:
            return coverageStatus.VERIFIED;
        default:
            return null;
    }
}

export function coverageStatusEnum(strCoverageStatus) {
    switch (strCoverageStatus) {
        case coverageStatus.PENDING:
            return 0;
        case coverageStatus.NOCOMP:
            return 1;
        case coverageStatus.VERIFIED:
            return 2;
        default:
            return null;
    }
}

export const coverageType = {
    NONE: "None",
    DEDUCTIBLE: "Deductible",
    ITAC: "Itac",
    NOCOMP: "NoComp",
};

export function coverageTypeValue(intCoverageType) {
    switch (intCoverageType) {
        case 0:
            return coverageType.NONE;
        case 1:
            return coverageType.DEDUCTIBLE;
        case 2:
            return coverageType.ITAC;
        case 3:
            return coverageType.NOCOMP;
        default:
            return null;
    }
}

export function coverageTypeEnum(strCoverageType) {
    switch (strCoverageType) {
        case coverageType.NONE:
            return 0;
        case coverageType.DEDUCTIBLE:
            return 1;
        case coverageType.ITAC:
            return 2;
        case coverageType.NOCOMP:
            return 3;
        default:
            return null;
    }
}
