Files
xiaoxia-saas/packages/ports/classification_job_repository.py
T
Xiaoxia AI a8177c1268 feat: add asset classification pipeline
- domain: ClassificationJob entity with AssetClassification enum (scenic, product, person, animal, food, tech, sport, music, other)
- ports: ClassificationJobRepository interface
- application: SubmitClassificationJobUseCase
- adapters: InMemoryClassificationJobRepository
- worker: classify_asset task with mock classification logic
- tests: full classification pipeline test
- all 8 integration tests passing
2026-06-15 15:39:28 +08:00

17 lines
520 B
Python

from __future__ import annotations
from typing import Protocol
from packages.domain import ClassificationJob
class ClassificationJobRepository(Protocol):
def create(self, job: ClassificationJob) -> ClassificationJob:
"""Persist a classification job and return it."""
def get(self, job_id: str) -> ClassificationJob | None:
"""Retrieve a classification job by ID."""
def update(self, job: ClassificationJob) -> ClassificationJob:
"""Update a classification job and return it."""