Skip to content

Commit

Permalink
Merge pull request #121 from assimbly/fix/tenant-variable-static_tena…
Browse files Browse the repository at this point in the history
…nt_variable_group_id-missing-field

TenantVariable - add missing field static_tenant_variable_group_id
  • Loading branch information
skin27 authored Oct 14, 2024
2 parents c6284db + a20938b commit 8a1ed4e
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;

Expand All @@ -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<>();
}
Expand All @@ -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<>();
}
Expand All @@ -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<>();
}

Expand All @@ -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) {
Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 8a1ed4e

Please sign in to comment.