Browse Source

Birth Certificate mother and father place added to command

Andrew Grant 5 months ago
parent
commit
e1931bb378

+ 8 - 0
src/main/java/scot/carricksoftware/grants/commands/certificates/birthcertificates/BirthCertificateCommand.java

@@ -130,4 +130,12 @@ public interface BirthCertificateCommand {
     String getUntrackedMotherUsualResidence();
 
     void setUntrackedMotherUsualResidence(String untrackedMotherUsualResidence);
+
+    String getMotherPlaceOfBirth();
+
+    void setMotherPlaceOfBirth(String motherPlaceOfBirth);
+
+    String getFatherPlaceOfBirth();
+
+    void setFatherPlaceOfBirth(String fatherPlaceOfBirth);
 }

+ 25 - 0
src/main/java/scot/carricksoftware/grants/commands/certificates/birthcertificates/BirthCertificateCommandImpl.java

@@ -69,6 +69,10 @@ public class BirthCertificateCommandImpl implements BirthCertificateCommand {
 
     private String informantResidence;
 
+    private String motherPlaceOfBirth;
+
+    private String fatherPlaceOfBirth;
+
     public Long getId() {
         return Id;
     }
@@ -347,4 +351,25 @@ public class BirthCertificateCommandImpl implements BirthCertificateCommand {
     public void setUntrackedMotherUsualResidence(String untrackedMotherUsualResidence) {
         this.untrackedMotherUsualResidence = untrackedMotherUsualResidence;
     }
+
+    @Override
+    public String getMotherPlaceOfBirth() {
+        return motherPlaceOfBirth;
+    }
+
+    @Override
+    public void setMotherPlaceOfBirth(String motherPlaceOfBirth) {
+        this.motherPlaceOfBirth = motherPlaceOfBirth;
+    }
+
+
+    @Override
+    public String getFatherPlaceOfBirth() {
+        return fatherPlaceOfBirth;
+    }
+
+    @Override
+    public void setFatherPlaceOfBirth(String fatherPlaceOfBirth) {
+        this.fatherPlaceOfBirth = fatherPlaceOfBirth;
+    }
 }

+ 49 - 0
src/test/java/scot/carricksoftware/grants/commands/certificates/BirthCertificatePlaceOfBirthTest.java

@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 24/03/2025, 17:31. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.commands.certificates;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
+import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+
+class BirthCertificatePlaceOfBirthTest {
+
+    private BirthCertificateCommand command;
+
+    @BeforeEach
+    void setUp() {
+        command = new BirthCertificateCommandImpl();
+    }
+
+    @Test
+    public void getMotherPlaceOfBirthTest() {
+        assertNull(command.getMotherPlaceOfBirth());
+    }
+
+    @Test
+    public void setMotherPlaceOfBirthTest() {
+        String placeOfBirth = GetRandomString();
+        command.setMotherPlaceOfBirth(placeOfBirth);
+        assertEquals(placeOfBirth, command.getMotherPlaceOfBirth());
+    }
+
+    @Test
+    public void getFatherPlaceOfBirthTest() {
+        assertNull(command.getFatherPlaceOfBirth());
+    }
+
+    @Test
+    public void setFatherPlaceOfBirthTest() {
+        String placeOfBirth = GetRandomString();
+        command.setFatherPlaceOfBirth(placeOfBirth);
+        assertEquals(placeOfBirth, command.getFatherPlaceOfBirth());
+    }
+}