Kaynağa Gözat

GatherDivorceCertificate

Andrew Grant 1 ay önce
ebeveyn
işleme
34e32d6efd

+ 2 - 5
src/main/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/divorcecertificate/GatherDivorceCertificateFirstPartyTimeLineDataImpl.java

@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component;
 import scot.carricksoftware.grantswriter.data.DMY;
 import scot.carricksoftware.grantswriter.data.TimeLineData;
 import scot.carricksoftware.grantswriter.domains.certificates.divorcecertificate.DivorceCertificate;
-import scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections.helpers.level2.divorcecertificate.helpers.AddDivorceDetails;
 
 
 import java.util.List;
@@ -24,11 +23,9 @@ public class GatherDivorceCertificateFirstPartyTimeLineDataImpl implements Gathe
 
     private static final Logger logger = LogManager.getLogger(GatherDivorceCertificateFirstPartyTimeLineDataImpl.class);
 
-    private final AddDivorceDetails addDivorceDetails;
 
-    public GatherDivorceCertificateFirstPartyTimeLineDataImpl(TimeLineData timelineData, AddDivorceDetails addDivorceDetails) {
+    public GatherDivorceCertificateFirstPartyTimeLineDataImpl(TimeLineData timelineData) {
         this.timelineData = timelineData;
-        this.addDivorceDetails = addDivorceDetails;
     }
 
 
@@ -48,7 +45,7 @@ public class GatherDivorceCertificateFirstPartyTimeLineDataImpl implements Gathe
 
     private void addDivorced(TreeMap<DMY, List<String>> timeLine, DivorceCertificate divorceCertificate) {
         logger.info("GatherDivorceCertificateFirstPartyTimeLineDataImpl::AddDivorce");
-        addDivorceDetails.addDivorceDetails(timeLine, divorceCertificate);
+
 
     }
 

+ 2 - 6
src/main/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/divorcecertificate/GatherDivorceCertificateSecondPartyTimeLineDataImpl.java

@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component;
 import scot.carricksoftware.grantswriter.data.DMY;
 import scot.carricksoftware.grantswriter.data.TimeLineData;
 import scot.carricksoftware.grantswriter.domains.certificates.divorcecertificate.DivorceCertificate;
-import scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections.helpers.level2.divorcecertificate.helpers.AddDivorceDetails;
 
 import java.util.List;
 import java.util.TreeMap;
@@ -23,11 +22,9 @@ public class GatherDivorceCertificateSecondPartyTimeLineDataImpl implements Gath
 
     private static final Logger logger = LogManager.getLogger(GatherDivorceCertificateSecondPartyTimeLineDataImpl.class);
 
-    private final AddDivorceDetails addDivorceDetails;
 
-    public GatherDivorceCertificateSecondPartyTimeLineDataImpl(TimeLineData timelineData, AddDivorceDetails addDivorceDetails) {
+    public GatherDivorceCertificateSecondPartyTimeLineDataImpl(TimeLineData timelineData) {
         this.timelineData = timelineData;
-        this.addDivorceDetails = addDivorceDetails;
     }
 
     @Override
@@ -45,8 +42,7 @@ public class GatherDivorceCertificateSecondPartyTimeLineDataImpl implements Gath
     }
 
     private void addDivorced(TreeMap<DMY, List<String>> timeLine, DivorceCertificate divorceCertificate) {
-        logger.info("GatherDivorceCertificateFirstPartyTimeLineDataImpl::AddDivorce");
-        addDivorceDetails.addDivorceDetails(timeLine, divorceCertificate);
+        logger.info("GatherDivorceCertificateFirstPartyTimeLineDataImpl::AddDivorced");
 
     }
 }

+ 0 - 16
src/main/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/divorcecertificate/helpers/AddDivorceDetails.java

@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
- *
- */
-
-package scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections.helpers.level2.divorcecertificate.helpers;
-
-import scot.carricksoftware.grantswriter.data.DMY;
-import scot.carricksoftware.grantswriter.domains.certificates.divorcecertificate.DivorceCertificate;
-
-import java.util.List;
-import java.util.TreeMap;
-
-public interface AddDivorceDetails {
-    void addDivorceDetails(TreeMap<DMY, List<String>> timeLine, DivorceCertificate divorceCertificate);
-}

+ 0 - 38
src/main/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/divorcecertificate/helpers/AddDivorceDetailsImpl.java

@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
- *
- */
-
-package scot.carricksoftware.grantswriter.writer.latex.parts.people.subsections.helpers.level2.divorcecertificate.helpers;
-
-import org.springframework.stereotype.Component;
-import scot.carricksoftware.grantswriter.converters.StringToDMYConverter;
-import scot.carricksoftware.grantswriter.data.DMY;
-import scot.carricksoftware.grantswriter.domains.certificates.divorcecertificate.DivorceCertificate;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.TreeMap;
-
-@Component
-public class AddDivorceDetailsImpl implements AddDivorceDetails {
-
-    private final StringToDMYConverter stringToDMYConverter;
-
-    public AddDivorceDetailsImpl(StringToDMYConverter stringToDMYConverter) {
-        this.stringToDMYConverter = stringToDMYConverter;
-    }
-
-    @Override
-    public void addDivorceDetails(TreeMap<DMY, List<String>> timeLine, DivorceCertificate divorceCertificate) {
-        List<String> existingValues = timeLine.get(stringToDMYConverter.convert(divorceCertificate.getRegisteredDate()));
-        if (existingValues == null) {
-            existingValues = new ArrayList<>();
-        }
-
-        existingValues.add("Witnessed the marriage of " + divorceCertificate.getFirstParty().toString() + " and " + divorceCertificate.getSecondParty().toString());
-
-        timeLine.put(stringToDMYConverter.convert(divorceCertificate.getRegisteredDate()), existingValues);
-    }
-
-}

+ 6 - 0
src/test/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/GatherTimeLineDataTest.java

@@ -71,4 +71,10 @@ class GatherTimeLineDataTest {
         verify(gatherMarriageCertificateTimeLineDataMock).gather(personMock);
     }
 
+    @Test
+    void gatherDivorceCertificateDataTest() {
+        gatherTimeLineData.gather(personMock);
+        verify(gatherDivorceCertificateTimeLineDataMock).gather(personMock);
+    }
+
 }