namespace Meezi.API.Security;

public static class PublicWriteStatusCodes
{
    public static int ToHttpStatus(string? code) => code switch
    {
        "PLAN_LIMIT_REACHED" or "CAFE_SUSPENDED" => StatusCodes.Status403Forbidden,
        "RATE_LIMITED" => StatusCodes.Status429TooManyRequests,
        "CAPTCHA_REQUIRED" or "CAPTCHA_INVALID" or "CAPTCHA_ERROR" => StatusCodes.Status400BadRequest,
        "NOT_FOUND" => StatusCodes.Status404NotFound,
        _ => StatusCodes.Status400BadRequest
    };
}
