mirror of
https://github.com/bellingcat/whisperbox-transcribe.git
synced 2026-06-13 05:58:35 +03:00
refactor: restructure project layout
This commit is contained in:
41
app/shared/db/dtos.py
Normal file
41
app/shared/db/dtos.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import enum
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import AnyHttpUrl, BaseModel, Json
|
||||
|
||||
|
||||
class ArtifactType(enum.Enum):
|
||||
RawTranscript = "RawTranscript"
|
||||
|
||||
|
||||
class JobType(enum.Enum):
|
||||
Transcript = "Transcript"
|
||||
|
||||
|
||||
class JobStatus(enum.Enum):
|
||||
Create = "Create"
|
||||
Error = "Error"
|
||||
Success = "Success"
|
||||
|
||||
|
||||
class WithDbFields(BaseModel):
|
||||
id: UUID
|
||||
created_at: datetime
|
||||
updated_at: Optional[datetime]
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class Job(WithDbFields):
|
||||
status: JobStatus
|
||||
type: JobType
|
||||
url: AnyHttpUrl
|
||||
|
||||
|
||||
class Artifact(WithDbFields):
|
||||
data: Optional[Json]
|
||||
job_id: UUID
|
||||
type: ArtifactType
|
||||
Reference in New Issue
Block a user