CommonConstant.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. namespace Common.Constant;
  2. public static class CommonConstant
  3. {
  4. public const string ShowResult = "1";
  5. public const string NextQuestion = "2";
  6. public const string Success = "0";
  7. public const string Error = "-1";
  8. public const string WrongAnswer = "-7";
  9. public const string LoginFails = "-2";
  10. public const string MsisdnInvalid = "-3";
  11. public const string TransactionInvalid = "-4";
  12. public const string NoTimeLeftToSendOtp = "-5";
  13. public const string NeedLogin = "-7";
  14. public const string NextQuestionFail = "-8";
  15. public const string OtpWrong = "-9";
  16. public const string Unauthorized = "-401";
  17. public const string BadRequest = "-402";
  18. public const string DateTimeFormat = "dd/MM/yyyy HH:mm:ss";
  19. public const int PageNumber = 10;
  20. public const string NoQuestionExisted = "-6";
  21. public const string ANSWER_RIGHT = "RIGHT";
  22. public const string ANSWER_WRONG = "WRONG";
  23. public const String PathImage = "/outside";
  24. public const String MissitonTypeLOGIN = "LOGIN";
  25. public const String MissitonTypeREGISTER = "REGISTER";
  26. public const String MissitonTypeREGISTERS = "REGISTERS";
  27. public const String MissitonTypeINVITING = "INVITING";
  28. public const int StatusActive = 1;
  29. public const int StatusInactive = 0;
  30. public const int StatusNotClaimed = 2;
  31. public const int StatusClaimed = 3;
  32. public const int StatusPending = 100;
  33. public const int StatusSuccess = 0;
  34. public const int StatusFailed = -1;
  35. public const int UserNotRegistered = 0;
  36. public const int UserRegistered = 1;
  37. public const string Waiting = "WAITING";
  38. public const int Request = 1;
  39. public const int Response = 2;
  40. public const string TypeRegisterService = "REGISTER";
  41. public const string TypeLogin = "LOGIN";
  42. public const string TypeInviting = "INVITING";
  43. public const string TypeRenewService = "RENEW";
  44. public const string PathOutside = "PathOutside";
  45. public const string CheckSub = "CHECKSUB";
  46. public const string Subscribe = "SUBSCRIBE";
  47. public static readonly List<int> ListStatusInt = new List<int> { StatusActive, StatusInactive };
  48. public static readonly List<string> ListCampaignType = new List<string> { "EU" };
  49. public static readonly List<string> ListMissionType = new List<string>
  50. {
  51. "REGISTER",
  52. "RENEW",
  53. "LOGIN",
  54. "INVITING"
  55. };
  56. public static readonly List<string> ListServiceType = new List<string> { "NORMAL", };
  57. public static readonly List<string> ListServiceActionType = new List<string> { "REQUEST", };
  58. public static readonly List<string> ListServiceActionMethod = new List<string>
  59. {
  60. "SOAP",
  61. "REST_POST",
  62. "REST_GET"
  63. };
  64. public static readonly List<string> ListServiceActionCode = new List<string> {
  65. "REGISTER",
  66. "BUY_TURN",
  67. };
  68. public static readonly List<string> ListVendorPackagePeriod = new List<string>
  69. {
  70. "DAILY",
  71. "WEEKLY",
  72. "MONTHLY"
  73. };
  74. public static readonly List<string> ListVendorPackageType = new List<string>
  75. {
  76. "NORMAL",
  77. "PREMIUM",
  78. "VIP"
  79. };
  80. public static readonly List<string> ListMoneyType = new List<string>
  81. {
  82. "CENT",
  83. "USD",
  84. "EUR"
  85. };
  86. public static readonly List<string> ListPrizeType = new List<string>
  87. {
  88. "POINT",
  89. "MONEY"
  90. };
  91. public const string DateTimeFormar1 = "dd/MM/yyyy HH:mm:ss";
  92. public const string DateTimeFormar2 = "MMMM yyyy";
  93. public const string DateTimeFormar3 = "dd/MM";
  94. public const string DateTimeFormar4 = "HH:mm";
  95. public const string DateTimeFormar7 = "dd/MM/yyyy HH:mm";
  96. public const string DateTimeFormar5 = "yyyy-MM-dd";
  97. public const string DateTimeFormar6 = "yyyyMMddHHmmss";
  98. public const string DateTimeFormar8 = "yyyy-MM-ddTHH:mm:ss";
  99. public const string DateTimeFormar9 = "yyyy-MM-ddTHH:mm";
  100. public const string DateTimeFormar10 = "yyyy_MM_dd";
  101. public const string DateTimeFormar11 = "yyyy_MM";
  102. public const string DateTimeFormar12 = "dd/MM/yyyy";
  103. public const string DateTimeFormar13 = "dd/MM/yyyy HH:mm:ss";
  104. public const string DateTimeFormar14 = "d/M/yyyy HH:mm:sstt";
  105. public const string DateTimeFormar15 = "d/MM/yyyy HH:mm:sstt";
  106. public const string DateTimeFormar16 = "dd/MM/yyyy HH:mm:sstt";
  107. public static readonly string[] ListDateTimeFormat =
  108. {
  109. DateTimeFormar1,
  110. DateTimeFormar2,
  111. DateTimeFormar3,
  112. DateTimeFormar4,
  113. DateTimeFormar5,
  114. DateTimeFormar6,
  115. DateTimeFormar7,
  116. DateTimeFormar8,
  117. DateTimeFormar9,
  118. DateTimeFormar10,
  119. DateTimeFormar11,
  120. DateTimeFormar12,
  121. DateTimeFormar13,
  122. DateTimeFormar14,
  123. DateTimeFormar15,
  124. DateTimeFormar16
  125. };
  126. }
  127. public static class ApiUrlConstant
  128. {
  129. // Auth URLs
  130. public const String RequestOtpUrl = "/apis/auth/request-otp";
  131. public const String VerifyOtpUrl = "/apis/auth/verify-otp";
  132. // Article URLs
  133. public const String ArticleCategoryUrl = "/apis/article/category";
  134. public const String ArticleLoadUrl = "/apis/article/load";
  135. // Content URLs
  136. public const String BannerLoadUrl = "/apis/content/banner";
  137. public const String CustomerReviewLoadUrl = "/apis/content/review";
  138. public const String CustomerReviewCreateUrl = "/apis/content/review/create";
  139. public const String FaqCategoryLoadUrl = "/apis/content/faq-category";
  140. public const String FaqLoadUrl = "/apis/content/faq";
  141. public const String DeviceCompatibilityLoadUrl = "/apis/content/device-compatibility";
  142. public const String DeviceMetadataUrl = "/apis/content/device-metadata";
  143. }
  144. public static class CommonErrorCode
  145. {
  146. // ============================================
  147. // SUCCESS CODES (0 - 99)
  148. // ============================================
  149. public const string Success = "0";
  150. public const string LoginCompleted = "1";
  151. public const string RegistrationCompleted = "2";
  152. public const string OtpSentSuccessfully = "3";
  153. public const string OtpVerifiedSuccessfully = "4";
  154. public const string EmailSentSuccessfully = "5";
  155. // ============================================
  156. // GENERAL ERRORS (-1 to -99)
  157. // ============================================
  158. public const string Error = "-1";
  159. public const string InvalidRequest = "-2";
  160. public const string InvalidParameter = "-3";
  161. public const string DataNotFound = "-4";
  162. public const string DatabaseError = "-5";
  163. public const string SystemError = "-6";
  164. public const string ServiceUnavailable = "-7";
  165. public const string RateLimitExceeded = "-8";
  166. public const string OperationFailed = "-9";
  167. // ============================================
  168. // AUTHENTICATION ERRORS (-100 to -199)
  169. // ============================================
  170. public const string LoginFails = "-100";
  171. public const string LoginRequired = "-101";
  172. public const string SessionExpired = "-102";
  173. public const string InvalidCredentials = "-103";
  174. public const string AccountLocked = "-104";
  175. public const string AccountDisabled = "-105";
  176. public const string TokenExpired = "-106";
  177. public const string TokenInvalid = "-107";
  178. public const string RefreshTokenExpired = "-108";
  179. public const string RefreshTokenInvalid = "-109";
  180. public const string UnauthorizedAccess = "-110";
  181. public const string PermissionDenied = "-111";
  182. // ============================================
  183. // OTP ERRORS (-200 to -299)
  184. // ============================================
  185. public const string OtpRequired = "-200";
  186. public const string OtpInvalid = "-201";
  187. public const string OtpExpired = "-202";
  188. public const string OtpAlreadyUsed = "-203";
  189. public const string OtpMaxAttemptsExceeded = "-204";
  190. public const string OtpSendFailed = "-205";
  191. public const string OtpTooManyRequests = "-206";
  192. public const string OtpNotFound = "-207";
  193. // ============================================
  194. // USER/CUSTOMER ERRORS (-300 to -399)
  195. // ============================================
  196. public const string UserNotFound = "-300";
  197. public const string UserAlreadyExists = "-301";
  198. public const string UserNotVerified = "-302";
  199. public const string UserDisabled = "-303";
  200. public const string InvalidEmail = "-304";
  201. public const string InvalidPhone = "-305";
  202. public const string ProfileUpdateFailed = "-306";
  203. public const string PasswordTooWeak = "-307";
  204. public const string PasswordMismatch = "-308";
  205. // ============================================
  206. // EMAIL ERRORS (-400 to -499)
  207. // ============================================
  208. public const string EmailNotConfigured = "-400";
  209. public const string EmailSendFailed = "-401";
  210. public const string EmailTemplateNotFound = "-402";
  211. public const string EmailInvalidRecipient = "-403";
  212. public const string EmailQueueFailed = "-404";
  213. public const string SmtpConnectionFailed = "-405";
  214. // ============================================
  215. // CAMPAIGN/MISSION ERRORS (-500 to -599)
  216. // ============================================
  217. public const string NoCampaignAvailable = "-500";
  218. public const string CampaignExpired = "-501";
  219. public const string CampaignNotStarted = "-502";
  220. public const string MissionCompleted = "-503";
  221. public const string MissionNotFound = "-504";
  222. public const string NeedCompleteQuest = "-505";
  223. public const string PrizeAlreadyClaimed = "-506";
  224. public const string PrizeClaimFailed = "-507";
  225. // ============================================
  226. // PACKAGE/SUBSCRIPTION ERRORS (-600 to -699)
  227. // ============================================
  228. public const string VendorPackageRequired = "-600";
  229. public const string PackageNotFound = "-601";
  230. public const string PackageExpired = "-602";
  231. public const string PackageAlreadyActive = "-603";
  232. public const string InsufficientBalance = "-604";
  233. public const string PaymentFailed = "-605";
  234. public const string SubscriptionFailed = "-606";
  235. // ============================================
  236. // EXTERNAL SERVICE ERRORS (-700 to -799)
  237. // ============================================
  238. public const string ExternalServiceError = "-700";
  239. public const string ExternalServiceTimeout = "-701";
  240. public const string ExternalServiceUnavailable = "-702";
  241. public const string MpsRegistered = "-703";
  242. public const string MpsError = "-704";
  243. public const string SmsGatewayError = "-705";
  244. // ============================================
  245. // VALIDATION ERRORS (-800 to -899)
  246. // ============================================
  247. public const string ValidationFailed = "-800";
  248. public const string RequiredFieldMissing = "-801";
  249. public const string InvalidFormat = "-802";
  250. public const string ValueOutOfRange = "-803";
  251. public const string DuplicateEntry = "-804";
  252. // Prize Types (kept for backward compatibility)
  253. public static readonly List<string> ListPrizeType = new List<string>
  254. {
  255. "POINT",
  256. "MONEY"
  257. };
  258. }