This commit is contained in:
CITE\spapacharalampous 2024-08-23 15:01:08 +03:00
parent aa850ce65e
commit 87657fe8db
1 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import gr.cite.tools.logging.DataLogEntry;
import gr.cite.tools.logging.LoggerService;
import org.opencdmp.authorization.AuthorizationFlags;
import org.opencdmp.commons.XmlHandlingService;
import org.opencdmp.commons.scope.tenant.TenantScope;
import org.opencdmp.commons.types.descriptionstatus.DescriptionStatusDefinitionEntity;
import org.opencdmp.convention.ConventionService;
import org.opencdmp.data.DescriptionStatusEntity;
@ -24,11 +25,13 @@ import java.util.*;
public class DescriptionStatusBuilder extends BaseBuilder<DescriptionStatus, DescriptionStatusEntity> {
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
private final TenantScope tenantScope;
private final BuilderFactory builderFactory;
private final XmlHandlingService xmlHandlingService;
public DescriptionStatusBuilder(ConventionService conventionService, BuilderFactory builderFactory, XmlHandlingService xmlHandlingService) {
public DescriptionStatusBuilder(ConventionService conventionService, TenantScope tenantScope, BuilderFactory builderFactory, XmlHandlingService xmlHandlingService) {
super(conventionService, new LoggerService(LoggerFactory.getLogger(DescriptionStatusBuilder.class)));
this.tenantScope = tenantScope;
this.builderFactory = builderFactory;
this.xmlHandlingService = xmlHandlingService;
}
@ -57,6 +60,7 @@ public class DescriptionStatusBuilder extends BaseBuilder<DescriptionStatus, Des
if (fields.hasField(this.asIndexer(DescriptionStatus._createdAt))) m.setCreatedAt(d.getCreatedAt());
if (fields.hasField(this.asIndexer(DescriptionStatus._isActive))) m.setIsActive(d.getIsActive());
if (fields.hasField(this.asIndexer(DescriptionStatus._internalStatus))) m.setInternalStatus(d.getInternalStatus());
if (fields.hasField(this.asIndexer(DescriptionStatus._belongsToCurrentTenant))) m.setBelongsToCurrentTenant(this.getBelongsToCurrentTenant(d, this.tenantScope));
if (!definitionFields.isEmpty() && d.getDefinition() != null) {
DescriptionStatusDefinitionEntity definition = this.xmlHandlingService.fromXmlSafe(DescriptionStatusDefinitionEntity.class, d.getDefinition());