Refactoring of services.py; tests

This commit is contained in:
2026-06-13 04:07:46 +02:00
parent f3db5fc5cf
commit 36e9211ee6
15 changed files with 2113 additions and 920 deletions

View File

@@ -0,0 +1,42 @@
from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime, timezone
from app.db.models import FileAsset, FileBlob, FileVersion
class FileStorageError(RuntimeError):
pass
@dataclass(slots=True)
class UploadedStoredFile:
asset: FileAsset
version: FileVersion
blob: FileBlob
@dataclass(slots=True)
class ResolvedPattern:
pattern: str
matches: list[FileAsset]
@dataclass(slots=True)
class FileConflictResolution:
target_path: str
action: str
new_path: str | None = None
@dataclass(slots=True)
class RenamePlanItem:
kind: str
id: str
old_path: str
new_path: str
def utcnow() -> datetime:
return datetime.now(timezone.utc)