From a20938b3cf34516d085018ab27220f4cd9f81abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Gon=C3=A7alves?= Date: Mon, 14 Oct 2024 13:10:03 +0100 Subject: [PATCH] add missing field static_tenant_variable_group_id --- .../tenantvariables/domain/TenantVariable.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tenantvariables/src/main/java/org/assimbly/tenantvariables/domain/TenantVariable.java b/tenantvariables/src/main/java/org/assimbly/tenantvariables/domain/TenantVariable.java index 787d6c4..0c152f5 100644 --- a/tenantvariables/src/main/java/org/assimbly/tenantvariables/domain/TenantVariable.java +++ b/tenantvariables/src/main/java/org/assimbly/tenantvariables/domain/TenantVariable.java @@ -12,6 +12,7 @@ public class TenantVariable { public static final String ID_FIELD = "_id"; public static final String TYPE_FIELD = "_type"; public static final String NAME_FIELD = "name"; + public static final String STATIC_TENANT_VARIABLE_GROUP_ID_FIELD = "static_tenant_variable_group_id"; public static final String CREATED_AT_FIELD = "createdAt"; public static final String CREATED_BY_FIELD = "createdBy"; public static final String VALUES_FIELD = "values"; @@ -25,6 +26,7 @@ public enum TenantVarType { private ObjectId _id; private String _type; private String name; + private ObjectId staticTenantVariableGroupId; private long createdAt; private String createdBy; @@ -35,6 +37,7 @@ public enum TenantVarType { public TenantVariable(){ this._id = new ObjectId(); this._type = TenantVarType.TenantVariable.name(); + this.staticTenantVariableGroupId = new ObjectId(); this.values = new ArrayList<>(); this.tagIds = new ArrayList<>(); } @@ -43,6 +46,7 @@ public TenantVariable(String name){ this._id = new ObjectId(); this._type = TenantVarType.TenantVariable.name(); this.name = name; + this.staticTenantVariableGroupId = new ObjectId(); this.values = new ArrayList<>(); this.tagIds = new ArrayList<>(); } @@ -51,6 +55,7 @@ public TenantVariable(String name, TenantVarType tenantVarType){ this._id = new ObjectId(); this._type = tenantVarType.name(); this.name = name; + this.staticTenantVariableGroupId = new ObjectId(); this.values = new ArrayList<>(); } @@ -75,6 +80,7 @@ public static TenantVariable fromDocument(Document document) { tenantVariable.set_type(document.getString(TYPE_FIELD)); } tenantVariable.setName(document.getString(NAME_FIELD)); + tenantVariable.setStaticTenantVariableGroupId(document.getObjectId(STATIC_TENANT_VARIABLE_GROUP_ID_FIELD)); Object createdAtField = document.get(CREATED_AT_FIELD); if (createdAtField != null) { @@ -113,6 +119,7 @@ public Document toDocument() { document.append(ID_FIELD, this.get_id()); document.append(TYPE_FIELD, this.get_type()); document.append(NAME_FIELD, this.getName()); + document.append(STATIC_TENANT_VARIABLE_GROUP_ID_FIELD, this.getStaticTenantVariableGroupId()); document.append(CREATED_AT_FIELD, this.getCreatedAt()); document.append(CREATED_BY_FIELD, this.getCreatedBy()); @@ -159,6 +166,14 @@ public void setName(String name) { this.name = name; } + public ObjectId getStaticTenantVariableGroupId() { + return staticTenantVariableGroupId; + } + + public void setStaticTenantVariableGroupId(ObjectId staticTenantVariableGroupId) { + this.staticTenantVariableGroupId = staticTenantVariableGroupId; + } + public long getCreatedAt() { return createdAt; }