Coverage for functions \ flipdare \ generated \ shared \ app_log_category.py: 100%

0 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-05-08 12:22 +1000

1#!/usr/bin/env python 

2# 

3# Copyright (c) 2026 Flipdare Pty Ltd. All rights reserved. 

4# 

5# This file is part of Flipdare's proprietary software and contains 

6# confidential and copyrighted material. Unauthorised copying, 

7# modification, distribution, or use of this file is strictly 

8# prohibited without prior written permission from Flipdare Pty Ltd. 

9# 

10# This software includes third-party components licensed under MIT, 

11# BSD, and Apache 2.0 licences. See THIRD_PARTY_NOTICES for details. 

12# 

13# NOTE: THIS FILE IS AUTO GENERATED. DO NOT EDIT. 

14# 

15# Generated by codegen_models.py 

16# 

17# Modify 'codegen_models.py' 

18# and re-run the script above to update. 

19# 

20 

21# pragma: no cover 

22 

23from enum import StrEnum 

24 

25 

26class AppLogCategory(StrEnum): 

27 """Top-level grouping for all application errors.""" 

28 

29 # Declared here so type-checkers know these attributes exist. 

30 # They are populated per-member inside __new__. 

31 _label: str 

32 _error_label: str 

33 

34 def __new__( 

35 cls, 

36 code: str, 

37 label: str | None = None, 

38 error_label: str | None = None, 

39 ) -> "AppLogCategory": 

40 obj = str.__new__(cls, code) 

41 obj._value_ = code 

42 # Only set attributes if they are provided (during member definition) 

43 if label is not None: 

44 obj._label = label 

45 if error_label is not None: 

46 obj._error_label = error_label 

47 return obj 

48 

49 # ---- Members -------------------------------------------------------- 

50 # fmt: off 

51 SERVER = ("SERVER", "Server", "Internal Server") 

52 CONFIG = ("CONFIG", "Config", "Code/Config Error") 

53 REQUEST = ("REQUEST", "Request", "Invalid Request") 

54 DATABASE = ("DATABASE", "Database", "Database Error") 

55 SEARCH = ("SEARCH", "Search", "Search Error") 

56 AUTH = ("AUTH", "Authentication", "Authentication Error") 

57 CRON = ("CRON", "Cron", "Cron Error") 

58 COMMAND = ("COMMAND", "Command", "Command Error") 

59 TRIGGER = ("TRIGGER", "Trigger", "Trigger Error") 

60 REPORTING = ("REPORTING", "Reporting", "Reporting Error") 

61 API = ("API", "External API", "Third Party API Error") 

62 PAYMENT = ("PAYMENT", "Payment", "Payment Error") 

63 DARE = ("DARE", "Dare", "Dare Error (e.g. voting errors, dare processing errors, etc.)") 

64 INTEGRITY = ("INTEGRITY", "Data Integrity", "Data Integrity Error") 

65 CONTENT = ("CONTENT", "Content", "Content Error") 

66 EMAIL = ("EMAIL", "Email", "Invalid Email Error") 

67 SAFETY = ("SAFETY", "Safety", "Safety Issues") 

68 COMPLIANCE = ("COMPLIANCE", "Compliance", "Compliance Error") 

69 OTHER = ("OTHER", "Other", "Other Error") 

70 # fmt: on 

71 # ---- Properties ----------------------------------------------------- 

72 @property 

73 def label(self) -> str: 

74 return self._label 

75 

76 @property 

77 def error_label(self) -> str: 

78 return self._error_label