namespace Application.Features.Api.Studio.Helpers;

public static class PeriodHelper
{
    public static (DateTime Start, DateTime End) GetRange(string? period)
    {
        var now = DateTime.UtcNow;
        var end = now;

        var start = period switch
        {
            "today" => now.Date,
            "week" => now.AddDays(-7),
            "month" => now.AddMonths(-1),
            "quarter" => now.AddMonths(-3),
            "half" => now.AddMonths(-6),
            _ => now.AddMonths(-1)
        };

        return (start, end);
    }
}