27 lines
805 B
Python
27 lines
805 B
Python
"""Offline map pack metadata."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from app.models.route import new_id, utcnow_iso
|
|
|
|
|
|
class MapPack(BaseModel):
|
|
id: str = Field(default_factory=new_id)
|
|
name: str = "Offline area"
|
|
bbox: list[float] = Field(default_factory=list) # [min_lon, min_lat, max_lon, max_lat]
|
|
min_zoom: int = 8
|
|
max_zoom: int = 14
|
|
layers: list[str] = Field(default_factory=lambda: ["base"])
|
|
status: str = "queued" # queued | downloading | ready | failed
|
|
error: Optional[str] = None
|
|
path: Optional[str] = None
|
|
size_bytes: int = 0
|
|
tile_count: int = 0
|
|
tiles_done: int = 0
|
|
created_at: str = Field(default_factory=utcnow_iso)
|
|
updated_at: str = Field(default_factory=utcnow_iso)
|