summaryrefslogtreecommitdiff
path: root/src/main/java/dev/dnpm/oshelper/atc/services/AgentCodeService.java
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2026-09-07 15:15:19 +0200
committerGitHub2026-09-07 15:15:19 +0200
commit37314fca05468a3bfa8d4c3d23584586463a97fa (patch)
tree7b1def283bed1fe9d7d430ca7e0481491b92f698 /src/main/java/dev/dnpm/oshelper/atc/services/AgentCodeService.java
parentcdcdb21eca393b17ac5d075c5a002d30ccf038c5 (diff)
feat!: only add level 4/5 ATC codes (#295)
ATC codes like `L`, `L01`, `L01E` are not imported any more and cannot be used as ATC code from database. These codes (from database) will be treated as unregistered code instead.
Diffstat (limited to 'src/main/java/dev/dnpm/oshelper/atc/services/AgentCodeService.java')
-rw-r--r--src/main/java/dev/dnpm/oshelper/atc/services/AgentCodeService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/dev/dnpm/oshelper/atc/services/AgentCodeService.java b/src/main/java/dev/dnpm/oshelper/atc/services/AgentCodeService.java
index f1dc2e2..6540023 100644
--- a/src/main/java/dev/dnpm/oshelper/atc/services/AgentCodeService.java
+++ b/src/main/java/dev/dnpm/oshelper/atc/services/AgentCodeService.java
@@ -25,6 +25,7 @@ import dev.dnpm.oshelper.atc.AgentCode;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
+import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.jspecify.annotations.NullMarked;
@@ -100,4 +101,12 @@ public interface AgentCodeService {
* @return A list with agent codes
*/
List<AgentCode> findAgentCodes(String query, int size);
+
+ /**
+ * Queries source for agents with code matching code string.
+ *
+ * @param code The code string
+ * @return An optional agent code if found
+ */
+ Optional<AgentCode> getAgentCode(String code);
}