Skip to content

Commit 3813d45

Browse files
authored
Introduce active flag (#340)
1 parent 5d32fb9 commit 3813d45

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/main/groovy/life/qbic/datamodel/dtos/business/Affiliation.groovy

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ final class Affiliation {
6666
*/
6767
final AffiliationLabel label
6868

69+
/**
70+
* Boolean flag if an affiliation is active
71+
* @since 2.23.0
72+
*/
73+
final Boolean active
74+
6975
static class Builder {
7076

7177
int id
@@ -86,6 +92,8 @@ final class Affiliation {
8692

8793
AffiliationLabel label
8894

95+
Boolean active
96+
8997
Builder(String organisation, String street, String postalCode, String city) {
9098
this.id = id
9199
this.organisation = organisation
@@ -96,6 +104,7 @@ final class Affiliation {
96104
this.country = "Germany"
97105
this.category = AffiliationCategory.EXTERNAL
98106
this.label = AffiliationLabel.MNF
107+
this.active = Boolean.TRUE
99108
}
100109

101110
Builder id(int id) {
@@ -128,6 +137,16 @@ final class Affiliation {
128137
return this
129138
}
130139

140+
Builder setInactive() {
141+
this.active = Boolean.FALSE
142+
return this
143+
}
144+
145+
Builder setActive() {
146+
this.active = Boolean.TRUE
147+
return this
148+
}
149+
131150

132151
Affiliation build() {
133152
return new Affiliation(this)
@@ -145,6 +164,7 @@ final class Affiliation {
145164
this.category = builder.category
146165
this.city = builder.city
147166
this.label = builder.label
167+
this.active = builder.active
148168
}
149169

150170
@Override

0 commit comments

Comments
 (0)