Skip to content
Merged
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
39 changes: 20 additions & 19 deletions src/main/java/apiCalls/actions/CreateApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -1384,25 +1384,26 @@ 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 submitVehicleDeclaration() throws HttpException {
if (licenceType.equals(LicenceType.SPECIAL_RESTRICTED.asString())) {
return null;
}
if (!operatorType.equals(OperatorType.PUBLIC.asString())) {
return null;
}

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

VehicleDeclarationBuilder vehicleDeclarationBuilder = new VehicleDeclarationBuilder().withId(getApplicationId())
.withPsvVehicleSize(psvVehicleSize)
.withVersion(applicationVersion);
apiResponse = RestUtils.put(vehicleDeclarationBuilder, 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