package com.oqpo.api.enums;

import lombok.Getter;

@Getter
public enum PmtMethod {
    CARD("CD", "카드"),
    CASH("CS", "현금");

    private String id;
    private String message;

    PmtMethod(String id, String message) {
        this.id = id;
        this.message = message;
    }

    public static String getId(String message) {
        PmtMethod[] list = PmtMethod.values();
        for (PmtMethod item : list) {
            if (item.message.equals(message)) {
                return item.id;
            }
        }
        return null;
    }

    public static String getMessage(String id) {
        PmtMethod[] list = PmtMethod.values();
        for (PmtMethod item : list) {
            if (item.id.equals(id)) {
                return item.message;
            }
        }
        return null;
    }
}
