Coverage for functions \ flipdare \ util \ payment_sanity_result.py: 0%

19 statements  

« 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# 

12from dataclasses import dataclass, field 

13 

14__all__ = ["PaymentSanityResult"] 

15 

16 

17@dataclass(kw_only=True, frozen=True) 

18class PaymentSanityResult: 

19 app_fee_amount: int 

20 errors: list[str] = field(default_factory=list) 

21 warnings: list[str] = field(default_factory=list) 

22 

23 @property 

24 def is_error(self) -> bool: 

25 return len(self.errors) > 0 

26 

27 @property 

28 def is_warning(self) -> bool: 

29 return len(self.warnings) > 0 

30 

31 @property 

32 def error_msg(self) -> str: 

33 return "\n".join(self.errors) 

34 

35 @property 

36 def warning_msg(self) -> str: 

37 return "\n".join(self.warnings)