Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/main/java/apiCalls/Utils/volBuilders/VehicleSizeBuilder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package apiCalls.Utils.volBuilders;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class VehicleSizeBuilder {

@JsonProperty("id")
private String id;

@JsonProperty("psvVehicleSize")
private String psvVehicleSize;

@JsonProperty("version")
private Integer version;

public VehicleSizeBuilder withId(String id) {
this.id = id;
return this;
}

public VehicleSizeBuilder withPsvVehicleSize(String psvVehicleSize) {
this.psvVehicleSize = psvVehicleSize;
return this;
}

public VehicleSizeBuilder withVersion(Integer version) {
this.version = version;
return this;
}
}
39 changes: 19 additions & 20 deletions src/main/java/apiCalls/actions/CreateApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ public CreateApplication(RegisterUser registerUser, UserDetails getUserDetails)
setCountryCode("GB");

// PSV details
setPsvVehicleSize("psvvs_both");
setPsvVehicleSize("psvvs_medium_large");
setPsvNoSmallVhlConfirmation("Y");
setPsvOperateSmallVhl("Y");
setPsvSmallVhlNotes("submitted through the API");
Expand Down Expand Up @@ -1384,25 +1384,24 @@ public synchronized ValidatableResponse addVehicleDetails() throws HttpException
return apiResponse;
}

// NO LONGER USED
// public synchronized ValidatableResponse submitVehicleDeclaration() throws HttpException {
// if (licenceType.equals(LicenceType.SPECIAL_RESTRICTED.asString())) {
// return null;
// }
//
// var vehicleDeclarationResource = ApiUrl.build(env, String.format(String.format("application/%s/vehicle-declaration/submit", applicationId))).toString();
// int applicationVersion = Integer.parseInt(fetchApplicationInformation(getApplicationId(), "version", "1"));
//
// VehicleDeclarationBuilder vehicleDeclarationBuilder = new VehicleDeclarationBuilder().withId(getApplicationId()
// ).withPsvVehicleSize(psvVehicleSize)
// .withPsvLimousines(psvLimousines).withPsvNoSmallVhlConfirmation(psvNoSmallVhlConfirmation).withPsvOperateSmallVhl(psvOperateSmallVhl).withPsvSmallVhlNotes(psvSmallVhlNotes)
// .withPsvNoLimousineConfirmation(psvNoLimousineConfirmation).withPsvOnlyLimousinesConfirmation(psvOnlyLimousinesConfirmation).withVersion(applicationVersion);
// apiResponse = RestUtils.post(vehicleDeclarationBuilder, vehicleDeclarationResource, apiHeaders.getApiHeader());
//
// Utils.checkHTTPStatusCode(apiResponse, HttpStatus.SC_OK);
//
// return apiResponse;
// }
public synchronized ValidatableResponse submitVehicleSize() throws HttpException {
if (licenceType.equals(LicenceType.SPECIAL_RESTRICTED.asString())) {
return null;
}

var vehicleSizeResource = ApiUrl.build(env, String.format("application/%s/vehicle-size", applicationId)).toString();
int applicationVersion = Integer.parseInt(fetchApplicationInformation(getApplicationId(), "version", "1"));

VehicleSizeBuilder vehicleSizeBuilder = new VehicleSizeBuilder()
.withId(getApplicationId())
.withPsvVehicleSize(psvVehicleSize)
.withVersion(applicationVersion);
apiResponse = RestUtils.put(vehicleSizeBuilder, vehicleSizeResource, apiHeaders.getApiHeader());

Utils.checkHTTPStatusCode(apiResponse, HttpStatus.SC_OK);

return apiResponse;
}

public synchronized ValidatableResponse addFinancialHistory() throws HttpException {
if (operatorType.equals(OperatorType.PUBLIC.asString()) && (licenceType.equals(LicenceType.SPECIAL_RESTRICTED.asString()))) {
Expand Down
Loading