Skip to content

Commit 3dba471

Browse files
committed
Added missing fields in Route Parameters, and Orders
1 parent 907dd53 commit 3dba471

10 files changed

+479
-5
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>io.github.route4me</groupId>
66
<artifactId>route4me-java-sdk</artifactId>
7-
<version>1.9.0</version>
7+
<version>1.9.1</version>
88
<packaging>jar</packaging>
99
<properties>
1010
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/com/route4me/sdk/examples/MultipleDepotMultipleDriverCapacity.java

+258
Large diffs are not rendered by default.

src/main/java/com/route4me/sdk/examples/routes/dynamic/insert/DynamicInsertStopEndOfRoute.java

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public static void main(String[] args) {
4848
RoutingManager routeManager = new RoutingManager(apiKey);
4949

5050
Address address = new Address("Ascension St. Vincent Hospital - Indianapolis", 39.921478, -86.175649);
51+
5152
try {
5253
List<MatchedRoute> matchedRoutes = dynamicManager.lookForNewDestination("2022-04-27", address.getLatitude(), address.getLongitude(), InsertMode.END_OF_ROUTE, RecommendedBy.DISTANCE, 5);
5354
for (MatchedRoute matchedRoute : matchedRoutes) {

src/main/java/com/route4me/sdk/examples/routes/dynamic/insert/DynamicInsertStopOptimalAfterLastVisited.java

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public static void main(String[] args) {
4848
RoutingManager routeManager = new RoutingManager(apiKey);
4949

5050
Address address = new Address("Ascension St. Vincent Hospital - Indianapolis", 39.921478, -86.175649);
51+
5152
try {
5253
List<MatchedRoute> matchedRoutes = dynamicManager.lookForNewDestination("2022-04-27", address.getLatitude(), address.getLongitude(), InsertMode.OPTIMAL_AFTER_LAST_VISITED, RecommendedBy.DISTANCE, 5);
5354
for (MatchedRoute matchedRoute : matchedRoutes) {

src/main/java/com/route4me/sdk/examples/routes/dynamic/insert/DynamicInsertStopOptimalAnywhere.java

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public static void main(String[] args) {
4848
RoutingManager routeManager = new RoutingManager(apiKey);
4949

5050
Address address = new Address("Ascension St. Vincent Hospital - Indianapolis", 39.921478, -86.175649);
51+
5152
try {
5253
List<MatchedRoute> matchedRoutes = dynamicManager.lookForNewDestination("2022-04-27", address.getLatitude(), address.getLongitude(), InsertMode.OPTIMAL_ANYWHERE, RecommendedBy.DISTANCE, 5);
5354
for (MatchedRoute matchedRoute : matchedRoutes) {

src/main/java/com/route4me/sdk/services/orders/Order.java

+21-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
public class Order {
99
@SerializedName("created_timestamp")
1010
private Long created;
11+
@SerializedName("updated_timestamp")
12+
private Long updatedTimestamp;
1113
@SerializedName("order_id")
1214
private Long id;
1315
@SerializedName("order_status_id")
@@ -48,6 +50,10 @@ public class Order {
4850
private String city;
4951
@SerializedName("address_state_id")
5052
private String stateID;
53+
@SerializedName("address_country_id")
54+
private String addressCountryID;
55+
@SerializedName("address_zip")
56+
private String addressZip;
5157
@SerializedName("cached_lat")
5258
private Double cachedLatitude;
5359
@SerializedName("cached_lng")
@@ -62,7 +68,6 @@ public class Order {
6268
private Long lastVisited;
6369
@SerializedName("last_routed_timestamp")
6470
private Long lastRouted;
65-
6671
@SerializedName("local_time_window_start")
6772
private Long localTimeWindowStart;
6873
@SerializedName("local_time_window_end")
@@ -79,7 +84,6 @@ public class Order {
7984
private String color;
8085
@SerializedName("order_icon")
8186
private String orderIcon;
82-
8387
@SerializedName("is_validated")
8488
private Boolean validated;
8589
@SerializedName("is_pending")
@@ -94,4 +98,19 @@ public class Order {
9498
private Integer lastStatus;
9599
@SerializedName("tracking_number")
96100
private String trackingNumber;
101+
@SerializedName("visited_count")
102+
private Integer visitedCount;
103+
@SerializedName("address_stop_type")
104+
private String addressStopType;
105+
@SerializedName("sorted_on_date")
106+
private String sortedOnDate;
107+
@SerializedName("root_member_id")
108+
private Integer rootMemberID;
109+
@SerializedName("organization_id")
110+
private Integer organizationID;
111+
@SerializedName("done_day_id")
112+
private Integer doneDayID;
113+
@SerializedName("custom_user_fields")
114+
private OrderCustomUserFields customUserFields;
115+
97116
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright 2022 Route4Me.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
package com.route4me.sdk.services.orders;
25+
26+
import com.google.gson.annotations.SerializedName;
27+
import java.util.List;
28+
import lombok.Data;
29+
30+
/**
31+
*
32+
* @author route4me
33+
*/
34+
@Data
35+
class OrderCustomFieldTypeInfo {
36+
37+
@SerializedName("short_label")
38+
private String shortLabel;
39+
@SerializedName("short_caption")
40+
private String shortCaption;
41+
@SerializedName("allowed_values")
42+
private List<String> allowedValues;
43+
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright 2022 Route4Me.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
package com.route4me.sdk.services.orders;
25+
26+
import com.google.gson.annotations.SerializedName;
27+
import lombok.Data;
28+
29+
/**
30+
*
31+
* @author route4me
32+
*/
33+
@Data
34+
class OrderCustomUserFields {
35+
36+
@SerializedName("order_custom_field_id")
37+
private Integer orderCustomFieldID;
38+
@SerializedName("order_custom_field_name")
39+
private String orderCustomFieldName;
40+
@SerializedName("order_custom_field_label")
41+
private String orderCustomFieldLabel;
42+
@SerializedName("order_custom_field_type")
43+
private String orderCustomFieldType;
44+
@SerializedName("order_custom_field_value")
45+
private String orderCustomFieldValue;
46+
@SerializedName("root_owner_member_id")
47+
private Integer rootOwnerMemberID;
48+
@SerializedName("order_custom_field_type_info")
49+
private OrderCustomFieldTypeInfo orderCustomFieldTypeInfo;
50+
51+
}

src/main/java/com/route4me/sdk/services/routing/Parameters.java

+50-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.route4me.sdk.queryconverter.QueryParameter;
55
import com.route4me.sdk.services.routing.advancedconstraints.AdvancedConstraints;
66
import com.route4me.sdk.services.routing.balance.Balance;
7+
import com.route4me.sdk.services.routing.override.addresses.OverrideAddresses;
78
import java.util.List;
89
import lombok.Data;
910

@@ -30,8 +31,15 @@ public class Parameters {
3031
private String optimize;
3132
@SerializedName("lock_last")
3233
private Boolean lockLast;
34+
@QueryParameter("ignore_tw")
35+
@SerializedName("ignore_tw")
36+
private Boolean ignoreTW;
3337
@SerializedName("vehicle_capacity")
34-
private String vehicleCapacity;
38+
private Integer vehicleCapacity;
39+
@SerializedName("vehicle_max_cargo_weight")
40+
private Double vehicleMaxCargoWeight;
41+
@SerializedName("vehicle_max_cargo_volume")
42+
private Double vehicleMaxCargoVolume;
3543
@SerializedName("vehicle_max_distance_mi")
3644
private String vehicleMaxDistanceMi;
3745
@SerializedName("distance_unit")
@@ -110,6 +118,9 @@ public class Parameters {
110118
@QueryParameter("advanced_constraints")
111119
@SerializedName("advanced_constraints")
112120
private List<AdvancedConstraints> advancedConstraints;
121+
@QueryParameter("override_addresses")
122+
@SerializedName("override_addresses")
123+
private OverrideAddresses overrideAddresses;
113124
@SerializedName("is_dynamic_start_time")
114125
private Boolean isDynamicStartTime;
115126
@SerializedName("depots")
@@ -120,9 +131,46 @@ public class Parameters {
120131
@QueryParameter("balance")
121132
@SerializedName("balance")
122133
private Balance balance;
123-
134+
@QueryParameter("target_duration")
135+
@SerializedName("target_duration")
136+
private Double targetDuration;
137+
@QueryParameter("target_distance")
138+
@SerializedName("target_distance")
139+
private Double targetDistance;
140+
@QueryParameter("target_wait_by_tail_size")
141+
@SerializedName("target_wait_by_tail_size")
142+
private Double targetWaitByTailSize;
143+
@QueryParameter("dev_lat")
144+
@SerializedName("dev_lat")
145+
private Double devLat;
146+
@QueryParameter("dev_lng")
147+
@SerializedName("dev_lng")
148+
private Double devLng;
149+
@QueryParameter("avoidance_zones")
150+
@SerializedName("avoidance_zones")
151+
private List<String> avoidanceZones;
152+
@QueryParameter("subtour_max_revenue")
153+
@SerializedName("subtour_max_revenue")
154+
private Integer subtourMaxRevenue;
155+
156+
124157
public void isUseMixedPickupDeliveryDemands(boolean useMixedPickupDeliveryDemands) {
125158
this.useMixedPickupDeliveryDemands = useMixedPickupDeliveryDemands;
126159
}
127160

161+
/**
162+
* @param vehicleCapacity the vehicleCapacity to set
163+
*/
164+
public void setVehicleCapacity(Integer vehicleCapacity) {
165+
this.vehicleCapacity = vehicleCapacity;
166+
}
167+
168+
/**
169+
* @param vehicleCapacity the vehicleCapacity to set
170+
*/
171+
public void setVehicleCapacity(String vehicleCapacity) {
172+
this.vehicleCapacity = Integer.parseInt(vehicleCapacity);
173+
}
174+
175+
128176
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright 2022 Route4Me.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
package com.route4me.sdk.services.routing.override.addresses;
25+
26+
import com.google.gson.annotations.SerializedName;
27+
import com.route4me.sdk.queryconverter.QueryParameter;
28+
import lombok.Data;
29+
30+
/**
31+
*
32+
* @author route4me
33+
*/
34+
35+
@Data
36+
public class OverrideAddresses {
37+
38+
@QueryParameter("time")
39+
@SerializedName("time")
40+
private Integer time;
41+
@QueryParameter("address_stop_type")
42+
@SerializedName("address_stop_type")
43+
private String addressStopType;
44+
@QueryParameter("group")
45+
@SerializedName("group")
46+
private String group;
47+
48+
49+
50+
51+
}

0 commit comments

Comments
 (0)