File size: 2,175 Bytes
51c39cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303d067
 
 
 
 
25058c7
 
 
 
 
 
 
 
 
 
51c39cf
 
 
 
 
15a4294
51c39cf
 
 
 
303d067
ed33547
25058c7
51c39cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ed33547
 
 
 
 
 
 
 
 
 
 
 
 
 
15a4294
 
 
 
 
 
 
 
25058c7
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
from __future__ import annotations

from typing import Dict, List, Optional

from pydantic import BaseModel, Field


class FileMeta(BaseModel):
    id: str
    name: str
    size: int
    content_type: str
    category: str
    url: Optional[str] = None


class Heading(BaseModel):
    number: str = ""
    name: str = ""


class PageTemplateDefinition(BaseModel):
    id: str
    name: str
    description: str = ""
    blank: bool = False
    variant: str = "full"
    photo_layout: str = "auto"
    source: str = "custom"


class SessionResponse(BaseModel):
    id: str
    status: str
    created_at: str
    updated_at: str
    document_no: str
    inspection_date: str
    uploads: Dict[str, List[FileMeta]] = Field(default_factory=dict)
    selected_photo_ids: List[str] = Field(default_factory=list)
    page_count: int = 0
    headings: List[Heading] = Field(default_factory=list)
    jobsheet_sections: List["JobsheetSection"] = Field(default_factory=list)
    page_templates: List[PageTemplateDefinition] = Field(default_factory=list)


class SessionStatusResponse(BaseModel):
    id: str
    status: str
    updated_at: str


class SelectionRequest(BaseModel):
    selected_photo_ids: List[str] = Field(default_factory=list)


class PagesResponse(BaseModel):
    pages: List[dict] = Field(default_factory=list)


class PagesRequest(BaseModel):
    pages: List[dict] = Field(default_factory=list)


class JobsheetSection(BaseModel):
    id: str
    title: Optional[str] = None
    pages: List[dict] = Field(default_factory=list)


class SectionsResponse(BaseModel):
    sections: List[JobsheetSection] = Field(default_factory=list)


class SectionsRequest(BaseModel):
    sections: List[JobsheetSection] = Field(default_factory=list)


class HeadingsRequest(BaseModel):
    headings: List[Heading] = Field(default_factory=list)


class HeadingsResponse(BaseModel):
    headings: List[Heading] = Field(default_factory=list)


class PageTemplatesRequest(BaseModel):
    page_templates: List[PageTemplateDefinition] = Field(default_factory=list)


class PageTemplatesResponse(BaseModel):
    page_templates: List[PageTemplateDefinition] = Field(default_factory=list)