Skip to content

Commit 75deba6

Browse files
committed
feat: add property as a relation to an operation
1 parent 1a164b1 commit 75deba6

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.ctrlhub.core.geo
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
4+
import com.github.jasminb.jsonapi.StringIdHandler
5+
import com.github.jasminb.jsonapi.annotations.Id
6+
import com.github.jasminb.jsonapi.annotations.Type
7+
8+
@Type("properties")
9+
@JsonIgnoreProperties(ignoreUnknown = true)
10+
data class Property(
11+
@Id(StringIdHandler::class) val id: String? = null
12+
)

src/main/kotlin/com/ctrlhub/core/projects/operations/response/Operation.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.ctrlhub.core.projects.operations.response
22

33
import com.ctrlhub.core.api.Assignable
4+
import com.ctrlhub.core.geo.Property
45
import com.ctrlhub.core.projects.operations.templates.response.OperationTemplate
56
import com.ctrlhub.core.projects.response.Label
67
import com.fasterxml.jackson.annotation.JsonCreator
@@ -28,14 +29,17 @@ class Operation @JsonCreator constructor(
2829
var assignees: java.util.List<Assignable>? = null,
2930

3031
@Relationship("template")
31-
var template: OperationTemplate? = null
32+
var template: OperationTemplate? = null,
33+
34+
@Relationship("properties")
35+
var property: java.util.List<Property>? = null,
3236
) {
3337
constructor(): this(
3438
name = "",
3539
code = "",
3640
description = "",
3741
dates = null,
38-
labels = emptyList()
42+
labels = emptyList(),
3943
)
4044
}
4145
@JsonIgnoreProperties(ignoreUnknown = true)

0 commit comments

Comments
 (0)