Coverage for functions \ flipdare \ generated \ shared \ model \ issue \ issue_progress.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 

22from enum import StrEnum 

23 

24 

25class IssueProgress(StrEnum): 

26 """Progress status of an issue.""" 

27 

28 OPEN = "open" 

29 WAITING_ADMIN = "waiting_admin" 

30 ADMIN_ACK = "admin_ack" 

31 DISPUTED = "disputed" 

32 WITHDRAWN = "withdrawn" 

33 RESOLVED = "resolved" 

34 

35 # ---- Convenience predicates ----------------------------------------- 

36 @property 

37 def requires_moderation(self) -> bool: 

38 return self in { 

39 IssueProgress.OPEN, 

40 } 

41 

42 @property 

43 def is_admin_ack(self) -> bool: 

44 return self == IssueProgress.ADMIN_ACK 

45 

46 @property 

47 def is_disputed(self) -> bool: 

48 return self == IssueProgress.DISPUTED 

49 

50 @property 

51 def message(self) -> str | None: 

52 from flipdare.app_log import LOG 

53 

54 if self == IssueProgress.RESOLVED: 

55 return "has been closed by the admin team." 

56 elif self == IssueProgress.WITHDRAWN: 

57 return "has been withdrawn. No action was taken." 

58 else: 

59 LOG().debug(f"Issue progress {self} does not require user notification.") 

60 return None