Skip to content

Commit

Permalink
Add schema. Fix migration name
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Nov 21, 2023
1 parent 0895125 commit 255c273
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions app/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
from typing import Optional

from fastapi_filter.contrib.sqlalchemy import Filter
from pydantic import BaseModel, ConfigDict, Field, field_serializer, field_validator
from pydantic import (
AnyHttpUrl,
BaseModel,
ConfigDict,
Field,
field_serializer,
field_validator,
)
from sqlalchemy_utils import Currency

from app.enums import LocationOSMType
from app.enums import LocationOSMType, ProductOFFSource
from app.models import Price


Expand All @@ -16,6 +23,22 @@ class UserBase(BaseModel):
token: str


class ProductCreate(BaseModel):
model_config = ConfigDict(from_attributes=True, arbitrary_types_allowed=True)

code: str


class ProductBase(BaseModel):
id: int
off_source: ProductOFFSource | None
off_name: str | None
off_quantity: int | None
off_image_url: AnyHttpUrl | None
created: datetime
updated: datetime | None


class LocationCreate(BaseModel):
model_config = ConfigDict(from_attributes=True, arbitrary_types_allowed=True)

Expand Down

0 comments on commit 255c273

Please sign in to comment.