Browse Source

Birth Certificate mother and father place added to domain

Andrew Grant 5 months ago
parent
commit
c5db8f04ba

+ 23 - 0
src/main/java/scot/carricksoftware/grants/domains/certificates/BirthCertificate.java

@@ -110,6 +110,14 @@ public class BirthCertificate extends BaseCertificate {
     @Column(name="`untracked_mother_usual_residence`")
     private String untrackedMotherUsualResidence;
 
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name="`father_place_of_birth`")
+    private String fatherPlaceOfBirth;
+
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name="`mother_place_of_birth`")
+    private String motherPlaceOfBirth;
+
     public Person getNewBorn() {
         return newBorn;
     }
@@ -272,4 +280,19 @@ public class BirthCertificate extends BaseCertificate {
         this.untrackedMotherUsualResidence = untrackedMotherUsualResidence;
     }
 
+    public String getFatherPlaceOfBirth() {
+        return fatherPlaceOfBirth;
+    }
+
+    public void setFatherPlaceOfBirth(String fatherPlaceOfBirth) {
+        this.fatherPlaceOfBirth = fatherPlaceOfBirth;
+    }
+
+    public String getMotherPlaceOfBirth() {
+        return motherPlaceOfBirth;
+    }
+
+    public void setMotherPlaceOfBirth(String motherPlaceOfBirth) {
+        this.motherPlaceOfBirth = motherPlaceOfBirth;
+    }
 }

+ 1 - 1
src/main/resources/application.properties

@@ -2,7 +2,7 @@ spring.application.name=grants
 server.port=8086
 server.servlet.context-path=/grants
 spring.mvc.format.date=dd-MM-yyyy
-spring.profiles.active=uat
+spring.profiles.active=dev
 logging.level.scot.carricksoftware=trace
 
 

+ 48 - 0
src/test/java/scot/carricksoftware/grants/domains/certificates/BirthCertificatePartFourTest.java

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