12 lines
536 B
Python
12 lines
536 B
Python
from .domain.models import Document, IngestionRequest
|
|
|
|
def validate_request(request: IngestionRequest) -> list[str]:
|
|
errors = []
|
|
if not request.source.repository.strip(): errors.append("repository is required")
|
|
if not request.source.path.strip(): errors.append("path is required")
|
|
if request.destination not in {"sharepoint"}: errors.append("unsupported destination")
|
|
return errors
|
|
|
|
def validate_document(document: Document) -> list[str]:
|
|
return [] if document.content.strip() else ["document content is empty"]
|