Improve the traffic fetching system
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# ================================================================
|
||||
"""Sales data schemas"""
|
||||
|
||||
from pydantic import BaseModel, Field, validator
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
from datetime import datetime
|
||||
from typing import Optional, List, Dict, Any
|
||||
from uuid import UUID
|
||||
@@ -20,7 +20,8 @@ class SalesDataCreate(BaseModel):
|
||||
source: str = Field(default="manual", max_length=50)
|
||||
notes: Optional[str] = Field(None, max_length=500)
|
||||
|
||||
@validator('product_name')
|
||||
@field_validator('product_name')
|
||||
@classmethod
|
||||
def normalize_product_name(cls, v):
|
||||
return v.strip().lower()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user