Initial commit - Journey book (kniha jízd) automation system
Features: - FastAPI backend for scraping attendance and journey book data - Deterministic kilometer distribution with random variance - Refueling form filling with km values - Next.js frontend with date range selector - Docker deployment setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
3
backend/models/__init__.py
Normal file
3
backend/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .journey import Journey, JourneyEntry, RefuelingEntry
|
||||
|
||||
__all__ = ["Journey", "JourneyEntry", "RefuelingEntry"]
|
||||
37
backend/models/journey.py
Normal file
37
backend/models/journey.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class JourneyEntry(BaseModel):
|
||||
date: str
|
||||
start_km: Optional[int] = None
|
||||
end_km: Optional[int] = None
|
||||
distance_km: Optional[int] = None
|
||||
is_sick_day: bool = False
|
||||
is_vacation: bool = False
|
||||
|
||||
|
||||
class RefuelingEntry(BaseModel):
|
||||
date: str
|
||||
amount_liters: float
|
||||
km_at_refuel: Optional[int] = None
|
||||
|
||||
|
||||
class Journey(BaseModel):
|
||||
month: str = Field(..., pattern=r"^\d{4}-\d{2}$")
|
||||
start_km: int = Field(..., gt=0)
|
||||
end_km: int = Field(..., gt=0)
|
||||
entries: list[JourneyEntry] = []
|
||||
refueling_entries: list[RefuelingEntry] = []
|
||||
|
||||
class Config:
|
||||
json_schema_extra = {
|
||||
"example": {
|
||||
"month": "2024-03",
|
||||
"start_km": 12000,
|
||||
"end_km": 13500,
|
||||
"entries": [],
|
||||
"refueling_entries": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user