Make transaction.meter_end required and force tz utc for all datetimes
This commit is contained in:
parent
4272f2878e
commit
8e42205301
8 changed files with 32 additions and 10 deletions
|
@ -5,7 +5,7 @@ from typing import Optional
|
|||
from uuid import UUID
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.util.encoders import decimal_encoder
|
||||
from app.util.encoders import decimal_encoder, force_utc_datetime
|
||||
|
||||
class PhaseType(enum.Enum):
|
||||
L1 = "L1"
|
||||
|
@ -57,4 +57,4 @@ class MeterValue(BaseModel):
|
|||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
json_encoders = {Decimal: decimal_encoder}
|
||||
json_encoders = {Decimal: decimal_encoder, datetime: force_utc_datetime}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue