adiljava's picture
feat: Implement API schemas and services for user authentication, plant care, chat, and scans
3b45a26
Raw
History Blame Contribute Delete
621 Bytes
from datetime import datetime
from typing import Optional
from pydantic import BaseModel, Field
class Alert(BaseModel):
"""MongoDB Alert model."""
id: Optional[str] = Field(default=None, alias="_id")
user_id: str # Reference to user
type: str # water, fertilize, pest, health
title: str
description: str
plantName: str
plantId: str # Reference to plant
priority: str # urgent, high, medium, low
timestamp: str # ISO datetime string
isRead: bool = False
created_at: datetime = Field(default_factory=datetime.utcnow)
class Config:
populate_by_name = True