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
