from typing import Optional
from sqlmodel import Field, SQLModel, Field
from pydantic import root_validator
from datetime import datetime


# {
#   "user_id": 1,
#   "start_time": "2022-01-19T08:30:00.000Z",
#   "end_time": "2022-01-19T09:30:00.000Z",
#   "client_id": 1,
#   "epic_id": 1,
#   "count_hours": 0,
#   "count_days": 0,
#   "month": 0,
#   "year": 0
# }


class TimeLog(SQLModel, table=True):
    """Create an SQLModel for timelogs"""

    id: Optional[int] = Field(default=None, primary_key=True)
    user_id: int = 