1
- using Newtonsoft . Json ;
2
- using System ;
1
+ using System ;
3
2
using System . Collections . Generic ;
3
+ using System . Text . Json . Serialization ;
4
4
5
5
namespace ServerlessMicroservices . Models
6
6
{
@@ -12,77 +12,77 @@ public enum TripTypes
12
12
13
13
public class TripItem : BaseItem
14
14
{
15
- [ JsonProperty ( PropertyName = "code" ) ]
15
+ [ JsonPropertyName ( "code" ) ]
16
16
public string Code { get ; set ; } = "" ;
17
17
18
18
// Included here ...just in case the passenger state changed ...this captures the passenger state at the time of the trip
19
- [ JsonProperty ( PropertyName = "passenger" ) ]
19
+ [ JsonPropertyName ( "passenger" ) ]
20
20
public PassengerItem Passenger { get ; set ; } = new PassengerItem ( ) ;
21
21
22
22
// Included here ...just in case the driver state changed ...this captures the driver state at the time of the trip
23
- [ JsonProperty ( PropertyName = "driver" ) ]
23
+ [ JsonPropertyName ( "driver" ) ]
24
24
public DriverItem Driver { get ; set ; } = null ;
25
25
26
26
// Included here ...just in case the driver state changed ...this captures the available drivers state at the time of the trip
27
- [ JsonProperty ( PropertyName = "availableDrivers" ) ]
27
+ [ JsonPropertyName ( "availableDrivers" ) ]
28
28
public List < DriverItem > AvailableDrivers { get ; set ; } = new List < DriverItem > ( ) ;
29
29
30
- [ JsonProperty ( PropertyName = "source" ) ]
30
+ [ JsonPropertyName ( "source" ) ]
31
31
public TripLocation Source { get ; set ; } = new TripLocation ( ) ;
32
32
33
- [ JsonProperty ( PropertyName = "destination" ) ]
33
+ [ JsonPropertyName ( "destination" ) ]
34
34
public TripLocation Destination { get ; set ; } = new TripLocation ( ) ;
35
35
36
- [ JsonProperty ( PropertyName = "acceptDate" ) ]
36
+ [ JsonPropertyName ( "acceptDate" ) ]
37
37
public DateTime ? AcceptDate { get ; set ; } = null ;
38
38
39
- [ JsonProperty ( PropertyName = "startDate" ) ]
39
+ [ JsonPropertyName ( "startDate" ) ]
40
40
public DateTime StartDate { get ; set ; } = DateTime . Now ;
41
41
42
- [ JsonProperty ( PropertyName = "endDate" ) ]
42
+ [ JsonPropertyName ( "endDate" ) ]
43
43
public DateTime ? EndDate { get ; set ; } = null ;
44
44
45
45
// Computed values
46
- [ JsonProperty ( PropertyName = "duration" ) ]
46
+ [ JsonPropertyName ( "duration" ) ]
47
47
public double Duration { get ; set ; } = 0 ;
48
48
49
- [ JsonProperty ( PropertyName = "monitorIterations" ) ]
49
+ [ JsonPropertyName ( "monitorIterations" ) ]
50
50
public int MonitorIterations { get ; set ; } = 0 ;
51
51
52
- [ JsonProperty ( PropertyName = "isAborted" ) ]
52
+ [ JsonPropertyName ( "isAborted" ) ]
53
53
public bool IsAborted { get ; set ; } = false ;
54
54
55
- [ JsonProperty ( PropertyName = "error" ) ]
55
+ [ JsonPropertyName ( "error" ) ]
56
56
public string Error { get ; set ; } = "" ;
57
57
58
- [ JsonProperty ( PropertyName = "type" ) ]
58
+ [ JsonPropertyName ( "type" ) ]
59
59
public TripTypes Type { get ; set ; } = TripTypes . Normal ;
60
60
}
61
61
62
62
public class TripLocation
63
63
{
64
- [ JsonProperty ( PropertyName = "latitude" ) ]
64
+ [ JsonPropertyName ( "latitude" ) ]
65
65
public double Latitude { get ; set ; } = 0 ;
66
66
67
- [ JsonProperty ( PropertyName = "longitude" ) ]
67
+ [ JsonPropertyName ( "longitude" ) ]
68
68
public double Longitude { get ; set ; } = 0 ;
69
69
}
70
70
71
71
public class TripDemoState
72
72
{
73
- [ JsonProperty ( PropertyName = "code" ) ]
73
+ [ JsonPropertyName ( "code" ) ]
74
74
public string Code { get ; set ; } = "" ;
75
75
76
- [ JsonProperty ( PropertyName = "source" ) ]
76
+ [ JsonPropertyName ( "source" ) ]
77
77
public TripLocation Source { get ; set ; } = new TripLocation ( ) ;
78
78
79
- [ JsonProperty ( PropertyName = "destination" ) ]
79
+ [ JsonPropertyName ( "destination" ) ]
80
80
public TripLocation Destination { get ; set ; } = new TripLocation ( ) ;
81
81
82
- [ JsonProperty ( PropertyName = "routeLocations" ) ]
82
+ [ JsonPropertyName ( "routeLocations" ) ]
83
83
public List < TripLocation > RouteLocations { get ; set ; } = new List < TripLocation > ( ) ;
84
84
85
- [ JsonProperty ( PropertyName = "currentRouteIndex" ) ]
85
+ [ JsonPropertyName ( "currentRouteIndex" ) ]
86
86
public int CurrentRouteIndex { get ; set ; } = 0 ;
87
87
}
88
88
0 commit comments