Class AnnotationService

java.lang.Object
dev.dokimos.server.service.AnnotationService

@Service public class AnnotationService extends Object
Service for human review annotations on run item results. Each item result holds at most one annotation; upsert(java.util.UUID, java.util.UUID, dev.dokimos.server.dto.v1.AnnotationRequest, java.lang.String) creates it on first call and updates the same row thereafter.
  • Constructor Details

  • Method Details

    • upsert

      @Transactional public AnnotationView upsert(UUID runId, UUID itemResultId, AnnotationRequest req, String principalId)
      Creates or updates the single annotation for the given item result. The item result must exist and belong to the given run. On an existing annotation this overwrites its fields and stamps updatedAt; the createdBy principal is recorded only when the annotation is first created.
      Throws:
      IllegalArgumentException - if the item result does not exist or does not belong to the run (mapped to 404)
    • get

      @Transactional(readOnly=true) public AnnotationView get(UUID runId, UUID itemResultId)
      Returns the annotation for the given run item result.
      Throws:
      IllegalArgumentException - if the item result does not belong to the run, or has no annotation (mapped to 404)
    • delete

      @Transactional public void delete(UUID runId, UUID itemResultId)
      Removes the annotation for the given run item result if one exists. No-op when the item result is un-annotated.
      Throws:
      IllegalArgumentException - if the item result does not belong to the run (mapped to 404)