package com.wzj.soopin.transaction.enums.easypay;

import java.io.IOException;

/**
 * 结算周期
 */
public enum BillingCycle {

    D0, D1, DD, T1;

    public String toValue() {
        return switch (this) {
            case D0 -> "D0";
            case D1 -> "D1";
            case DD -> "DD";
            case T1 -> "T1";
        };
    }

    public static BillingCycle forValue(String value) throws IOException {
        return switch (value) {
            case "D0" -> D0;
            case "D1" -> D1;
            case "DD" -> DD;
            case "T1" -> T1;
            default -> throw new IOException("Cannot deserialize BillingCycle");
        };
    }
}
