T10: PwzRegistrySource with PwzLookupClient [checkpoint]
This commit is contained in:
@@ -737,7 +737,7 @@ Po ukończeniu zadania agent zmienia jego status w liście poniżej i dopisuje j
|
||||
- [~] T7 GraphValidator + CSV [NEO4J] (skipped: Docker API too old, jak T6)
|
||||
- [x] T8 Zielony pełny build
|
||||
- [x] T9 Person: title/pwzNumber
|
||||
- [ ] T10 PwzRegistrySource
|
||||
- [x] T10 PwzRegistrySource
|
||||
- [ ] T11 Organization/Company rekordy + round-trip
|
||||
- [ ] T12 GraphLoader: Organization/Company [NEO4J]
|
||||
- [ ] T13 GraphValidator: konflikt interesów [NEO4J]
|
||||
@@ -751,6 +751,7 @@ Po ukończeniu zadania agent zmienia jego status w liście poniżej i dopisuje j
|
||||
- 2026-07-07 — T6/T8 — skip NEO4J tests (Docker API zbyt stary) + pełny build zielony [checkpoint] (commit 59d27b1)
|
||||
- 2026-07-08 — PLAN.md scalony z PLAN2.md (Person.title/pwzNumber, Organization/Company, kolejka T9–T13); dostosowano §11 pod Qwen-3.6-35B-A3B.
|
||||
- 2026-07-08 — T9 — Person: title/pwzNumber — dodano dwa pola do record Person, zaktualizowano wszyskie konstruktory (CanonicalWriter, Deduplicator, testy). 7 testow zielonych.
|
||||
- 2026-07-08 — T10 — PwzRegistrySource — PwzLookupClient (functional interface) + PwzRegistrySource(lookupPwz). 4 testy zielone.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Stan wykonania kolejki zadań lokalnego agenta (PLAN2.md §11-13). Zrodlo prawdy przy konflikcie: git log.",
|
||||
"resumeHint": "Wczytaj ten plik, znajdz pierwszy task o statusie todo/in_progress. Jesli in_progress i drzewo git brudne -> git checkout -- . && git clean -fd, ustaw task na todo, zacznij od zera (PLAN2.md §13.1).",
|
||||
"createdAt": "2026-07-07",
|
||||
"updatedAt": "2026-07-08T23:03:00Z",
|
||||
"updatedAt": "2026-07-08T23:11:00Z",
|
||||
"tasks": [
|
||||
{
|
||||
"id": "T1",
|
||||
@@ -91,10 +91,10 @@
|
||||
"id": "T10",
|
||||
"title": "PwzRegistrySource",
|
||||
"tag": null,
|
||||
"status": "todo",
|
||||
"startedAt": null,
|
||||
"finishedAt": null,
|
||||
"note": "Uzupelnienie pwzNumber z rejestr.nil.org.pl przez wstrzykniety PwzLookupClient (PLAN.md 4.7, T10)."
|
||||
"status": "done",
|
||||
"startedAt": "2026-07-08T23:04:00Z",
|
||||
"finishedAt": "2026-07-08T23:11:00Z",
|
||||
"note": "PwzRegistrySource z PwzLookupClient. 4 testow zielonych: singleMatch, multipleMatches (ambiguity), noMatch, nullClient."
|
||||
},
|
||||
{
|
||||
"id": "T11",
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.developx.szpitale.ingest.source;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface PwzLookupClient {
|
||||
List<String> query(String fullName);
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.developx.szpitale.ingest.source;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class PwzRegistrySource {
|
||||
|
||||
private final PwzLookupClient client;
|
||||
|
||||
public PwzRegistrySource(PwzLookupClient client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public Optional<String> lookupPwz(String fullName) {
|
||||
if (client == null || fullName == null || fullName.isBlank()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
List<String> results = client.query(fullName);
|
||||
|
||||
if (results == null || results.isEmpty()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
if (results.size() == 1) {
|
||||
return Optional.of(results.get(0));
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.developx.szpitale.ingest.source;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class PwzRegistrySourceTest {
|
||||
|
||||
@Test
|
||||
void lookupPwz_singleMatch_returnsPwzNumber() {
|
||||
PwzLookupClient client = fullName -> List.of("1234567");
|
||||
PwzRegistrySource source = new PwzRegistrySource(client);
|
||||
|
||||
Optional<String> result = source.lookupPwz("Jan Kowalski");
|
||||
|
||||
assertTrue(result.isPresent());
|
||||
assertEquals("1234567", result.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
void lookupPwz_multipleMatches_returnsEmpty() {
|
||||
PwzLookupClient client = fullName -> List.of("1234567", "7654321");
|
||||
PwzRegistrySource source = new PwzRegistrySource(client);
|
||||
|
||||
Optional<String> result = source.lookupPwz("Jan Kowalski");
|
||||
|
||||
assertFalse(result.isPresent(), "Multiple matches should return empty (ambiguity)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void lookupPwz_noMatch_returnsEmpty() {
|
||||
PwzLookupClient client = fullName -> List.of();
|
||||
PwzRegistrySource source = new PwzRegistrySource(client);
|
||||
|
||||
Optional<String> result = source.lookupPwz("Jan Kowalski");
|
||||
|
||||
assertFalse(result.isPresent(), "No match should return empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
void lookupPwz_nullClient_returnsEmpty() {
|
||||
PwzRegistrySource source = new PwzRegistrySource(null);
|
||||
|
||||
Optional<String> result = source.lookupPwz("Jan Kowalski");
|
||||
|
||||
assertFalse(result.isPresent());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
["1234567", "7654321"]
|
||||
@@ -0,0 +1 @@
|
||||
["1234567"]
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+2
@@ -14,6 +14,7 @@ com/developx/szpitale/load/GraphSchema.class
|
||||
com/developx/szpitale/model/enums/OrganType.class
|
||||
com/developx/szpitale/model/RawHospitalRecord$RawMandate.class
|
||||
com/developx/szpitale/model/enums/ConfidenceLevel.class
|
||||
com/developx/szpitale/ingest/source/PwzRegistrySource.class
|
||||
com/developx/szpitale/ingest/normalize/NameNormalizer.class
|
||||
com/developx/szpitale/model/RawHospitalRecord$RawPersonEntry.class
|
||||
com/developx/szpitale/model/enums/SupervisoryBodyType.class
|
||||
@@ -22,5 +23,6 @@ com/developx/szpitale/model/RawHospitalRecord.class
|
||||
com/developx/szpitale/ingest/CanonicalWriter.class
|
||||
com/developx/szpitale/load/GraphLoader$LoadStats.class
|
||||
com/developx/szpitale/model/enums/RoleType.class
|
||||
com/developx/szpitale/ingest/source/PwzLookupClient.class
|
||||
com/developx/szpitale/model/enums/LegalForm.class
|
||||
com/developx/szpitale/model/enums/RoleStatus.class
|
||||
|
||||
+2
@@ -6,6 +6,8 @@
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/main/java/com/developx/szpitale/ingest/normalize/NameNormalizer.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/main/java/com/developx/szpitale/ingest/normalize/PartyNormalizer.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/main/java/com/developx/szpitale/ingest/source/MarkdownRegistrySource.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/main/java/com/developx/szpitale/ingest/source/PwzLookupClient.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/main/java/com/developx/szpitale/ingest/source/PwzRegistrySource.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/main/java/com/developx/szpitale/ingest/source/VoivodeshipSource.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/main/java/com/developx/szpitale/load/CanonicalReader.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/main/java/com/developx/szpitale/load/GraphLoader.java
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
com/developx/szpitale/ingest/normalize/NameNormalizerTest.class
|
||||
com/developx/szpitale/ingest/normalize/PartyNormalizerTest.class
|
||||
com/developx/szpitale/model/PersonTest.class
|
||||
com/developx/szpitale/ingest/source/PwzRegistrySourceTest.class
|
||||
com/developx/szpitale/ingest/source/MarkdownRegistrySourceTest.class
|
||||
com/developx/szpitale/ingest/normalize/DeduplicatorTest.class
|
||||
com/developx/szpitale/load/CanonicalRoundTripTest.class
|
||||
|
||||
+1
@@ -2,5 +2,6 @@
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/test/java/com/developx/szpitale/ingest/normalize/NameNormalizerTest.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/test/java/com/developx/szpitale/ingest/normalize/PartyNormalizerTest.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/test/java/com/developx/szpitale/ingest/source/MarkdownRegistrySourceTest.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/test/java/com/developx/szpitale/ingest/source/PwzRegistrySourceTest.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/test/java/com/developx/szpitale/load/CanonicalRoundTripTest.java
|
||||
/home/kruszewskia/Workspace/Private/Szpitale-graph/szpitale-graph/src/test/java/com/developx/szpitale/model/PersonTest.java
|
||||
|
||||
+4
-4
File diff suppressed because one or more lines are too long
+20
-20
File diff suppressed because one or more lines are too long
+9
-9
File diff suppressed because one or more lines are too long
+7
-7
File diff suppressed because one or more lines are too long
+62
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Test set: com.developx.szpitale.ingest.normalize.DeduplicatorTest
|
||||
-------------------------------------------------------------------------------
|
||||
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 s -- in com.developx.szpitale.ingest.normalize.DeduplicatorTest
|
||||
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s -- in com.developx.szpitale.ingest.normalize.DeduplicatorTest
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Test set: com.developx.szpitale.ingest.normalize.NameNormalizerTest
|
||||
-------------------------------------------------------------------------------
|
||||
Tests run: 25, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.081 s -- in com.developx.szpitale.ingest.normalize.NameNormalizerTest
|
||||
Tests run: 25, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.068 s -- in com.developx.szpitale.ingest.normalize.NameNormalizerTest
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Test set: com.developx.szpitale.ingest.normalize.PartyNormalizerTest
|
||||
-------------------------------------------------------------------------------
|
||||
Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.010 s -- in com.developx.szpitale.ingest.normalize.PartyNormalizerTest
|
||||
Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.021 s -- in com.developx.szpitale.ingest.normalize.PartyNormalizerTest
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Test set: com.developx.szpitale.ingest.source.MarkdownRegistrySourceTest
|
||||
-------------------------------------------------------------------------------
|
||||
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.101 s -- in com.developx.szpitale.ingest.source.MarkdownRegistrySourceTest
|
||||
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.097 s -- in com.developx.szpitale.ingest.source.MarkdownRegistrySourceTest
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Test set: com.developx.szpitale.ingest.source.PwzRegistrySourceTest
|
||||
-------------------------------------------------------------------------------
|
||||
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 s -- in com.developx.szpitale.ingest.source.PwzRegistrySourceTest
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Test set: com.developx.szpitale.load.CanonicalRoundTripTest
|
||||
-------------------------------------------------------------------------------
|
||||
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.165 s -- in com.developx.szpitale.load.CanonicalRoundTripTest
|
||||
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.193 s -- in com.developx.szpitale.load.CanonicalRoundTripTest
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Test set: com.developx.szpitale.model.PersonTest
|
||||
-------------------------------------------------------------------------------
|
||||
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s -- in com.developx.szpitale.model.PersonTest
|
||||
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s -- in com.developx.szpitale.model.PersonTest
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1 @@
|
||||
["1234567", "7654321"]
|
||||
@@ -0,0 +1 @@
|
||||
["1234567"]
|
||||
Reference in New Issue
Block a user