namespace Common.Constant;

public static class CommonConstant
{
    public const string ShowResult = "1";
    public const string NextQuestion = "2";

    public const string Success = "0";
    public const string Error = "-1";
    public const string WrongAnswer = "-7";

    public const string LoginFails = "-2";
    public const string MsisdnInvalid = "-3";
    public const string TransactionInvalid = "-4";
    public const string NoTimeLeftToSendOtp = "-5";
    public const string NeedLogin = "-7";
    public const string NextQuestionFail = "-8";
    public const string OtpWrong = "-9";

    public const string Unauthorized = "-401";
    public const string BadRequest = "-402";

    public const string DateTimeFormat = "dd/MM/yyyy HH:mm:ss";

    public const int PageNumber = 10;
    public const string NoQuestionExisted = "-6";

    public const string ANSWER_RIGHT = "RIGHT";
    public const string ANSWER_WRONG = "WRONG";

    public const String PathImage = "/outside";

    public const String MissitonTypeLOGIN = "LOGIN";
    public const String MissitonTypeREGISTER = "REGISTER";
    public const String MissitonTypeREGISTERS = "REGISTERS";
    public const String MissitonTypeINVITING = "INVITING";

    public const int StatusActive = 1;
    public const int StatusInactive = 0;
    public const int StatusNotClaimed = 2;
    public const int StatusClaimed = 3;

    public const int StatusPending = 100;
    public const int StatusSuccess = 0;
    public const int StatusFailed = -1;
    public const int UserNotRegistered = 0;
    public const int UserRegistered = 1;

    public const string Waiting = "WAITING";
    public const int Request = 1;
    public const int Response = 2;

    public const string TypeRegisterService = "REGISTER";
    public const string TypeLogin = "LOGIN";
    public const string TypeInviting = "INVITING";
    public const string TypeRenewService = "RENEW";

    public const string PathOutside = "PathOutside";

    public const string CheckSub = "CHECKSUB";
    public const string Subscribe = "SUBSCRIBE";

    public static readonly List<int> ListStatusInt = new List<int> { StatusActive, StatusInactive };
    public static readonly List<string> ListCampaignType = new List<string> { "EU" };
    public static readonly List<string> ListMissionType = new List<string>
    {
        "REGISTER",
        "RENEW",
        "LOGIN",
        "INVITING"
    };

    public static readonly List<string> ListServiceType = new List<string> { "NORMAL", };
    public static readonly List<string> ListServiceActionType = new List<string> { "REQUEST", };
    public static readonly List<string> ListServiceActionMethod = new List<string>
    {
        "SOAP",
        "REST_POST",
        "REST_GET"
    };
    public static readonly List<string> ListServiceActionCode = new List<string>
    {
        "REGISTER",
        "BUY_TURN",
    };

    public static readonly List<string> ListVendorPackagePeriod = new List<string>
    {
        "DAILY",
        "WEEKLY",
        "MONTHLY"
    };

    public static readonly List<string> ListVendorPackageType = new List<string>
    {
        "NORMAL",
        "PREMIUM",
        "VIP"
    };

    public static readonly List<string> ListMoneyType = new List<string> { "CENT", "USD", "EUR" };

    public static readonly List<string> ListPrizeType = new List<string> { "POINT", "MONEY" };

    public const string DateTimeFormar1 = "dd/MM/yyyy HH:mm:ss";
    public const string DateTimeFormar2 = "MMMM yyyy";
    public const string DateTimeFormar3 = "dd/MM";
    public const string DateTimeFormar4 = "HH:mm";
    public const string DateTimeFormar7 = "dd/MM/yyyy HH:mm";

    public const string DateTimeFormar5 = "yyyy-MM-dd";
    public const string DateTimeFormar6 = "yyyyMMddHHmmss";
    public const string DateTimeFormar8 = "yyyy-MM-ddTHH:mm:ss";
    public const string DateTimeFormar9 = "yyyy-MM-ddTHH:mm";
    public const string DateTimeFormar10 = "yyyy_MM_dd";
    public const string DateTimeFormar11 = "yyyy_MM";
    public const string DateTimeFormar12 = "dd/MM/yyyy";
    public const string DateTimeFormar13 = "dd/MM/yyyy HH:mm:ss";
    public const string DateTimeFormar14 = "d/M/yyyy HH:mm:sstt";
    public const string DateTimeFormar15 = "d/MM/yyyy HH:mm:sstt";
    public const string DateTimeFormar16 = "dd/MM/yyyy HH:mm:sstt";

    public static readonly string[] ListDateTimeFormat =
    {
        DateTimeFormar1,
        DateTimeFormar2,
        DateTimeFormar3,
        DateTimeFormar4,
        DateTimeFormar5,
        DateTimeFormar6,
        DateTimeFormar7,
        DateTimeFormar8,
        DateTimeFormar9,
        DateTimeFormar10,
        DateTimeFormar11,
        DateTimeFormar12,
        DateTimeFormar13,
        DateTimeFormar14,
        DateTimeFormar15,
        DateTimeFormar16
    };
}

public static class ApiUrlConstant
{
    // Auth URLs
    public const String RequestOtpUrl = "/apis/auth/request-otp";
    public const String VerifyOtpUrl = "/apis/auth/verify-otp";
    public const String ResendOtpUrl = "/apis/auth/resend-otp";
    public const String GoogleLoginUrl = "/apis/auth/google-login";
    public const String GoogleCallbackUrl = "/apis/auth/google-callback";
    public const String PartnerLoginUrl = "/apis/auth/partner-login";

    // Article URLs
    public const String ArticleCategoryUrl = "/apis/article/category";
    public const String ArticleLoadUrl = "/apis/article/load";
    public const String ArticleDetailUrl = "/apis/article/detail";

    // Content URLs
    public const String BannerLoadUrl = "/apis/content/banner";
    public const String CustomerReviewLoadUrl = "/apis/content/review";
    public const String CustomerReviewCreateUrl = "/apis/content/review/create";
    public const String FaqCategoryLoadUrl = "/apis/content/faq-category";
    public const String FaqLoadUrl = "/apis/content/faq";
    public const String DeviceCompatibilityLoadUrl = "/apis/content/device-compatibility";
    public const String DeviceMetadataUrl = "/apis/content/device-metadata";
}

public static class CommonErrorCode
{
    // ============================================
    // SUCCESS CODES (0 - 99)
    // ============================================
    public const string Success = "0";
    public const string LoginCompleted = "1";
    public const string RegistrationCompleted = "2";
    public const string OtpSentSuccessfully = "3";
    public const string OtpVerifiedSuccessfully = "4";
    public const string EmailSentSuccessfully = "5";

    // ============================================
    // GENERAL ERRORS (-1 to -99)
    // ============================================
    public const string Error = "-1";
    public const string InvalidRequest = "-2";
    public const string InvalidParameter = "-3";
    public const string DataNotFound = "-4";
    public const string DatabaseError = "-5";
    public const string SystemError = "-6";
    public const string ServiceUnavailable = "-7";
    public const string RateLimitExceeded = "-8";
    public const string OperationFailed = "-9";

    // ============================================
    // AUTHENTICATION ERRORS (-100 to -199)
    // ============================================
    public const string LoginFails = "-100";
    public const string LoginRequired = "-101";
    public const string SessionExpired = "-102";
    public const string InvalidCredentials = "-103";
    public const string AccountLocked = "-104";
    public const string AccountDisabled = "-105";
    public const string TokenExpired = "-106";
    public const string TokenInvalid = "-107";
    public const string RefreshTokenExpired = "-108";
    public const string RefreshTokenInvalid = "-109";
    public const string UnauthorizedAccess = "-110";
    public const string PermissionDenied = "-111";

    // ============================================
    // OTP ERRORS (-200 to -299)
    // ============================================
    public const string OtpRequired = "-200";
    public const string OtpInvalid = "-201";
    public const string OtpExpired = "-202";
    public const string OtpAlreadyUsed = "-203";
    public const string OtpMaxAttemptsExceeded = "-204";
    public const string OtpSendFailed = "-205";
    public const string OtpTooManyRequests = "-206";
    public const string OtpNotFound = "-207";
    public const string OtpNotRequested = "-208"; // User hasn't requested OTP yet (for resend scenario)

    // ============================================
    // USER/CUSTOMER ERRORS (-300 to -399)
    // ============================================
    public const string UserNotFound = "-300";
    public const string UserAlreadyExists = "-301";
    public const string UserNotVerified = "-302";
    public const string UserDisabled = "-303";
    public const string InvalidEmail = "-304";
    public const string InvalidPhone = "-305";
    public const string ProfileUpdateFailed = "-306";
    public const string PasswordTooWeak = "-307";
    public const string PasswordMismatch = "-308";

    // ============================================
    // EMAIL ERRORS (-400 to -499)
    // ============================================
    public const string EmailNotConfigured = "-400";
    public const string EmailSendFailed = "-401";
    public const string EmailTemplateNotFound = "-402";
    public const string EmailInvalidRecipient = "-403";
    public const string EmailQueueFailed = "-404";
    public const string SmtpConnectionFailed = "-405";

    // ============================================
    // CAMPAIGN/MISSION ERRORS (-500 to -599)
    // ============================================
    public const string NoCampaignAvailable = "-500";
    public const string CampaignExpired = "-501";
    public const string CampaignNotStarted = "-502";
    public const string MissionCompleted = "-503";
    public const string MissionNotFound = "-504";
    public const string NeedCompleteQuest = "-505";
    public const string PrizeAlreadyClaimed = "-506";
    public const string PrizeClaimFailed = "-507";

    // ============================================
    // PACKAGE/SUBSCRIPTION ERRORS (-600 to -699)
    // ============================================
    public const string VendorPackageRequired = "-600";
    public const string PackageNotFound = "-601";
    public const string PackageExpired = "-602";
    public const string PackageAlreadyActive = "-603";
    public const string InsufficientBalance = "-604";
    public const string PaymentFailed = "-605";
    public const string SubscriptionFailed = "-606";

    // ============================================
    // EXTERNAL SERVICE ERRORS (-700 to -799)
    // ============================================
    public const string ExternalServiceError = "-700";
    public const string ExternalServiceTimeout = "-701";
    public const string ExternalServiceUnavailable = "-702";
    public const string MpsRegistered = "-703";
    public const string MpsError = "-704";
    public const string SmsGatewayError = "-705";

    // ============================================
    // VALIDATION ERRORS (-800 to -899)
    // ============================================
    public const string ValidationFailed = "-800";
    public const string RequiredFieldMissing = "-801";
    public const string InvalidFormat = "-802";
    public const string ValueOutOfRange = "-803";
    public const string DuplicateEntry = "-804";

    // Prize Types (kept for backward compatibility)
    public static readonly List<string> ListPrizeType = new List<string> { "POINT", "MONEY" };
}
