package com.czg.account.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;
import java.util.List;

/**
 * 交班账户类型
 *
 * @author tankaikai
 * @since 2025-02-27 14:39
 */
@Getter
@RequiredArgsConstructor
public enum HandoverAccountTypeEnum {
    /**
     * 商户
     */
    MERCHANT("merchant", "商户"),

    /**
     * 员工
     */
    STAFF("staff", "员工");

    private final String value;
    private final String text;


    public static List<String> getValues() {
        return Arrays.stream(values()).map(HandoverAccountTypeEnum::getValue).toList();
    }

    public static String getText(String value) {
        HandoverAccountTypeEnum item = Arrays.stream(values()).filter(obj -> value.equals(obj.getValue())).findFirst().orElse(null);
        if (item != null) {
            return item.getText();
        }
        return null;
    }
}
