Skip to content

Commit

Permalink
fixed type of the field ExtFieldCustomData
Browse files Browse the repository at this point in the history
  • Loading branch information
Olman62 committed Jul 4, 2021
1 parent 7994b26 commit c23de44
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ Namespace Route4MeSDKTest.Examples
.EXT_FIELD_last_name = "Carol",
.EXT_FIELD_email = "[email protected]",
.EXT_FIELD_phone = "897946541",
.EXT_FIELD_custom_data = (New List(Of Dictionary(Of String, String))() From {
New Dictionary(Of String, String)() From {
.EXT_FIELD_custom_data = New Dictionary(Of String, String)() From {
{"order_type", "scheduled order"}
}
}).ToArray(),
.day_scheduled_for_YYMMDD = "2017-12-20",
},
.day_scheduled_for_YYMMDD = DateTime.Now.ToString("yyyy-MM-dd"),
.local_time_window_end = 39000,
.local_time_window_end_2 = 46200,
.local_time_window_start = 37800,
Expand Down
30 changes: 18 additions & 12 deletions Route4MeSDKLibrary/DataTypes/Order.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Imports Route4MeSDKLibrary.Route4MeSDK.QueryTypes
Imports Newtonsoft.Json
Imports Route4MeSDKLibrary.Route4MeSDK.QueryTypes
Imports System.Runtime.Serialization

Namespace Route4MeSDK.DataTypes
Expand Down Expand Up @@ -151,22 +152,27 @@ Namespace Route4MeSDK.DataTypes
Public Property EXT_FIELD_phone As String

''' <summary>
''' Custom data
''' Not serialized - for prevention wrong data (e.g. Dictionary(Of String, String)())
''' </summary>
<DataMember(Name:="EXT_FIELD_custom_data", EmitDefaultValue:=False)>
Public Property EXT_FIELD_custom_data() As Dictionary(Of String, String)()
<JsonIgnore>
Public Property EXT_FIELD_custom_data As Dictionary(Of String, String)
Get
Return _ext_field_custom_data
Return If(
EXT_FIELD_custom_data2 IsNot Nothing AndAlso EXT_FIELD_custom_data2.[GetType]() = GetType(Dictionary(Of String, String)),
CType(EXT_FIELD_custom_data2, Dictionary(Of String, String)),
Nothing
)
End Get
Set(ByVal value As Dictionary(Of String, String)())
If value.[GetType]() = GetType(Dictionary(Of String, String)()) Then
_ext_field_custom_data = value
Else
_ext_field_custom_data = Nothing
End If
Set(ByVal value As Dictionary(Of String, String))
EXT_FIELD_custom_data2 = value
End Set
End Property
Private _ext_field_custom_data As Dictionary(Of String, String)()

''' <summary>
''' Custom data - serialized
''' </summary>
<DataMember(Name:="EXT_FIELD_custom_data", EmitDefaultValue:=False)>
Private Property EXT_FIELD_custom_data2 As Object

''' <summary>
''' Local timezone string
Expand Down
6 changes: 1 addition & 5 deletions Route4meSDKLibraryUnitTests/Route4MeManagerUnitTest..vb
Original file line number Diff line number Diff line change
Expand Up @@ -8955,11 +8955,7 @@ End Class
.EXT_FIELD_last_name = "Carol",
.EXT_FIELD_email = "[email protected]",
.EXT_FIELD_phone = "897946541",
.EXT_FIELD_custom_data = (New List(Of Dictionary(Of String, String))() From {
New Dictionary(Of String, String)() From {
{"order_type", "scheduled order"}
}
}).ToArray(),
.EXT_FIELD_custom_data = New Dictionary(Of String, String)() From {{"order_type", "scheduled order"}},
.day_scheduled_for_YYMMDD = "2017-12-20",
.local_time_window_end = 39000,
.local_time_window_end_2 = 46200,
Expand Down

0 comments on commit c23de44

Please sign in to comment.