@@ -58,18 +58,20 @@ class UsersPublic(SQLModel):
5858
5959# Shared properties
6060class DocumentBase (SQLModel ):
61- title : str = Field (min_length = 1 , max_length = 255 )
62- description : str | None = Field (default = None , max_length = 255 )
61+ filename : str = Field (min_length = 1 , max_length = 255 )
62+ s3_url : str | None = Field (default = None , max_length = 255 ) # URL to the document in S3
63+ content_type : str | None = Field (default = None , max_length = 255 )
64+ size : int | None = Field (default = None , ge = 0 ) # Size in bytes
65+
6366
6467
6568# Properties to receive on document creation
6669class DocumentCreate (DocumentBase ):
6770 pass
6871
69-
7072# Properties to receive on document update
7173class DocumentUpdate (DocumentBase ):
72- title : str | None = Field (default = None , min_length = 1 , max_length = 255 ) # type: ignore
74+ filename : str | None = Field (default = None , min_length = 1 , max_length = 255 ) # type: ignore
7375
7476
7577# Database model, database table inferred from class name
@@ -82,10 +84,17 @@ class Document(DocumentBase, table=True):
8284
8385
8486# Properties to return via API, id is always required
87+ # class DocumentPublic(DocumentBase):
88+ # id: uuid.UUID
89+ # owner_id: uuid.UUID
90+
8591class DocumentPublic (DocumentBase ):
8692 id : uuid .UUID
8793 owner_id : uuid .UUID
88-
94+ s3_url : str | None = None
95+ filename : str | None = None
96+ content_type : str | None = None
97+ size : int | None = None
8998
9099class DocumentsPublic (SQLModel ):
91100 data : list [DocumentPublic ]
0 commit comments