a8177c1268
- 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
18 lines
512 B
Python
18 lines
512 B
Python
from packages.domain import ClassificationJob
|
|
|
|
|
|
class InMemoryClassificationJobRepository:
|
|
def __init__(self):
|
|
self._items: dict[str, ClassificationJob] = {}
|
|
|
|
def create(self, job: ClassificationJob) -> ClassificationJob:
|
|
self._items[job.id] = job
|
|
return job
|
|
|
|
def get(self, job_id: str) -> ClassificationJob | None:
|
|
return self._items.get(job_id)
|
|
|
|
def update(self, job: ClassificationJob) -> ClassificationJob:
|
|
self._items[job.id] = job
|
|
return job
|