Coverage for functions \ flipdare \ core \ flag_code.py: 100%
0 statements
« prev ^ index » next coverage.py v7.13.0, created at 2026-05-08 12:22 +1000
« prev ^ index » next coverage.py v7.13.0, created at 2026-05-08 12:22 +1000
1#!/usr/bin/env python
2# Copyright (c) 2026 Flipdare Pty Ltd. All rights reserved.
3#
4# This file is part of Flipdare's proprietary software and contains
5# confidential and copyrighted material. Unauthorised copying,
6# modification, distribution, or use of this file is strictly
7# prohibited without prior written permission from Flipdare Pty Ltd.
8#
9# This software includes third-party components licensed under MIT,
10# BSD, and Apache 2.0 licences. See THIRD_PARTY_NOTICES for details.
11#
13# pragma: no cover
15from enum import Enum
18class FlagCode(Enum):
19 CLOSED_FINALIZED = "1.a"
20 CLOSED_NOTIFY = "1.b"
21 WITHDRAWN_FINALIZED = "2.a"
22 WITHDRAWN_NOTIFY = "2.b"
23 DISP_WITHDRAWN_FINALIZED = "3.a.1"
24 DISP_WITHDRAWN_NOTIFY = "3.a.2"
25 DISP_WITHDRAWN_COMMENT = "3.a.3"
26 DISP_APPROVED_FINALIZED = "3.b.1"
27 DISP_APPROVED_NOTIFY = "3.b.2"
28 DISP_APPROVED_COMMENT = "3.b.3"
29 DISP_REJECTED_FINALIZED = "3.c.1"
30 DISP_REJECTED_NOTIFY = "3.c.2"
31 DISP_REJECTED_COMMENT = "3.c.3"
32 DISP_WAITING_ADMIN_DAILY = "3.d.1.a"
33 DISP_WAITING_ADMIN_COMMENT = "3.d.1.b"
34 DISP_WAITING_ADMIN_URGENT_DAILY = "3.d.2.a"
35 DISP_WAITING_ADMIN_URGENT_REMOVE = "3.d.2.b"
36 DISP_WAITING_ADMIN_URGENT_NOTIFY = "3.d.2.c"
37 DISP_WAITING_ADMIN_URGENT_COMMENT = "3.d.2.d"
38 DISP_WAITING_USER_NOTIFY = "3.e.1.a"
39 DISP_WAITING_USER_COMMENT = "3.e.1.b"
40 DISP_WAITING_USER_EXPIRE_RESTRICTION = "3.e.2.a"
41 DISP_WAITING_USER_EXPIRE_NOTIFY = "3.e.2.b"
42 DISP_WAITING_USER_EXPIRE_COMMENT = "3.e.2.c"
43 ACK_MINOR_RESTRICTION = "4.1.1"
44 ACK_MINOR_REPUTATION = "4.1.2"
45 ACK_MINOR_NOTIFY = "4.1.3"
46 ACK_MINOR_COMMENT = "4.1.4"
47 ACK_MAJOR_RESTRICTION = "4.2.1"
48 ACK_MAJOR_NOTIFY = "4.2.2"
49 ACK_MAJOR_COMMENT = "4.2.3"
50 OPEN_MINOR_RESTRICTION = "5.a.1"
51 OPEN_MINOR_NOTIFY = "5.a.2"
52 OPEN_MINOR_COMMENT = "5.a.3"
53 OPEN_MAJOR_CALCULATE = "5.b.1"
54 OPEN_MAJOR_NOTIFY = "5.b.2"
55 OPEN_MAJOR_COMMENT = "5.b.3"
57 @property
58 def message(self) -> str:
59 comment_messages = {
60 "1.a": "Restriction applied to flagged user.",
61 "1.b": "User notified of flag restriction.",
62 "2.a": "Restriction removed following flag withdrawal.",
63 "2.b": "User notified of flag withdrawal and restriction removal.",
64 "3.a.1": "Restriction removed following dispute withdrawal.",
65 "3.a.2": "User notified of dispute withdrawal and restriction removal.",
66 "3.a.3": "System processed dispute withdrawal.",
67 "3.b.1": "Restriction removed following dispute approval.",
68 "3.b.2": "User notified of dispute approval and restriction removal.",
69 "3.b.3": "System processed dispute approval.",
70 "3.c.1": "Restriction reapplied following dispute rejection.",
71 "3.c.2": "User notified of dispute rejection and restriction reapplication.",
72 "3.c.3": "System processed dispute rejection.",
73 "3.d.1.a": "Flag is waiting for admin review (daily reminder).",
74 "3.d.1.b": "System logged daily reminder for admin review of flag.",
75 "3.d.2.a": "Flag is waiting for admin review (urgent reminder).",
76 "3.d.2.b": "Restriction temporarily removed pending admin review.",
77 "3.d.2.c": "User notified of temporary restriction removal pending admin review.",
78 "3.d.2.d": "System logged urgent reminder for admin review of flag.",
79 "3.e.1.a": "User notified to respond to dispute.",
80 "3.e.1.b": "System logged user notification to respond to dispute.",
81 "3.e.2.a": "Restriction reapplied after user failed to respond to dispute.",
82 "3.e.2.b": "User notified of restriction reapplication after dispute response timeout.",
83 "3.e.2.c": "System logged restriction reapplication after dispute response timeout.",
84 "4.1.1": "Warning restriction applied for minor flag.",
85 "4.1.2": "User reputation decreased for minor flag.",
86 "4.1.3": "User notified of actions taken for minor flag.",
87 "4.1.4": "System processed minor flag acknowledgment.",
88 "4.2.1": "Restriction applied for major flag.",
89 "4.2.2": "User notified of actions taken for major flag.",
90 "4.2.3": "System processed major flag acknowledgment.",
91 "5.a.1": "Warning restriction applied and reputation decreased for minor flag.",
92 "5.a.2": "User notified of flag and actions taken for minor flag.",
93 "5.a.3": "System processed minor flag.",
94 "5.b.1": "Flag included in hourly admin report for major flags.",
95 "5.b.2": "Restriction applied for major flag.",
96 "5.b.3": "System processed major flag.",
97 }
98 return comment_messages[self.value]