package com.brilliance.isc.common.pinz.vo;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum PinzType {
    TRAN_DEB_A("A","转账借方传票"),
    TRAN_CDT_B("B","转账贷方传票"),
    DEB_CP_C("C","借方传票"),
    CDT_CP_E("E","贷方传票"),
    USD_DEB_G("G","外汇买卖借方传票(外币)"),
    USD_DEB_I("I","外汇买卖贷方传票(外币)"),
    USD_DEB_L("L","售汇水单"),
    CNY_DEB_J("J","外汇买卖借方传票(人民币)"),
    CNY_DEB_H("H","外汇买卖贷方传票(人民币)"),
    CNY_DEB_K("K","结汇水单"),
    QIN_DEB_M("M","国结专户借方传票"),
    QIN_INN_N("N","国结专户贷方传票"),
    CP_DEB_O("O","汇入未达借方传票/暂收待付借方传票"),
    CP_DEB_P("P","汇入未达借方传票/暂收待付借方传票"),
    USD_DEB_R("R","外汇买卖借方传票(外币二)"),
    USD_DEB_S("S","外汇买卖借方传票(外币二)"),
    PAYOUT_TZ_D("D","付账通知"),
    PAYIN_TZ_F("F","收账通知"),
    YSP_JH("YspJH","即期结汇外汇买卖传票"),
    YSP_SH("YspSH","即期售汇外汇买卖传票"),
    JSTOPT_ZSS("JstZSS","T+1/T+2即期结售汇业务交易证实书");

    private final String value;
    private final String name;

    public static String getNameByValue(String value){
        for (PinzType s : PinzType.values()) {
            if (Objects.equals(s.getValue(), value)) {
                return s.getName();
            }
        }
        return "";
    }

}
