Reafctor app
This commit is contained in:
parent
b8216f6ade
commit
7740be8bb5
36 changed files with 389 additions and 208 deletions
31
app/schemas/chargepoint.py
Normal file
31
app/schemas/chargepoint.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.schemas.connector import Connector
|
||||
|
||||
class ChargePointBase(BaseModel):
|
||||
friendly_name: str
|
||||
is_active: bool
|
||||
|
||||
class ChargePointUpdate(BaseModel):
|
||||
friendly_name: Optional[str] = None
|
||||
is_active: Optional[bool] = None
|
||||
|
||||
class ChargePointCreate(ChargePointBase):
|
||||
pass
|
||||
|
||||
class ChargePoint(ChargePointBase):
|
||||
id: UUID
|
||||
last_seen: datetime | None
|
||||
connectors: list[Connector] = []
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
class ChargePointPassword(BaseModel):
|
||||
password: str
|
||||
|
||||
class ChargePointConnectionInfo(BaseModel):
|
||||
connected: bool
|
Loading…
Add table
Add a link
Reference in a new issue