Parcourir la source

Day married, month year added to marriage domain

Andrew Grant il y a 4 mois
Parent
commit
9282bf800d

+ 35 - 0
src/main/java/scot/carricksoftware/grants/domains/certificates/MarriageCertificate.java

@@ -127,6 +127,17 @@ public class MarriageCertificate extends BaseCertificate {
     @Column(name = "`untracked_second_witness`")
     private String untrackedSecondWitness;
 
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name = "`year_married`")
+    private String yearMarried;
+
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name = "`month_married`")
+    private String monthMarried;
+
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name = "`day_married`")
+    private String dayMarried;
 
     public Person getBride() {
         return bride;
@@ -370,4 +381,28 @@ public class MarriageCertificate extends BaseCertificate {
     public void setGroomFatherRank(String groomFatherRank) {
         this.groomFatherRank = groomFatherRank;
     }
+
+    public String getYearMarried() {
+        return yearMarried;
+    }
+
+    public void setYearMarried(String yearMarried) {
+        this.yearMarried = yearMarried;
+    }
+
+    public String getMonthMarried() {
+        return monthMarried;
+    }
+
+    public void setMonthMarried(String monthMarried) {
+        this.monthMarried = monthMarried;
+    }
+
+    public String getDayMarried() {
+        return dayMarried;
+    }
+
+    public void setDayMarried(String dayMarried) {
+        this.dayMarried = dayMarried;
+    }
 }

+ 1 - 1
src/main/java/scot/carricksoftware/grants/services/certificates/marriagecertificates/MarriageCertificateServiceImpl.java

@@ -73,7 +73,7 @@ public class MarriageCertificateServiceImpl implements MarriageCertificateServic
     }
 
     private Sort getSort() {
-        return Sort.by(Sort.Direction.ASC, "id");
+        return Sort.by(Sort.Direction.ASC, "whenMarried");
     }
 
     @Override

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

@@ -2,5 +2,5 @@ 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

+ 2 - 2
src/main/resources/templates/certificates/marriageCertificate/list.html

@@ -22,7 +22,7 @@
     <table class="table table-striped table-bordered">
         <thead class="table-dark">
         <tr>
-            <th>ID</th>
+            <th>Date</th>
             <th>Bride</th>
             <th>Groom</th>
             <th></th>
@@ -31,7 +31,7 @@
 
         <tr th:each="certificate   : ${marriageCertificates}">
 
-            <td th:text="${certificate.id}">123</td>
+            <td th:text="${certificate.whenMarried}">1/2/3</td>
             <td th:text="${certificate.bride}">John Doe</td>
             <td th:text="${certificate.groom}">John Doe</td>
             <td><span>