package com.jeesharp.business.modules.food.enums;

import com.jeesharp.business.modules.common.enums.VerticalPayStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 美食团购支付状态，与 {@code app_food_booking_order.pay_status} 存储值一致。
 *
 * @author jeesharp
 * @since 2026-06-09
 * @deprecated 使用 {@link VerticalPayStatusEnum}
 */
@Deprecated
@Getter
@AllArgsConstructor
public enum FoodPayStatusEnum {

    UNPAID(VerticalPayStatusEnum.UNPAID.getValue(), VerticalPayStatusEnum.UNPAID.getDesc()),
    PREPARING(VerticalPayStatusEnum.PREPARING.getValue(), VerticalPayStatusEnum.PREPARING.getDesc()),
    PAID(VerticalPayStatusEnum.PAID.getValue(), VerticalPayStatusEnum.PAID.getDesc()),
    CLOSED(VerticalPayStatusEnum.CLOSED.getValue(), VerticalPayStatusEnum.CLOSED.getDesc());

    private final String value;
    private final String desc;

    public static FoodPayStatusEnum fromValue(String value) {
        VerticalPayStatusEnum item = VerticalPayStatusEnum.fromValue(value);
        if (item == null) {
            return null;
        }
        return switch (item) {
            case UNPAID -> UNPAID;
            case PREPARING -> PREPARING;
            case PAID -> PAID;
            case CLOSED -> CLOSED;
        };
    }

    public static String getDescByValue(String value) {
        return VerticalPayStatusEnum.getDescByValue(value);
    }
}
