Coverage for src/integrify/kapital/schemas/response/order_response.py: 100%

22 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-02-10 00:57 +0000

1from pydantic import computed_field 

2 

3from integrify.kapital.schemas.enums import TransactionStatus 

4from integrify.kapital.schemas.utils import BaseSchema 

5 

6 

7class CreateOrderResponseSchema(BaseSchema): 

8 id: int 

9 password: str 

10 hpp_url: str 

11 

12 @computed_field # type: ignore[prop-decorator] 

13 @property 

14 def redirect_url(self) -> str: 

15 """Redirect url generasiyası""" 

16 return f'{self.hpp_url}?id={self.id}&password={self.password}' 

17 

18 

19class OrderType(BaseSchema): 

20 title: str 

21 

22 

23class OrderInformationResponseSchema(BaseSchema): 

24 id: int 

25 type_rid: str 

26 status: TransactionStatus 

27 last_status_login: str 

28 amount: float 

29 currency: str 

30 create_time: str 

31 type: OrderType