Skip to content

Commit

Permalink
feat(CB2-15349): Generate the VTG/VTP12 Documents (#141)
Browse files Browse the repository at this point in the history
* feat(CB2-15349): Generate the VTG/VTP12 Documents

* feat(CB2-15349): Added new tests for html testing, and vt12.hbs stylesheet build path fix

* feat(CB2-15349): fixes for payload

* feat(CB2-15349): removing print outs

* feat(CB2-15349): adding new fields to match prototype: payload

* feat(CB2-15349): fixes for the look of the VTP12 and VTG12 cert, also updating of tests

* feat(CB2-15349): updating test and vbs for latest requested changes

* feat(CB2-15349): removing fileoutput code and imports

* feat(CB2-15349): minor coding changes

* feat(CB2-15349): removing unneeded comment

* feat(CB2-15349): re-ordering getters and setters

* feat(CB2-15349): re-ordering getters and setters

* feat(CB2-15349): re-ordering getters and setters

* feat(CB2-15349): re-ordering getters and setters

* feat(CB2-15349): re-ordering private and protected properties

* feat(CB2-15349): re-ordering private and protected properties

* feat(CB2-15349): fixes requested from reviews

* feat(CB2-15349): better way of doing tests

* feat(CB2-15349): improving tests

* feat(CB2-15349): html change for correct title

* feat(CB2-15349): fixes for 1998 text bug to 1988
  • Loading branch information
NathanielRichards1 authored Dec 17, 2024
1 parent dd16f9e commit fce23ba
Show file tree
Hide file tree
Showing 18 changed files with 1,034 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/main/java/uk/gov/dvsa/enums/CertificateTemplates.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ public enum CertificateTemplates {

IVA30("CommercialVehicles/IVA30"),

MSVA30("CommercialVehicles/MSVA30");
MSVA30("CommercialVehicles/MSVA30"),

VTG12("CommercialVehicles/Abandoned"),

VTP12("CommercialVehicles/Abandoned");

private final String certificateTemplateName;

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/uk/gov/dvsa/enums/CertificateTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public enum CertificateTypes {

IVA30("CVS/IVA30"),

MSVA30("CVS/MSVA30");
MSVA30("CVS/MSVA30"),
VTG12("CVS/VTG12"),
VTP12("CVS/VTP12");

private final String certificateType;

Expand Down
8 changes: 7 additions & 1 deletion src/main/java/uk/gov/dvsa/enums/DocumentsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ public enum DocumentsConfig {
new String[]{CertificateTemplates.IVA30.getCertificateTemplateName()}),

MSVA30(CertificateTypes.MSVA30.getCertificateType(), MSVA30.class,
new String[]{CertificateTemplates.MSVA30.getCertificateTemplateName()});
new String[]{CertificateTemplates.MSVA30.getCertificateTemplateName()}),

VTG12(CertificateTypes.VTG12.getCertificateType(), VTG12.class,
new String[]{CertificateTemplates.VTG12.getCertificateTemplateName()}),

VTP12(CertificateTypes.VTP12.getCertificateType(), VTP12.class,
new String[]{CertificateTemplates.VTP12.getCertificateTemplateName()});


private final String documentName;
Expand Down
51 changes: 51 additions & 0 deletions src/main/java/uk/gov/dvsa/model/cvs/AbandonedCertificate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package uk.gov.dvsa.model.cvs;

import com.fasterxml.jackson.annotation.JsonProperty;
import uk.gov.dvsa.model.Document;
import uk.gov.dvsa.model.cvs.certificateData.AbandonedData;
import uk.gov.dvsa.model.cvs.certificateData.Signature;

public abstract class AbandonedCertificate extends Document {
protected String regulationText;
protected String vehicleTypeText;
protected String titleTextIncludingRollingHeaders;
protected String sectionTextRef;
protected String formNumber;
@JsonProperty("ABANDONED_DATA")
private AbandonedData data;
@JsonProperty("Signature")
private Signature signature;

public String getRegulationText() { return this.regulationText; }

public String getVehicleTypeText() { return this.vehicleTypeText; }

public String getTitleTextIncludingRollingHeaders() {
return this.titleTextIncludingRollingHeaders;
}

public String getSectionTextRef() { return this.sectionTextRef; }

public String getFormNumber() { return formNumber; }

public AbandonedData getData() {
return data;
}

public Signature getSignature() {
return signature;
}

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

public void setSignature(Signature signature) {
this.signature = signature;
}

public String getDocumentType() {
return this.getDocumentName().split("/")[1];
}
}
13 changes: 13 additions & 0 deletions src/main/java/uk/gov/dvsa/model/cvs/VTG12.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package uk.gov.dvsa.model.cvs;

public class VTG12 extends AbandonedCertificate {

public VTG12() {
super();
super.regulationText = "Regulations 7 and 8 of the Goods Vehicles (Plating and Testing) Regulations 1988 as Amended";
super.vehicleTypeText = "In respect of the goods vehicle with registration number / chassis serial number / trailer identification mark :";
super.titleTextIncludingRollingHeaders = "Goods Vehicle for Examination";
super.formNumber = "0440";
super.sectionTextRef = "49 and 51";
}
}
13 changes: 13 additions & 0 deletions src/main/java/uk/gov/dvsa/model/cvs/VTP12.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package uk.gov.dvsa.model.cvs;

public class VTP12 extends AbandonedCertificate {

public VTP12() {
super();
super.regulationText = "Regulation 13 of the Motor Vehicles (Tests) Regulations 1981 as amended";
super.vehicleTypeText = "In respect of the public service vehicle with registration number / chassis serial number :";
super.titleTextIncludingRollingHeaders = "Public Service Vehicle for Examination";
super.formNumber = "0453";
super.sectionTextRef = "45";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package uk.gov.dvsa.model.cvs.certificateData;

import com.fasterxml.jackson.annotation.JsonProperty;

public class AbandonedData {
@JsonProperty("RegistrationNumber")
private String registrationNumber;
@JsonProperty("ReasonsForRefusal")
private String[] reasonsForRefusal;
@JsonProperty("TestStationName")
private String testStationName;
@JsonProperty("TestStationPNumber")
private String testStationPNumber;
@JsonProperty("IssuersName")
private String issuersName;
@JsonProperty("AdditionalComments")
private String additionalComments;
@JsonProperty("DateOfTheTest")
private String dateOfTheTest;

public AbandonedData() {
}

public AbandonedData(String registrationNumber,
String[] reasonsForRefusal,
String dateOfTheTest,
String testStationName,
String testStationPNumber,
String issuersName,
String additionalComments) {
this.registrationNumber = registrationNumber;
this.reasonsForRefusal = reasonsForRefusal;
this.dateOfTheTest = dateOfTheTest;
this.testStationName = testStationName;
this.testStationPNumber = testStationPNumber;
this.issuersName = issuersName;
this.additionalComments = additionalComments;
}

public String[] getRegistrationNumber() {
return registrationNumber.split("");
}

public String[] getReasonsForRefusal() {
return reasonsForRefusal;
}

public String getTestStationName() {
return testStationName;
}

public String getTestStationPNumber() {
return testStationPNumber;
}

public String getIssuersName() {
return issuersName;
}

public String getAdditionalComments() {
return additionalComments;
}

public String getDateOfTheTest() {
return dateOfTheTest;
}

}
Loading

0 comments on commit fce23ba

Please sign in to comment.