浏览代码

Bug Fixes
Fixes #68, fixes #69

Andrew Grant 5 月之前
父节点
当前提交
1160cb5f90

+ 1 - 1
src/main/java/scot/carricksoftware/grants/constants/ApplicationConstants.java

@@ -20,7 +20,7 @@ public class ApplicationConstants {
     public static final int DEFAULT_PAGE_SIZE = 15;
     public static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("dd/MM/yyyy");
     public static final String DATE_FORMAT = "dd/MM/yyyy";
-    public static final String DATE_TIME_FORMAT = "dd/MM/yyyy hh:mm";
+    public static final String DATE_TIME_FORMAT = "dd/MM/yyyy HH:mm";
     public final static String EMPTY_STRING = "";
 
     public static final int MINIMUM_NAME_LENGTH = 3;

+ 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=dev
+spring.profiles.active=uat
 logging.level.scot.carricksoftware=trace
 
 

+ 11 - 0
src/main/resources/db/changelog/2025/07/04-01-changelog.sql

@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+-- liquibase formatted sql
+
+-- changeset apg:1751586990584-1
+ALTER TABLE birth_certificate
+    ADD mother_usual_residence_id        BIGINT       NULL,
+    ADD untracked_mother_usual_residence VARCHAR(255) NULL;

+ 12 - 0
src/main/resources/db/changelog/2025/07/04-02-changelog.sql

@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+-- liquibase formatted sql
+
+
+-- changeset apg:1751586990584-3
+ALTER TABLE birth_certificate
+    ADD CONSTRAINT FK_BIRTHCERTIFICATE_ON_MOTHER_USUAL_RESIDENCE FOREIGN KEY (mother_usual_residence_id) REFERENCES place (id);
+

+ 2 - 0
src/main/resources/db/changelog/master.xml

@@ -38,6 +38,8 @@
     <include file="/db/changelog/2025/07/01-01-changelog.sql"/>
     <include file="/db/changelog/2025/07/01-02-changelog.sql"/>
     <include file="/db/changelog/2025/07/02-01-changelog.sql"/>
+    <include file="/db/changelog/2025/07/04-01-changelog.sql"/>
+    <include file="/db/changelog/2025/07/04-02-changelog.sql"/>
 
 
 </databaseChangeLog>

+ 1 - 1
src/main/resources/templates/certificates/birthCertificate/form.html

@@ -117,7 +117,7 @@
                             <!--/*@thymesVar id="organisations" type="scot.carricksoftware.grants.domains.places.Organisation"*/-->
                             <option th:each="organisation : ${organisations}"
                                     th:value="${organisation.id}" th:text="${organisation.name}"></option>
-                        </select>i
+                        </select>
                     </div>
                     <div th:if="${#fields.hasErrors('registrationAuthority')}">
                         <ul class="text-danger">

+ 49 - 0
src/test/java/scot/carricksoftware/grants/validators/helpers/ValidatePastDateAndTimeRegressionTest.java

@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.validators.helpers;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.springframework.validation.BindingResult;
+
+import static org.mockito.Mockito.verifyNoInteractions;
+
+
+@ExtendWith(MockitoExtension.class)
+class ValidatePastDateAndTimeRegressionTest {
+    private ValidateDateTypes validator;
+
+    private String field;
+    private String nullMessage;
+    private String formatMessage;
+    private String pastMessage;
+
+    @Mock
+    private BindingResult bindingResultMock;
+
+    @BeforeEach
+    void setUp() {
+        validator = new ValidateDateTypesImpl();
+        field = "field";
+        nullMessage = "null-message";
+        formatMessage = "format-message";
+        pastMessage = "past-message";
+    }
+
+
+    @Test
+    void valid24HourTimeTest() {
+        validator.validatePastDateAndTime("25/01/1953 17:25", field, nullMessage, formatMessage, pastMessage, bindingResultMock);
+        verifyNoInteractions(bindingResultMock);
+    }
+
+
+
+
+}