File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
src/main/kotlin/com/ctrlhub/core/assets/vehicles/resource Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com.ctrlhub.core.assets.vehicles.resource
2
+
3
+ import com.fasterxml.jackson.annotation.JsonIgnoreProperties
4
+ import com.fasterxml.jackson.annotation.JsonProperty
5
+ import java.time.LocalDate
6
+ import java.time.LocalDateTime
7
+
8
+ @JsonIgnoreProperties(ignoreUnknown = true )
9
+ class VehicleMeta {
10
+ var mot: VehicleMot ? = null
11
+ var tax: VehicleTax ? = null
12
+ var sorn: Boolean? = null
13
+ }
14
+
15
+ @JsonIgnoreProperties(ignoreUnknown = true )
16
+ class VehicleMot {
17
+ @JsonProperty(" is_valid" ) var isValid: Boolean? = null
18
+ @JsonProperty(" records" ) var recordsCount: Int? = null
19
+ @JsonProperty(" last" ) var last: VehicleMotRecord ? = null
20
+ }
21
+
22
+ @JsonIgnoreProperties(ignoreUnknown = true )
23
+ class VehicleMotRecord {
24
+ var at: LocalDateTime ? = null
25
+ var id: String? = null
26
+ }
27
+
28
+ class VehicleTax {
29
+ @JsonProperty(" is_valid" ) var isValid: Boolean? = null
30
+ var due: LocalDate ? = null
31
+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties
5
5
import com.fasterxml.jackson.annotation.JsonProperty
6
6
import com.github.jasminb.jsonapi.StringIdHandler
7
7
import com.github.jasminb.jsonapi.annotations.Id
8
+ import com.github.jasminb.jsonapi.annotations.Meta
8
9
import com.github.jasminb.jsonapi.annotations.Relationship
9
10
import com.github.jasminb.jsonapi.annotations.Type
10
11
@@ -23,6 +24,9 @@ class Vehicle {
23
24
24
25
@Relationship(" assignee" )
25
26
var assignee: Assignable ? = null
27
+
28
+ @Meta
29
+ var meta: VehicleMeta ? = null
26
30
}
27
31
28
32
@Type(" vehicle-categories" )
You can’t perform that action at this time.
0 commit comments