Skip to content

Commit b8a1908

Browse files
committed
refactor schemas.py
1 parent d4e6d0e commit b8a1908

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

app/schemas.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
from pydantic import BaseModel, validator
33
from typing import Optional
44

5-
from models import Item
6-
75

86
MAX_PRICE = 10000
97

@@ -21,6 +19,7 @@ def price_more_than_max(cls, value: float):
2119
raise ValueError('payment sum is more than 10 000')
2220
return value
2321

22+
2423
class ItemResponseSchema(ItemRequestSchema):
2524
id: int
2625

@@ -41,15 +40,14 @@ def price_more_than_max(cls, value: float):
4140
raise ValueError('payment sum is more than 10 000')
4241
return value
4342

43+
4444
class PaymentRequestSchema(BaseModel):
4545
item_id: Optional[int]
4646
date: Optional[datetime]
4747
status: Optional[str]
4848
is_issued: Optional[bool]
4949

5050

51-
52-
5351
class PaymentResponseSchema(PaymentRequestSchema):
5452
id: int
5553

0 commit comments

Comments
 (0)