Skip to content

Commit

Permalink
feat(vta-1566): pushing up loggers and changes for spike
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-cs committed Aug 22, 2023
1 parent da9e699 commit 769f360
Show file tree
Hide file tree
Showing 9 changed files with 504 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/main/java/uk/gov/dvsa/PdfGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public PdfGenerator() {
public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) {
long start = System.nanoTime();
eventLogger.logEvent(EventType.CERT_REQUEST_RECEIVED);

System.out.println("*** This is the input from the handleRequest method: ");
System.out.println(input);

try {
if (input.containsKey(requestParser.REQUEST_HEADERS)) {
// Trace headers only they are provided in the input request, else ignore.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/uk/gov/dvsa/enums/CertificateTemplates.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public enum CertificateTemplates {
VTP30("CommercialVehicles/fail"),

VTG5("CommercialVehicles/passNoSeatbeltFields"),
VTG5W("CommercialVehicles/passNoSeatbeltFieldsWelsh"),
VTG5A("CommercialVehicles/passNoSeatbeltFields"),
VTG30("CommercialVehicles/VTG30"),
ADR_PASS("CommercialVehicles/ADR_PASS"),
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/uk/gov/dvsa/enums/CertificateTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public enum CertificateTypes {
CVS_PSV_PRS("CVS/PSV_PRS"),

CVS_HGV_PASS("CVS/VTG5"),
CVS_HGV_PASS_WELSH("CVS/VTG5W"),
CVS_HGV_PASS_BILINGUAL("CVS/VTG5B"),
CVS_TRL_PASS("CVS/VTG5A"),
CVS_HGV_TRL_FAIL("CVS/VTG30"),
CVS_HGV_PRS("CVS/HGV_PRS"),
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/uk/gov/dvsa/enums/DocumentsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public enum DocumentsConfig {
new String[]{CertificateTemplates.VTG5A.getCertificateTemplateName()}),
VTG5(CertificateTypes.CVS_HGV_PASS.getCertificateType(), uk.gov.dvsa.model.cvs.VTG5.class,
new String[]{CertificateTemplates.VTG5.getCertificateTemplateName()}),
VTG5W(CertificateTypes.CVS_HGV_PASS_WELSH.getCertificateType(), uk.gov.dvsa.model.cvs.VTG5W.class,
new String[]{CertificateTemplates.VTG5W.getCertificateTemplateName()}),
VTG30(CertificateTypes.CVS_HGV_TRL_FAIL.getCertificateType(), uk.gov.dvsa.model.cvs.VTG30.class,
new String[]{CertificateTemplates.VTG30.getCertificateTemplateName()}),
ADR_PASS(CertificateTypes.ADR_PASS.getCertificateType(), AdrPassCertificate.class,
Expand All @@ -68,6 +70,8 @@ public enum DocumentsConfig {
new String[]{CertificateTemplates.RWT_DATA.getCertificateTemplateName()}),
CVS_HGV_PRS(CertificateTypes.CVS_HGV_PRS.getCertificateType(), uk.gov.dvsa.model.cvs.CvsHgvPRS.class,
new String[]{CertificateTemplates.VTG5.getCertificateTemplateName(), CertificateTemplates.VTG30.getCertificateTemplateName()}),
CVS_HGV_PASS_B(CertificateTypes.CVS_HGV_PASS_BILINGUAL.getCertificateType(), uk.gov.dvsa.model.cvs.CvsHgvPassBilingual.class,
new String[]{CertificateTemplates.VTG5.getCertificateTemplateName(), CertificateTemplates.VTG5W.getCertificateTemplateName()}),
CVS_TRL_PRS(CertificateTypes.CVS_TRL_PRS.getCertificateType(), uk.gov.dvsa.model.cvs.CvsTrlPRS.class,
new String[]{CertificateTemplates.VTG5A.getCertificateTemplateName(), CertificateTemplates.VTG30.getCertificateTemplateName()}),

Expand All @@ -90,6 +94,7 @@ public Class<? extends Document> getBaseClass() {
}

public static DocumentsConfig fromDocumentName(String name) {
System.out.println("THIS IS THE NAME: " + name);
for (DocumentsConfig document: DocumentsConfig.values()) {
if (document.getDocumentName().equals(name)) {
return document;
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/uk/gov/dvsa/model/cvs/CvsHgvPassBilingual.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package uk.gov.dvsa.model.cvs;

public class CvsHgvPassBilingual extends CvsMotCertificate {
public String getTestType() {
return "HGV";
}

public String getPresentedDocumentNamePass() {
return "VTG5";
}

public String getPresentedDocumentNameFail() {
return "VTG5W";
}

public String getVersionNumberPass() {
return "1.0";
}

public String getVersionNumberFail() {
return "1.0";
}

public String getRegOrIdHeading() { return "Registration number"; }
}
26 changes: 26 additions & 0 deletions src/main/java/uk/gov/dvsa/model/cvs/VTG5W.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package uk.gov.dvsa.model.cvs;

import uk.gov.dvsa.model.Document;
import uk.gov.dvsa.model.cvs.certificateData.CvsMotCertificateData;

public class VTG5W extends CvsMotCertificate {

public Document setData(CvsMotCertificateData data) {
this.data = data;
return this;
}

public String getTestType() {
return "HGV";
}

public String getPresentedDocumentNamePass() {
return "VTG5W";
}

public String getVersionNumberPass() {
return "1.0";
}

public String getRegOrIdHeading() { return "Registration number"; }
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package uk.gov.dvsa.model.cvs.certificateData;

import com.fasterxml.jackson.annotation.JsonProperty;
import uk.gov.dvsa.model.mot.certificateData.MotCertificateData;
import uk.gov.dvsa.model.mot.results.DefectsList;

Expand All @@ -13,7 +14,10 @@ public class CvsMotCertificateDataWelsh extends MotCertificateData {
public static final String PASS_WITH_DEFECTS_HEADER_WELSH = "";
public static final String TESTING_ORGANISATION_WELSH = "";

@JsonProperty("AdvisoryDefectsWelsh")
private List<String> advisoryDefectsWelsh;

@JsonProperty("MinorDefectsWelsh")
private List<String> minorDefectsWelsh;

private String buildSummaryTitle() {
Expand All @@ -28,16 +32,18 @@ public List<String> getAdvisoryDefectsWelsh() {
return advisoryDefectsWelsh;
}

public void setAdvisoryDefectsWelsh(List<String> advisoryDefectsWelsh) {
public CvsMotCertificateDataWelsh setAdvisoryDefectsWelsh(List<String> advisoryDefectsWelsh) {
this.advisoryDefectsWelsh = advisoryDefectsWelsh;
return this;
}

public List<String> getMinorDefectsWelsh() {
return minorDefectsWelsh;
}

public void setMinorDefectsWelsh(List<String> minorDefectsWelsh) {
public CvsMotCertificateDataWelsh setMinorDefectsWelsh(List<String> minorDefectsWelsh) {
this.minorDefectsWelsh = minorDefectsWelsh;
return this;
}

public DefectsList getAdvisoryWelsh() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class CvsMotFailCertificateData extends CvsMotCertificateData {
@JsonProperty("PRSDefects")
private List<String> prsDefects;


public CvsMotFailCertificateData setDangerousDefects(List<String> dangerousDefects) {
this.dangerousDefects = dangerousDefects;
return this;
Expand Down
Loading

0 comments on commit 769f360

Please sign in to comment.