From 728f022a16e1c44d8b5c48d3e04941570751bfd0 Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 18 Jul 2024 15:15:22 +0300 Subject: [PATCH] add maintenance tasks for accounting entries --- .../org/opencdmp/audit/AuditableAction.java | 9 + ...ngEntryCreatedIntegrationEventHandler.java | 3 +- ...tryCreatedIntegrationEventHandlerImpl.java | 18 +- .../accounting/AccountingProperties.java | 10 + .../accounting/AccountingServiceImpl.java | 48 ++-- .../maintenance/MaintenanceService.java | 17 ++ .../maintenance/MaintenanceServiceImpl.java | 206 ++++++++++++++- .../controllers/MaintenanceController.java | 80 ++++++ .../src/main/resources/config/accounting.yml | 1 + .../maintenance/maintenance.service.ts | 57 ++++ .../maintenance-tasks.component.html | 8 + .../maintenance-tasks.component.ts | 248 ++++++++++++++++++ frontend/src/assets/i18n/baq.json | 10 +- frontend/src/assets/i18n/de.json | 10 +- frontend/src/assets/i18n/en.json | 10 +- frontend/src/assets/i18n/es.json | 10 +- frontend/src/assets/i18n/gr.json | 10 +- frontend/src/assets/i18n/hr.json | 10 +- frontend/src/assets/i18n/pl.json | 10 +- frontend/src/assets/i18n/pt.json | 10 +- frontend/src/assets/i18n/sk.json | 10 +- frontend/src/assets/i18n/sr.json | 10 +- frontend/src/assets/i18n/tr.json | 10 +- 23 files changed, 760 insertions(+), 55 deletions(-) diff --git a/backend/core/src/main/java/org/opencdmp/audit/AuditableAction.java b/backend/core/src/main/java/org/opencdmp/audit/AuditableAction.java index 064a4bad7..1d78db0b3 100644 --- a/backend/core/src/main/java/org/opencdmp/audit/AuditableAction.java +++ b/backend/core/src/main/java/org/opencdmp/audit/AuditableAction.java @@ -158,6 +158,15 @@ public class AuditableAction { public static final EventId Maintenance_SendTenantTouchEvents = new EventId(230002, "Maintenance_SendTenantTouchEvents"); public static final EventId Maintenance_SendPlanTouchEvents = new EventId(230003, "Maintenance_SendPlanTouchEvents"); public static final EventId Maintenance_SendDescriptionTouchEvents = new EventId(230004, "Maintenance_SendDescriptionTouchEvents"); + public static final EventId Maintenance_SendPlanAccountingEntriesEvents = new EventId(230005, "Maintenance_SendPlanAccountingEntriesEvents"); + public static final EventId Maintenance_SendBlueprintAccountingEntriesEvents = new EventId(230006, "Maintenance_SendBlueprintAccountingEntriesEvents"); + public static final EventId Maintenance_SendDescriptionAccountingEntriesEvents = new EventId(230007, "Maintenance_SendDescriptionAccountingEntriesEvents"); + public static final EventId Maintenance_SendDescriptionTemplateAccountingEntriesEvents = new EventId(230008, "Maintenance_SendDescriptionTemplateAccountingEntriesEvents"); + public static final EventId Maintenance_SendDescriptionTemplateTypeAccountingEntriesEvents = new EventId(230009, "Maintenance_SendDescriptionTemplateTypeAccountingEntriesEvents"); + public static final EventId Maintenance_SendPrefillingSourceAccountingEntriesEvents = new EventId(230010, "Maintenance_SendPrefillingSourceAccountingEntriesEvents"); + public static final EventId Maintenance_SendReferenceTypeAccountingEntriesEvents = new EventId(230011, "Maintenance_SendReferenceTypeAccountingEntriesEvents"); + public static final EventId Maintenance_SendUserAccountingEntriesEvents = new EventId(230012, "Maintenance_SendUserAccountingEntriesEvents"); + public static final EventId Principal_Lookup = new EventId(240000, "Principal_Lookup"); public static final EventId Principal_MyTenants = new EventId(240001, "Principal_MyTenants"); diff --git a/backend/core/src/main/java/org/opencdmp/integrationevent/outbox/accountingentrycreated/AccountingEntryCreatedIntegrationEventHandler.java b/backend/core/src/main/java/org/opencdmp/integrationevent/outbox/accountingentrycreated/AccountingEntryCreatedIntegrationEventHandler.java index 53ddca3ae..6797d33b7 100644 --- a/backend/core/src/main/java/org/opencdmp/integrationevent/outbox/accountingentrycreated/AccountingEntryCreatedIntegrationEventHandler.java +++ b/backend/core/src/main/java/org/opencdmp/integrationevent/outbox/accountingentrycreated/AccountingEntryCreatedIntegrationEventHandler.java @@ -3,8 +3,9 @@ package org.opencdmp.integrationevent.outbox.accountingentrycreated; import org.opencdmp.commons.enums.accounting.AccountingValueType; import javax.management.InvalidApplicationException; +import java.util.UUID; public interface AccountingEntryCreatedIntegrationEventHandler { - void handleAccountingEntry(String metric, AccountingValueType valueType) throws InvalidApplicationException; + void handleAccountingEntry(String metric, AccountingValueType valueType, String subjectId, UUID tenantId) throws InvalidApplicationException; } diff --git a/backend/core/src/main/java/org/opencdmp/integrationevent/outbox/accountingentrycreated/AccountingEntryCreatedIntegrationEventHandlerImpl.java b/backend/core/src/main/java/org/opencdmp/integrationevent/outbox/accountingentrycreated/AccountingEntryCreatedIntegrationEventHandlerImpl.java index 1c9850e51..a7c5ac0bc 100644 --- a/backend/core/src/main/java/org/opencdmp/integrationevent/outbox/accountingentrycreated/AccountingEntryCreatedIntegrationEventHandlerImpl.java +++ b/backend/core/src/main/java/org/opencdmp/integrationevent/outbox/accountingentrycreated/AccountingEntryCreatedIntegrationEventHandlerImpl.java @@ -1,10 +1,8 @@ package org.opencdmp.integrationevent.outbox.accountingentrycreated; -import gr.cite.tools.data.query.QueryFactory; import gr.cite.tools.logging.LoggerService; import org.opencdmp.commons.enums.accounting.AccountingMeasureType; import org.opencdmp.commons.enums.accounting.AccountingValueType; -import org.opencdmp.commons.scope.tenant.TenantScope; import org.opencdmp.integrationevent.outbox.OutboxIntegrationEvent; import org.opencdmp.integrationevent.outbox.OutboxService; import org.opencdmp.service.accounting.AccountingProperties; @@ -25,16 +23,10 @@ public class AccountingEntryCreatedIntegrationEventHandlerImpl implements Accoun private final OutboxService outboxService; - private final QueryFactory queryFactory; - - private final TenantScope tenantScope; - private final AccountingProperties accountingProperties; - public AccountingEntryCreatedIntegrationEventHandlerImpl(OutboxService outboxService, QueryFactory queryFactory, TenantScope tenantScope, TenantScope tenantScope1, AccountingProperties accountingProperties) { + public AccountingEntryCreatedIntegrationEventHandlerImpl(OutboxService outboxService, AccountingProperties accountingProperties) { this.outboxService = outboxService; - this.queryFactory = queryFactory; - this.tenantScope = tenantScope1; this.accountingProperties = accountingProperties; } @@ -47,7 +39,7 @@ public class AccountingEntryCreatedIntegrationEventHandlerImpl implements Accoun } @Override - public void handleAccountingEntry(String metric, AccountingValueType valueType) throws InvalidApplicationException { + public void handleAccountingEntry(String metric, AccountingValueType valueType, String subjectId, UUID tenantId) throws InvalidApplicationException { AccountingEntryCreatedIntegrationEvent event = new AccountingEntryCreatedIntegrationEvent(); event.setTimeStamp(Instant.now()); event.setServiceId(accountingProperties.getServiceId()); @@ -55,9 +47,9 @@ public class AccountingEntryCreatedIntegrationEventHandlerImpl implements Accoun event.setMeasure(AccountingMeasureType.Unit); event.setType(valueType); event.setResource(metric); - if (this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){ - event.setTenant(this.tenantScope.getTenant()); - } + event.setUserId(subjectId); + event.setValue(1.0); + event.setTenant(tenantId); this.handle(event); } diff --git a/backend/core/src/main/java/org/opencdmp/service/accounting/AccountingProperties.java b/backend/core/src/main/java/org/opencdmp/service/accounting/AccountingProperties.java index 30b91674a..71a6a627b 100644 --- a/backend/core/src/main/java/org/opencdmp/service/accounting/AccountingProperties.java +++ b/backend/core/src/main/java/org/opencdmp/service/accounting/AccountingProperties.java @@ -8,6 +8,8 @@ public class AccountingProperties { private String action; + private String subjectId; + public String getServiceId() { return serviceId; } @@ -23,4 +25,12 @@ public class AccountingProperties { public void setAction(String action) { this.action = action; } + + public String getSubjectId() { + return subjectId; + } + + public void setSubjectId(String subjectId) { + this.subjectId = subjectId; + } } diff --git a/backend/core/src/main/java/org/opencdmp/service/accounting/AccountingServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/accounting/AccountingServiceImpl.java index 1cee85b48..dbecdde1a 100644 --- a/backend/core/src/main/java/org/opencdmp/service/accounting/AccountingServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/accounting/AccountingServiceImpl.java @@ -1,15 +1,16 @@ package org.opencdmp.service.accounting; -import gr.cite.commons.web.authz.service.AuthorizationService; +import gr.cite.tools.data.query.QueryFactory; import gr.cite.tools.logging.LoggerService; import org.opencdmp.commons.enums.UsageLimitTargetMetric; import org.opencdmp.commons.enums.accounting.AccountingValueType; -import org.opencdmp.convention.ConventionService; -import org.opencdmp.errorcode.ErrorThesaurusProperties; +import org.opencdmp.commons.scope.tenant.TenantScope; +import org.opencdmp.commons.scope.user.UserScope; +import org.opencdmp.data.UserCredentialEntity; import org.opencdmp.integrationevent.outbox.accountingentrycreated.AccountingEntryCreatedIntegrationEventHandler; +import org.opencdmp.query.UserCredentialQuery; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.MessageSource; import org.springframework.stereotype.Service; import javax.management.InvalidApplicationException; @@ -18,27 +19,18 @@ import javax.management.InvalidApplicationException; public class AccountingServiceImpl implements AccountingService { private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(AccountingServiceImpl.class)); - private final AuthorizationService authorizationService; - private final ConventionService conventionService; - - private final ErrorThesaurusProperties errors; - - private final MessageSource messageSource; - + private final QueryFactory queryFactory; private final AccountingEntryCreatedIntegrationEventHandler accountingEntryCreatedIntegrationEventHandler; + private final UserScope userScope; + private final TenantScope tenantScope; @Autowired public AccountingServiceImpl( - AuthorizationService authorizationService, - ConventionService conventionService, - ErrorThesaurusProperties errors, - MessageSource messageSource, - AccountingEntryCreatedIntegrationEventHandler accountingEntryCreatedIntegrationEventHandler) { - this.authorizationService = authorizationService; - this.conventionService = conventionService; - this.errors = errors; - this.messageSource = messageSource; + QueryFactory queryFactory, AccountingEntryCreatedIntegrationEventHandler accountingEntryCreatedIntegrationEventHandler, UserScope userScope, TenantScope tenantScope) { + this.queryFactory = queryFactory; this.accountingEntryCreatedIntegrationEventHandler = accountingEntryCreatedIntegrationEventHandler; + this.userScope = userScope; + this.tenantScope = tenantScope; } public Integer getCurrentMetricValue(UsageLimitTargetMetric metric) { @@ -52,11 +44,23 @@ public class AccountingServiceImpl implements AccountingService { } public void increase(String metric) throws InvalidApplicationException { - this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(metric, AccountingValueType.Plus); + String subjectId; + + UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(this.userScope.getUserId()).first(); + if (userCredential != null) subjectId = userCredential.getExternalId(); + else subjectId = this.userScope.getUserId().toString(); + + this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(metric, AccountingValueType.Plus, subjectId, this.tenantScope.getTenant()); } public void decrease(String metric) throws InvalidApplicationException { - this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(metric, AccountingValueType.Minus); + String subjectId; + + UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(this.userScope.getUserId()).first(); + if (userCredential != null) subjectId = userCredential.getExternalId(); + else subjectId = this.userScope.getUserId().toString(); + + this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(metric, AccountingValueType.Minus, subjectId, this.tenantScope.getTenant()); } } diff --git a/backend/core/src/main/java/org/opencdmp/service/maintenance/MaintenanceService.java b/backend/core/src/main/java/org/opencdmp/service/maintenance/MaintenanceService.java index 626c0808c..c10f181db 100644 --- a/backend/core/src/main/java/org/opencdmp/service/maintenance/MaintenanceService.java +++ b/backend/core/src/main/java/org/opencdmp/service/maintenance/MaintenanceService.java @@ -12,4 +12,21 @@ public interface MaintenanceService { void sendPlanTouchEvents() throws InvalidApplicationException; void sendDescriptionTouchEvents() throws InvalidApplicationException; + + void sendPlanAccountingEntriesEvents() throws InvalidApplicationException; + + void sendBlueprintAccountingEntriesEvents() throws InvalidApplicationException; + + void sendDescriptionAccountingEntriesEvents() throws InvalidApplicationException; + + void sendDescriptionTemplateAccountingEntriesEvents() throws InvalidApplicationException; + + void sendDescriptionTemplateTypeAccountingEntriesEvents() throws InvalidApplicationException; + + void sendPrefillingSourceAccountingEntriesEvents() throws InvalidApplicationException; + + void sendReferenceTypeAccountingEntriesEvents() throws InvalidApplicationException; + + void sendUserAccountingEntriesEvents() throws InvalidApplicationException; + } diff --git a/backend/core/src/main/java/org/opencdmp/service/maintenance/MaintenanceServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/maintenance/MaintenanceServiceImpl.java index 3d3f68353..43b07d0e1 100644 --- a/backend/core/src/main/java/org/opencdmp/service/maintenance/MaintenanceServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/maintenance/MaintenanceServiceImpl.java @@ -6,8 +6,11 @@ import gr.cite.tools.fieldset.BaseFieldSet; import gr.cite.tools.logging.LoggerService; import org.opencdmp.authorization.Permission; import org.opencdmp.commons.enums.IsActive; +import org.opencdmp.commons.enums.UsageLimitTargetMetric; +import org.opencdmp.commons.enums.accounting.AccountingValueType; import org.opencdmp.commons.scope.tenant.TenantScope; import org.opencdmp.data.*; +import org.opencdmp.integrationevent.outbox.accountingentrycreated.AccountingEntryCreatedIntegrationEventHandler; import org.opencdmp.integrationevent.outbox.annotationentityremoval.AnnotationEntityRemovalIntegrationEventHandler; import org.opencdmp.integrationevent.outbox.annotationentitytouch.AnnotationEntityTouchedIntegrationEventHandler; import org.opencdmp.integrationevent.outbox.tenantremoval.TenantRemovalIntegrationEventHandler; @@ -15,25 +18,31 @@ import org.opencdmp.integrationevent.outbox.tenanttouched.TenantTouchedIntegrati import org.opencdmp.integrationevent.outbox.tenanttouched.TenantTouchedIntegrationEventHandler; import org.opencdmp.integrationevent.outbox.userremoval.UserRemovalIntegrationEventHandler; import org.opencdmp.integrationevent.outbox.usertouched.UserTouchedIntegrationEventHandler; +import org.opencdmp.model.DescriptionTemplateType; import org.opencdmp.model.Tenant; import org.opencdmp.model.description.Description; +import org.opencdmp.model.descriptiontemplate.DescriptionTemplate; import org.opencdmp.model.plan.Plan; +import org.opencdmp.model.planblueprint.PlanBlueprint; +import org.opencdmp.model.prefillingsource.PrefillingSource; +import org.opencdmp.model.referencetype.ReferenceType; import org.opencdmp.model.user.User; -import org.opencdmp.query.DescriptionQuery; -import org.opencdmp.query.PlanQuery; -import org.opencdmp.query.TenantQuery; -import org.opencdmp.query.UserQuery; +import org.opencdmp.query.*; +import org.opencdmp.service.accounting.AccountingProperties; +import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.management.InvalidApplicationException; import java.util.List; import java.util.UUID; +import java.util.stream.Collectors; @Service public class MaintenanceServiceImpl implements MaintenanceService { private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(MaintenanceServiceImpl.class)); + private static final Logger log = LoggerFactory.getLogger(MaintenanceServiceImpl.class); private final TenantEntityManager entityManager; private final AuthorizationService authorizationService; private final QueryFactory queryFactory; @@ -47,12 +56,14 @@ public class MaintenanceServiceImpl implements MaintenanceService { private final TenantRemovalIntegrationEventHandler tenantRemovalIntegrationEventHandler; private final AnnotationEntityRemovalIntegrationEventHandler annotationEntityRemovalIntegrationEventHandler; private final AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler; + private final AccountingEntryCreatedIntegrationEventHandler accountingEntryCreatedIntegrationEventHandler; private final TenantScope tenantScope; - + private final TenantEntityManager tenantEntityManager; + private final AccountingProperties accountingProperties; public MaintenanceServiceImpl( - TenantEntityManager entityManager, AuthorizationService authorizationService, - QueryFactory queryFactory, UserTouchedIntegrationEventHandler userTouchedIntegrationEventHandler, UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler, TenantTouchedIntegrationEventHandler tenantTouchedIntegrationEventHandler, TenantRemovalIntegrationEventHandler tenantRemovalIntegrationEventHandler, AnnotationEntityRemovalIntegrationEventHandler annotationEntityRemovalIntegrationEventHandler, AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler, TenantScope tenantScope) { + TenantEntityManager entityManager, AuthorizationService authorizationService, + QueryFactory queryFactory, UserTouchedIntegrationEventHandler userTouchedIntegrationEventHandler, UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler, TenantTouchedIntegrationEventHandler tenantTouchedIntegrationEventHandler, TenantRemovalIntegrationEventHandler tenantRemovalIntegrationEventHandler, AnnotationEntityRemovalIntegrationEventHandler annotationEntityRemovalIntegrationEventHandler, AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler, AccountingEntryCreatedIntegrationEventHandler accountingEntryCreatedIntegrationEventHandler, TenantScope tenantScope, TenantEntityManager tenantEntityManager, AccountingProperties accountingProperties) { this.entityManager = entityManager; this.authorizationService = authorizationService; this.queryFactory = queryFactory; @@ -62,7 +73,10 @@ public class MaintenanceServiceImpl implements MaintenanceService { this.tenantRemovalIntegrationEventHandler = tenantRemovalIntegrationEventHandler; this.annotationEntityRemovalIntegrationEventHandler = annotationEntityRemovalIntegrationEventHandler; this.annotationEntityTouchedIntegrationEventHandler = annotationEntityTouchedIntegrationEventHandler; - this.tenantScope = tenantScope; + this.accountingEntryCreatedIntegrationEventHandler = accountingEntryCreatedIntegrationEventHandler; + this.tenantScope = tenantScope; + this.tenantEntityManager = tenantEntityManager; + this.accountingProperties = accountingProperties; } @@ -191,4 +205,180 @@ public class MaintenanceServiceImpl implements MaintenanceService { } return tenants; } + + @Override + public void sendPlanAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send plan accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + try { + this.tenantEntityManager.disableTenantFilters(); + List items = this.queryFactory.query(PlanQuery.class).disableTracking().collectAs(new BaseFieldSet().ensure(Plan._id).ensure(Plan._isActive).ensure(Plan._creator)); + List userCredentials = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(items.stream().map(x -> x.getCreatorId()).distinct().collect(Collectors.toList())).collect(); + + for (PlanEntity item : items) { + String subjectId; + if (userCredentials != null) { + UserCredentialEntity userCredential = userCredentials.stream().filter(x -> x.getUserId().equals(item.getCreatorId())).findFirst().orElse(null); + if (userCredential != null) subjectId = userCredential.getExternalId(); + else subjectId = item.getCreatorId().toString(); + } else { + subjectId = item.getCreatorId().toString(); + } + if (item.getIsActive().equals(IsActive.Active)) this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.PLAN_COUNT.getValue(), AccountingValueType.Plus, subjectId, item.getTenantId()); + else this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.PLAN_COUNT.getValue(), AccountingValueType.Minus, subjectId, item.getTenantId()); + } + } finally { + this.tenantEntityManager.reloadTenantFilters(); + } + } + + @Override + public void sendBlueprintAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send plan blueprint accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + try { + this.tenantEntityManager.disableTenantFilters(); + List items = this.queryFactory.query(PlanBlueprintQuery.class).disableTracking().collectAs(new BaseFieldSet().ensure(PlanBlueprint._id).ensure(PlanBlueprint._isActive)); + + for (PlanBlueprintEntity item : items) { + String subjectId = accountingProperties.getSubjectId(); + if (item.getIsActive().equals(IsActive.Active)) this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.BLUEPRINT_COUNT.getValue(), AccountingValueType.Plus, subjectId, item.getTenantId()); + else this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.BLUEPRINT_COUNT.getValue(), AccountingValueType.Minus, subjectId, item.getTenantId()); + } + } finally { + this.tenantEntityManager.reloadTenantFilters(); + } + } + + @Override + public void sendDescriptionAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send descriptions entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + try { + this.tenantEntityManager.disableTenantFilters(); + List items = this.queryFactory.query(DescriptionQuery.class).disableTracking().collectAs(new BaseFieldSet().ensure(Description._id).ensure(Description._isActive).ensure(Description._createdBy)); + List userCredentials = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(items.stream().map(x -> x.getCreatedById()).distinct().collect(Collectors.toList())).collect(); + + for (DescriptionEntity item : items) { + String subjectId; + if (userCredentials != null) { + UserCredentialEntity userCredential = userCredentials.stream().filter(x -> x.getUserId().equals(item.getCreatedById())).findFirst().orElse(null); + if (userCredential != null) subjectId = userCredential.getExternalId(); + else subjectId = item.getCreatedById().toString(); + } else { + subjectId = item.getCreatedById().toString(); + } + if (item.getIsActive().equals(IsActive.Active)) this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.DESCRIPTION_COUNT.getValue(), AccountingValueType.Plus, subjectId, item.getTenantId()); + else this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.DESCRIPTION_COUNT.getValue(), AccountingValueType.Minus, subjectId, item.getTenantId()); + } + } finally { + this.tenantEntityManager.reloadTenantFilters(); + } + } + + @Override + public void sendDescriptionTemplateAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send description templates accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + try { + this.tenantEntityManager.disableTenantFilters(); + List items = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().collectAs(new BaseFieldSet().ensure(DescriptionTemplate._id).ensure(DescriptionTemplate._isActive)); + + for (DescriptionTemplateEntity item : items) { + String subjectId = accountingProperties.getSubjectId(); + if (item.getIsActive().equals(IsActive.Active)) this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.DESCRIPTION_TEMPLATE_COUNT.getValue(), AccountingValueType.Plus, subjectId, item.getTenantId()); + else this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.DESCRIPTION_TEMPLATE_COUNT.getValue(), AccountingValueType.Minus, subjectId, item.getTenantId()); + } + } finally { + this.tenantEntityManager.reloadTenantFilters(); + } + } + + @Override + public void sendDescriptionTemplateTypeAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send description templates types accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + try { + this.tenantEntityManager.disableTenantFilters(); + List items = this.queryFactory.query(DescriptionTemplateTypeQuery.class).disableTracking().collectAs(new BaseFieldSet().ensure(DescriptionTemplateType._id).ensure(DescriptionTemplateType._isActive)); + + for (DescriptionTemplateTypeEntity item : items) { + String subjectId = accountingProperties.getSubjectId(); + if (item.getIsActive().equals(IsActive.Active)) this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.DESCRIPTION_TEMPLATE_TYPE_COUNT.getValue(), AccountingValueType.Plus, subjectId, item.getTenantId()); + else this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.DESCRIPTION_TEMPLATE_TYPE_COUNT.getValue(), AccountingValueType.Minus, subjectId, item.getTenantId()); + } + } finally { + this.tenantEntityManager.reloadTenantFilters(); + } + } + + @Override + public void sendPrefillingSourceAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send prefilling sources accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + try { + this.tenantEntityManager.disableTenantFilters(); + List items = this.queryFactory.query(PrefillingSourceQuery.class).disableTracking().collectAs(new BaseFieldSet().ensure(PrefillingSource._id).ensure(PrefillingSource._isActive)); + + for (PrefillingSourceEntity item : items) { + String subjectId = accountingProperties.getSubjectId(); + if (item.getIsActive().equals(IsActive.Active)) this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.PREFILLING_SOURCES_COUNT.getValue(), AccountingValueType.Plus, subjectId, item.getTenantId()); + else this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.PREFILLING_SOURCES_COUNT.getValue(), AccountingValueType.Minus, subjectId, item.getTenantId()); + } + } finally { + this.tenantEntityManager.reloadTenantFilters(); + } + } + + @Override + public void sendReferenceTypeAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send reference types accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + try { + this.tenantEntityManager.disableTenantFilters(); + List items = this.queryFactory.query(ReferenceTypeQuery.class).disableTracking().collectAs(new BaseFieldSet().ensure(ReferenceType._id).ensure(ReferenceType._isActive)); + + for (ReferenceTypeEntity item : items) { + String subjectId = accountingProperties.getSubjectId(); + if (item.getIsActive().equals(IsActive.Active)) this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.REFERENCE_TYPE_COUNT.getValue(), AccountingValueType.Plus, subjectId, item.getTenantId()); + else this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.REFERENCE_TYPE_COUNT.getValue(), AccountingValueType.Minus, subjectId, item.getTenantId()); + } + } finally { + this.tenantEntityManager.reloadTenantFilters(); + } + } + + @Override + public void sendUserAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send users accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + try { + this.tenantEntityManager.disableTenantFilters(); + List items = this.queryFactory.query(TenantUserQuery.class).disableTracking().collectAs(new BaseFieldSet().ensure(TenantUserEntity._id).ensure(TenantUserEntity._userId).ensure(TenantUserEntity._isActive)); + List userCredentials = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(items.stream().map(x -> x.getUserId()).distinct().collect(Collectors.toList())).collect(); + + for (TenantUserEntity item : items) { + String subjectId; + if (userCredentials != null) { + UserCredentialEntity userCredential = userCredentials.stream().filter(x -> x.getUserId().equals(item.getUserId())).findFirst().orElse(null); + if (userCredential != null) subjectId = userCredential.getExternalId(); + else subjectId = item.getUserId().toString(); + } else { + subjectId = item.getUserId().toString(); + } + if (item.getIsActive().equals(IsActive.Active)) this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.USER_COUNT.getValue(), AccountingValueType.Plus, subjectId, item.getTenantId()); + else this.accountingEntryCreatedIntegrationEventHandler.handleAccountingEntry(UsageLimitTargetMetric.USER_COUNT.getValue(), AccountingValueType.Minus, subjectId, item.getTenantId()); + } + } finally { + this.tenantEntityManager.reloadTenantFilters(); + } + } } diff --git a/backend/web/src/main/java/org/opencdmp/controllers/MaintenanceController.java b/backend/web/src/main/java/org/opencdmp/controllers/MaintenanceController.java index 7b9911ff1..519577ce8 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/MaintenanceController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/MaintenanceController.java @@ -101,4 +101,84 @@ public class MaintenanceController { this.auditService.track(AuditableAction.Maintenance_SendDescriptionTouchEvents); } + + @RequestMapping(method = RequestMethod.POST, value = "/events/plans/accounting-entry") + public void sendPlanAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send plan accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + this.maintenanceService.sendPlanAccountingEntriesEvents(); + + this.auditService.track(AuditableAction.Maintenance_SendPlanAccountingEntriesEvents); + } + + @RequestMapping(method = RequestMethod.POST, value = "/events/descriptions/accounting-entry") + public void sendDescriptionAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send plan accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + this.maintenanceService.sendDescriptionAccountingEntriesEvents(); + + this.auditService.track(AuditableAction.Maintenance_SendDescriptionAccountingEntriesEvents); + } + + @RequestMapping(method = RequestMethod.POST, value = "/events/plan-blueprints/accounting-entry") + public void sendBlueprintAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send blueprints accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + this.maintenanceService.sendBlueprintAccountingEntriesEvents(); + + this.auditService.track(AuditableAction.Maintenance_SendBlueprintAccountingEntriesEvents); + } + + @RequestMapping(method = RequestMethod.POST, value = "/events/description-templates/accounting-entry") + public void sendDescriptionTemplateAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send description templates accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + this.maintenanceService.sendDescriptionTemplateAccountingEntriesEvents(); + + this.auditService.track(AuditableAction.Maintenance_SendDescriptionTemplateAccountingEntriesEvents); + } + + @RequestMapping(method = RequestMethod.POST, value = "/events/description-template-types/accounting-entry") + public void sendDescriptionTemplateTypeAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send description template types accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + this.maintenanceService.sendDescriptionTemplateTypeAccountingEntriesEvents(); + + this.auditService.track(AuditableAction.Maintenance_SendDescriptionTemplateTypeAccountingEntriesEvents); + } + + @RequestMapping(method = RequestMethod.POST, value = "/events/prefilling-sources/accounting-entry") + public void sendPrefillingSourceAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send prefilling source accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + this.maintenanceService.sendPrefillingSourceAccountingEntriesEvents(); + + this.auditService.track(AuditableAction.Maintenance_SendPrefillingSourceAccountingEntriesEvents); + } + + @RequestMapping(method = RequestMethod.POST, value = "/events/reference-types/accounting-entry") + public void sendReferenceTypeAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send reference type accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + this.maintenanceService.sendReferenceTypeAccountingEntriesEvents(); + + this.auditService.track(AuditableAction.Maintenance_SendReferenceTypeAccountingEntriesEvents); + } + + @RequestMapping(method = RequestMethod.POST, value = "/events/users/accounting-entry") + public void sendUserAccountingEntriesEvents() throws InvalidApplicationException { + logger.debug("send user accounting entries queue events"); + this.authorizationService.authorizeForce(Permission.ManageQueueEvents); + + this.maintenanceService.sendUserAccountingEntriesEvents(); + + this.auditService.track(AuditableAction.Maintenance_SendUserAccountingEntriesEvents); + } } diff --git a/backend/web/src/main/resources/config/accounting.yml b/backend/web/src/main/resources/config/accounting.yml index 221201643..f5a908c2d 100644 --- a/backend/web/src/main/resources/config/accounting.yml +++ b/backend/web/src/main/resources/config/accounting.yml @@ -1,3 +1,4 @@ accounting: serviceId: ${SERVICE_ID} action: ${ACCOUNTING_ACTION} + subjectId: unknown diff --git a/frontend/src/app/core/services/maintenance/maintenance.service.ts b/frontend/src/app/core/services/maintenance/maintenance.service.ts index 92a2c28eb..7cf0ea0b0 100644 --- a/frontend/src/app/core/services/maintenance/maintenance.service.ts +++ b/frontend/src/app/core/services/maintenance/maintenance.service.ts @@ -56,4 +56,61 @@ export class MaintenanceService extends BaseService { .post(url, null).pipe( catchError((error: any) => throwError(error))); } + + sendPlanAccountingEntriesEvents(): Observable { + const url = `${this.apiBase}/events/plans/accounting-entry`; + return this.http + .post(url, null).pipe( + catchError((error: any) => throwError(error))); + } + + sendDescriptionAccountingEntriesEvents(): Observable { + const url = `${this.apiBase}/events/descriptions/accounting-entry`; + return this.http + .post(url, null).pipe( + catchError((error: any) => throwError(error))); + } + + + sendBlueprintAccountingEntriesEvents(): Observable { + const url = `${this.apiBase}/events/plan-blueprints/accounting-entry`; + return this.http + .post(url, null).pipe( + catchError((error: any) => throwError(error))); + } + + sendDescriptionTemplateAccountingEntriesEvents(): Observable { + const url = `${this.apiBase}/events/description-templates/accounting-entry`; + return this.http + .post(url, null).pipe( + catchError((error: any) => throwError(error))); + } + + sendDescriptionTemplateTypeAccountingEntriesEvents(): Observable { + const url = `${this.apiBase}/events/description-template-types/accounting-entry`; + return this.http + .post(url, null).pipe( + catchError((error: any) => throwError(error))); + } + + sendPrefillingSourceAccountingEntriesEvents(): Observable { + const url = `${this.apiBase}/events/prefilling-sources/accounting-entry`; + return this.http + .post(url, null).pipe( + catchError((error: any) => throwError(error))); + } + + sendReferenceTypeAccountingEntriesEvents(): Observable { + const url = `${this.apiBase}/events/reference-types/accounting-entry`; + return this.http + .post(url, null).pipe( + catchError((error: any) => throwError(error))); + } + + sendUserAccountingEntriesEvents(): Observable { + const url = `${this.apiBase}/events/users/accounting-entry`; + return this.http + .post(url, null).pipe( + catchError((error: any) => throwError(error))); + } } diff --git a/frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.html b/frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.html index 61a20bc88..9a69a6ab8 100644 --- a/frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.html +++ b/frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.html @@ -35,6 +35,14 @@ + + + + + + + + diff --git a/frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.ts b/frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.ts index 6b03fecc1..230c423e9 100644 --- a/frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.ts +++ b/frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.ts @@ -217,6 +217,254 @@ export class MaintenanceTasksComponent extends BaseComponent implements OnInit { ); } + sendPlanAccountingEntriesEvents(ev: Event) { + this.dialog.open(ConfirmationDialogComponent, { + data: { + message: this.language.instant('MAINTENANCE-TASKS.CONFIRMATION.MESSAGE'), + confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'), + cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL') + }, + maxWidth: '30em' + }) + .afterClosed() + .subscribe(confirm => { + if (confirm) { + this.doSendPlanAccountingEntriesEvents(ev); + } + }); + } + + private doSendPlanAccountingEntriesEvents(ev: Event) { + (ev.target as HTMLButtonElement).disabled = true; + this.maintenanceService.sendPlanAccountingEntriesEvents().pipe(takeUntil(this._destroyed)).subscribe( + _ => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackSuccess(); + }, + error => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackError(error); + } + ); + } + + sendDescriptionAccountingEntriesEvents(ev: Event) { + this.dialog.open(ConfirmationDialogComponent, { + data: { + message: this.language.instant('MAINTENANCE-TASKS.CONFIRMATION.MESSAGE'), + confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'), + cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL') + }, + maxWidth: '30em' + }) + .afterClosed() + .subscribe(confirm => { + if (confirm) { + this.doSendDescriptionAccountingEntriesEvents(ev); + } + }); + } + + private doSendDescriptionAccountingEntriesEvents(ev: Event) { + (ev.target as HTMLButtonElement).disabled = true; + this.maintenanceService.sendDescriptionAccountingEntriesEvents().pipe(takeUntil(this._destroyed)).subscribe( + _ => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackSuccess(); + }, + error => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackError(error); + } + ); + } + + sendBlueprintAccountingEntriesEvents(ev: Event) { + this.dialog.open(ConfirmationDialogComponent, { + data: { + message: this.language.instant('MAINTENANCE-TASKS.CONFIRMATION.MESSAGE'), + confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'), + cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL') + }, + maxWidth: '30em' + }) + .afterClosed() + .subscribe(confirm => { + if (confirm) { + this.doSendBlueprintAccountingEntriesEvents(ev); + } + }); + } + + private doSendBlueprintAccountingEntriesEvents(ev: Event) { + (ev.target as HTMLButtonElement).disabled = true; + this.maintenanceService.sendBlueprintAccountingEntriesEvents().pipe(takeUntil(this._destroyed)).subscribe( + _ => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackSuccess(); + }, + error => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackError(error); + } + ); + } + + sendDescriptionTemplateAccountingEntriesEvents(ev: Event) { + this.dialog.open(ConfirmationDialogComponent, { + data: { + message: this.language.instant('MAINTENANCE-TASKS.CONFIRMATION.MESSAGE'), + confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'), + cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL') + }, + maxWidth: '30em' + }) + .afterClosed() + .subscribe(confirm => { + if (confirm) { + this.doSendDescriptionTemplateAccountingEntriesEvents(ev); + } + }); + } + + private doSendDescriptionTemplateAccountingEntriesEvents(ev: Event) { + (ev.target as HTMLButtonElement).disabled = true; + this.maintenanceService.sendDescriptionTemplateAccountingEntriesEvents().pipe(takeUntil(this._destroyed)).subscribe( + _ => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackSuccess(); + }, + error => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackError(error); + } + ); + } + + sendDescriptionTemplateTypeAccountingEntriesEvents(ev: Event) { + this.dialog.open(ConfirmationDialogComponent, { + data: { + message: this.language.instant('MAINTENANCE-TASKS.CONFIRMATION.MESSAGE'), + confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'), + cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL') + }, + maxWidth: '30em' + }) + .afterClosed() + .subscribe(confirm => { + if (confirm) { + this.doSendDescriptionTemplateTypeAccountingEntriesEvents(ev); + } + }); + } + + private doSendDescriptionTemplateTypeAccountingEntriesEvents(ev: Event) { + (ev.target as HTMLButtonElement).disabled = true; + this.maintenanceService.sendDescriptionTemplateTypeAccountingEntriesEvents().pipe(takeUntil(this._destroyed)).subscribe( + _ => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackSuccess(); + }, + error => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackError(error); + } + ); + } + + sendPrefillingSourceAccountingEntriesEvents(ev: Event) { + this.dialog.open(ConfirmationDialogComponent, { + data: { + message: this.language.instant('MAINTENANCE-TASKS.CONFIRMATION.MESSAGE'), + confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'), + cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL') + }, + maxWidth: '30em' + }) + .afterClosed() + .subscribe(confirm => { + if (confirm) { + this.doSendPrefillingSourceAccountingEntriesEvents(ev); + } + }); + } + + private doSendPrefillingSourceAccountingEntriesEvents(ev: Event) { + (ev.target as HTMLButtonElement).disabled = true; + this.maintenanceService.sendPrefillingSourceAccountingEntriesEvents().pipe(takeUntil(this._destroyed)).subscribe( + _ => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackSuccess(); + }, + error => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackError(error); + } + ); + } + + sendReferenceTypeAccountingEntriesEvents(ev: Event) { + this.dialog.open(ConfirmationDialogComponent, { + data: { + message: this.language.instant('MAINTENANCE-TASKS.CONFIRMATION.MESSAGE'), + confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'), + cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL') + }, + maxWidth: '30em' + }) + .afterClosed() + .subscribe(confirm => { + if (confirm) { + this.doSendReferenceTypeAccountingEntriesEvents(ev); + } + }); + } + + private doSendReferenceTypeAccountingEntriesEvents(ev: Event) { + (ev.target as HTMLButtonElement).disabled = true; + this.maintenanceService.sendReferenceTypeAccountingEntriesEvents().pipe(takeUntil(this._destroyed)).subscribe( + _ => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackSuccess(); + }, + error => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackError(error); + } + ); + } + + sendUserAccountingEntriesEvents(ev: Event) { + this.dialog.open(ConfirmationDialogComponent, { + data: { + message: this.language.instant('MAINTENANCE-TASKS.CONFIRMATION.MESSAGE'), + confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'), + cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL') + }, + maxWidth: '30em' + }) + .afterClosed() + .subscribe(confirm => { + if (confirm) { + this.doSendUserAccountingEntriesEvents(ev); + } + }); + } + + private doSendUserAccountingEntriesEvents(ev: Event) { + (ev.target as HTMLButtonElement).disabled = true; + this.maintenanceService.sendUserAccountingEntriesEvents().pipe(takeUntil(this._destroyed)).subscribe( + _ => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackSuccess(); + }, + error => { + (ev.target as HTMLButtonElement).disabled = false; + this.onCallbackError(error); + } + ); + } + onCallbackSuccess(): void { this.uiNotificationService.snackBarNotification(this.translate.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); this.router.navigate(['/reload']).then(() => this.router.navigate([this.routerUtils.generateUrl('/maintenance-tasks')])); diff --git a/frontend/src/assets/i18n/baq.json b/frontend/src/assets/i18n/baq.json index 2ae9d7d00..c74bf5cf8 100644 --- a/frontend/src/assets/i18n/baq.json +++ b/frontend/src/assets/i18n/baq.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } }, diff --git a/frontend/src/assets/i18n/de.json b/frontend/src/assets/i18n/de.json index e016585d2..af46bf352 100644 --- a/frontend/src/assets/i18n/de.json +++ b/frontend/src/assets/i18n/de.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } }, diff --git a/frontend/src/assets/i18n/en.json b/frontend/src/assets/i18n/en.json index 6b5fcecbe..4945c52a7 100644 --- a/frontend/src/assets/i18n/en.json +++ b/frontend/src/assets/i18n/en.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } }, diff --git a/frontend/src/assets/i18n/es.json b/frontend/src/assets/i18n/es.json index 0841ba4ec..f229b9a6c 100644 --- a/frontend/src/assets/i18n/es.json +++ b/frontend/src/assets/i18n/es.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } }, diff --git a/frontend/src/assets/i18n/gr.json b/frontend/src/assets/i18n/gr.json index 1af9a21db..7373be8af 100644 --- a/frontend/src/assets/i18n/gr.json +++ b/frontend/src/assets/i18n/gr.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } }, diff --git a/frontend/src/assets/i18n/hr.json b/frontend/src/assets/i18n/hr.json index 3cc738b5c..fb5de98a3 100644 --- a/frontend/src/assets/i18n/hr.json +++ b/frontend/src/assets/i18n/hr.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } }, diff --git a/frontend/src/assets/i18n/pl.json b/frontend/src/assets/i18n/pl.json index 1421dfe99..7944af8a7 100644 --- a/frontend/src/assets/i18n/pl.json +++ b/frontend/src/assets/i18n/pl.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } }, diff --git a/frontend/src/assets/i18n/pt.json b/frontend/src/assets/i18n/pt.json index c3ea07d1b..8c5ab94db 100644 --- a/frontend/src/assets/i18n/pt.json +++ b/frontend/src/assets/i18n/pt.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } }, diff --git a/frontend/src/assets/i18n/sk.json b/frontend/src/assets/i18n/sk.json index 40b6da80f..81368fa01 100644 --- a/frontend/src/assets/i18n/sk.json +++ b/frontend/src/assets/i18n/sk.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } }, diff --git a/frontend/src/assets/i18n/sr.json b/frontend/src/assets/i18n/sr.json index e0eabeb39..8f75e7e6c 100644 --- a/frontend/src/assets/i18n/sr.json +++ b/frontend/src/assets/i18n/sr.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } }, diff --git a/frontend/src/assets/i18n/tr.json b/frontend/src/assets/i18n/tr.json index d49c8ed76..53015c847 100644 --- a/frontend/src/assets/i18n/tr.json +++ b/frontend/src/assets/i18n/tr.json @@ -366,7 +366,15 @@ "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", "SEND-PLAN-TOUCH": "Send plan touch events", - "SEND-DESCRIPTION-TOUCH": "Send description touch events" + "SEND-DESCRIPTION-TOUCH": "Send description touch events", + "SEND-PLAN-ACCOUNTING-ENTRIES": "Send plan accounting entries events", + "SEND-PLAN-BLUEPRINT-ACCOUNTING-ENTRIES": "Send plan blueprint accounting entries events", + "SEND-DESCRIPTION-ACCOUNTING-ENTRIES": "Send description accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-ACCOUNTING-ENTRIES": "Send description template accounting entries events", + "SEND-DESCRIPTION-TEMPLATE-TYPE-ACCOUNTING-ENTRIES": "Send description template types accounting entries events", + "SEND-PREFILLING-SOURCE-ACCOUNTING-ENTRIES": "Send prefilling source accounting entries events", + "SEND-REFERENCE-TYPE-ACCOUNTING-ENTRIES": "Send reference type accounting entries events", + "SEND-USER-ACCOUNTING-ENTRIES": "Send user accounting entries events" } } },