Skip to content

Commit 24e715e

Browse files
pwndedDmitry Koval
andauthored
order_uuid is supported for Order V4. Order V5 API is supported (#14)
* order_uuid is supported for Order V4. Order V5 API is supported. * Fixed mistyping. * Get rid of order_status_id for V5 Order. --------- Co-authored-by: Dmitry Koval <[email protected]>
1 parent 97169c0 commit 24e715e

28 files changed

+1967
-11
lines changed

route4me-csharp-sdk/Route4MeSDKLibrary/Consts.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,13 @@ public static class R4MEInfrastructureSettingsV5
255255
public const string Orders = MainHost + "/orders";
256256
public const string OrdersArchive = Orders + "/archive";
257257
public const string OrdersHistory = Orders + "/history";
258+
public const string OrdersPlatform = MainHost + "/orders-platform";
259+
public const string OrdersPlatformCreate = OrdersPlatform + "/create";
260+
public const string OrdersPlatformBatchUpdateFilter = OrdersPlatform + "/batch-update/filter";
261+
public static string OrdersPlatformBatchDelete = OrdersPlatform + "/batch-delete";
262+
public const string OrdersPlatformBatchUpdate = OrdersPlatform + "/batch-update";
263+
public static string OrdersPlatformBatchCreate = OrdersPlatform + "/batch-create";
264+
public static string OrdersPlatformCustomUserFields = OrdersPlatform + "/order-custom-user-fields";
258265

259266
#endregion
260267

route4me-csharp-sdk/Route4MeSDKLibrary/DataTypes/GeoPoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ public sealed class GeoPoint
1212
/// Latitude
1313
/// </summary>
1414
[DataMember(Name = "lat")]
15-
public double Latitude { get; set; }
15+
public double? Latitude { get; set; }
1616

1717
/// <summary>
1818
/// Longitude
1919
/// </summary>
2020
[DataMember(Name = "lng")]
21-
public double Longitude { get; set; }
21+
public double? Longitude { get; set; }
2222
}
2323
}

route4me-csharp-sdk/Route4MeSDKLibrary/DataTypes/Order.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ public sealed class Order : GenericParameters
3030
[DataMember(Name = "order_id")]
3131
public long OrderId { get; set; }
3232

33+
/// <summary>
34+
/// Order UUID
35+
/// </summary>
36+
[DataMember(Name = "order_uuid")]
37+
public string OrderUuid { get; set; }
38+
3339
/// <summary>
3440
/// Order status ID. Available values:
3541
/// 0: New,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System.Runtime.Serialization;
2+
3+
namespace Route4MeSDKLibrary.DataTypes.V5
4+
{
5+
/// <summary>
6+
/// Batch update orders response
7+
/// </summary>
8+
[DataContract]
9+
public class AsyncStatusResponse
10+
{
11+
/// <summary>
12+
/// Status
13+
/// </summary>
14+
[DataMember(Name = "status", EmitDefaultValue = false)]
15+
public bool Status { get; set; }
16+
17+
/// <summary>
18+
/// Async
19+
/// </summary>
20+
[DataMember(Name = "async", EmitDefaultValue = false)]
21+
public bool Async { get; set; }
22+
}
23+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.Runtime.Serialization;
2+
using Route4MeSDK.QueryTypes;
3+
4+
namespace Route4MeSDKLibrary.DataTypes.V5.Orders
5+
{
6+
/// <summary>
7+
/// Batch create orders request
8+
/// </summary>
9+
[DataContract]
10+
public class BatchCreateOrdersRequest : GenericParameters
11+
{
12+
/// <summary>
13+
/// Organization Api Key
14+
/// </summary>
15+
[HttpQueryMember(Name = "organization_api_key", EmitDefaultValue = false)]
16+
public string OrganizationApiKey { get; set; }
17+
18+
/// <summary>
19+
/// Data
20+
/// </summary>
21+
[DataMember(Name = "data", EmitDefaultValue = false)]
22+
public Order[] Data { get; set; }
23+
}
24+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System.Runtime.Serialization;
2+
using Route4MeSDK.QueryTypes;
3+
4+
namespace Route4MeSDKLibrary.DataTypes.V5.Orders
5+
{
6+
/// <summary>
7+
/// Batch delete orders request
8+
/// </summary>
9+
[DataContract]
10+
public class BatchDeleteOrdersRequest : GenericParameters
11+
{
12+
/// <summary>
13+
/// Order IDs
14+
/// </summary>
15+
[DataMember(Name = "order_ids", EmitDefaultValue = false)]
16+
public string[] OrderIds { get; set; }
17+
}
18+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Runtime.Serialization;
2+
using Route4MeSDK.QueryTypes;
3+
4+
namespace Route4MeSDKLibrary.DataTypes.V5.Orders
5+
{
6+
/// <summary>
7+
/// Batch update orders request
8+
/// </summary>
9+
[DataContract]
10+
public class BatchUpdateFilterOrderRequest : GenericParameters
11+
{
12+
/// <summary>
13+
/// Organization Api Key
14+
/// </summary>
15+
[HttpQueryMemberAttribute(Name = "organization_api_key", EmitDefaultValue = false)]
16+
public string OrganizationApiKey { get; set; }
17+
18+
/// <summary>
19+
/// Data
20+
/// </summary>
21+
[DataMember(Name = "data", EmitDefaultValue = false)]
22+
public Order Data { get; set; }
23+
24+
/// <summary>
25+
/// Search
26+
/// </summary>
27+
[DataMember(Name = "search", EmitDefaultValue = false)]
28+
public SearchParamRequestBody Search { get; set; }
29+
30+
/// <summary>
31+
/// Filters
32+
/// </summary>
33+
[DataMember(Name = "filters", EmitDefaultValue = false)]
34+
public FiltersParamRequestBody Filters { get; set; }
35+
}
36+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System.Runtime.Serialization;
2+
using Route4MeSDK.QueryTypes;
3+
4+
namespace Route4MeSDKLibrary.DataTypes.V5.Orders
5+
{
6+
/// <summary>
7+
/// Batch update orders request
8+
/// </summary>
9+
[DataContract]
10+
public class BatchUpdateOrdersRequest : GenericParameters
11+
{
12+
/// <summary>
13+
/// Order IDs
14+
/// </summary>
15+
[DataMember(Name = "order_ids", EmitDefaultValue = false)]
16+
public string[] OrderIds { get; set; }
17+
18+
/// <summary>
19+
/// Organization Api Key
20+
/// </summary>
21+
[DataMember(Name = "organization_api_key", EmitDefaultValue = false)]
22+
public string OrganizationApiKey { get; set; }
23+
24+
/// <summary>
25+
/// Data
26+
/// </summary>
27+
[DataMember(Name = "data", EmitDefaultValue = false)]
28+
public Order Data { get; set; }
29+
}
30+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System.Runtime.Serialization;
2+
using Newtonsoft.Json.Linq;
3+
using Route4MeSDK.QueryTypes;
4+
5+
namespace Route4MeSDKLibrary.DataTypes.V5.Orders
6+
{
7+
/// <summary>
8+
/// Create custom user fields request
9+
/// </summary>
10+
[DataContract]
11+
public class CreateCustomUserFieldRequest : GenericParameters
12+
{
13+
/// <summary>
14+
/// Custom order field name.
15+
/// </summary>
16+
[DataMember(Name = "order_custom_field_name", EmitDefaultValue = false, IsRequired = false)]
17+
public string OrderCustomFieldName { get; set; }
18+
19+
/// <summary>
20+
/// Custom order field label.
21+
/// </summary>
22+
[DataMember(Name = "order_custom_field_label", EmitDefaultValue = false, IsRequired = false)]
23+
public string OrderCustomFieldLabel { get; set; }
24+
25+
/// <summary>
26+
/// Custom order field type.
27+
/// </summary>
28+
[DataMember(Name = "order_custom_field_type", EmitDefaultValue = false, IsRequired = false)]
29+
public string OrderCustomFieldType { get; set; }
30+
31+
/// <summary>
32+
/// Custom order field type info.
33+
/// </summary>
34+
[DataMember(Name = "order_custom_field_type_info", EmitDefaultValue = false, IsRequired = false)]
35+
public JObject OrderCustomFieldTypeInfo { get; set; }
36+
}
37+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System.Runtime.Serialization;
2+
3+
namespace Route4MeSDKLibrary.DataTypes.V5.Orders
4+
{
5+
/// <summary>
6+
/// Custom user fields response
7+
/// </summary>
8+
[DataContract]
9+
public class CustomUserFieldResponse
10+
{
11+
/// <summary>
12+
/// Data
13+
/// </summary>
14+
[DataMember(Name = "Data", EmitDefaultValue = false, IsRequired = false)]
15+
public OrderCustomField Data { get; set; }
16+
}
17+
}

0 commit comments

Comments
 (0)