calculator / models.py
elsamueldev's picture
separated model, better type for `operation`
2e02765
raw
history blame
258 Bytes
from enum import Enum
from pydantic import BaseModel
class Operation(Enum):
ADD = "add"
SUBTRACT = "subtract"
MULTIPLY = "multiply"
DIVIDE = "divide"
class CalculationRequest(BaseModel):
operation: Operation
x: float
y: float