package com.jeesharp.business.modules.finance.platformrevenue.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 平台收入汇总周期类型枚举。
 *
 * @author jeesharp
 * @since 2026-06-29
 */
@Getter
@AllArgsConstructor
public enum PlatformRevenuePeriodTypeEnum {

    DAY("DAY", "按日"),
    MONTH("MONTH", "按月");

    private final String value;

    private final String desc;

    public static PlatformRevenuePeriodTypeEnum fromValue(String value) {
        if (value == null) {
            return DAY;
        }
        for (PlatformRevenuePeriodTypeEnum item : values()) {
            if (item.getValue().equalsIgnoreCase(value.trim())) {
                return item;
            }
        }
        return DAY;
    }
}
