diff --git a/backend/pom.xml b/backend/pom.xml
index 3c4b755..7d96188 100644
--- a/backend/pom.xml
+++ b/backend/pom.xml
@@ -167,6 +167,14 @@
org.postgresql
postgresql
+
+ org.springframework.kafka
+ spring-kafka
+
+
+ org.apache.kafka
+ kafka-clients
+
${project.parent.artifactId}
diff --git a/backend/src/main/java/AppConfig.java b/backend/src/main/java/AppConfig.java
index 9c1d462..d9b024a 100644
--- a/backend/src/main/java/AppConfig.java
+++ b/backend/src/main/java/AppConfig.java
@@ -22,8 +22,10 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
/**
@@ -117,4 +119,10 @@ public class AppConfig {
throw new AppInitializeException(e);
}
}
+
+ @Bean
+ public RestTemplate restTemplate() {
+ return new RestTemplate();
+ }
+
}
diff --git a/backend/src/main/java/ervu_business_metrics/config/IdmReconcileEnabledCondition.java b/backend/src/main/java/ervu_business_metrics/config/IdmReconcileEnabledCondition.java
new file mode 100644
index 0000000..2af5f0d
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/config/IdmReconcileEnabledCondition.java
@@ -0,0 +1,19 @@
+package ervu_business_metrics.config;
+
+import org.springframework.context.annotation.Condition;
+import org.springframework.context.annotation.ConditionContext;
+import org.springframework.core.env.Environment;
+import org.springframework.core.type.AnnotatedTypeMetadata;
+
+/**
+ * @author Adel Kalimullin
+ */
+public class IdmReconcileEnabledCondition implements Condition {
+ private static final String ERVU_RECONCILE_ENABLED = "ervu.idm.reconcile.enabled";
+
+ @Override
+ public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
+ Environment env = context.getEnvironment();
+ return Boolean.parseBoolean(env.getProperty(ERVU_RECONCILE_ENABLED, "true"));
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/dao/IdmDirectoriesDao.java b/backend/src/main/java/ervu_business_metrics/dao/IdmDirectoriesDao.java
new file mode 100644
index 0000000..0a497ba
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/dao/IdmDirectoriesDao.java
@@ -0,0 +1,112 @@
+package ervu_business_metrics.dao;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import ervu_business_metrics.config.IdmReconcileEnabledCondition;
+import org.jooq.DSLContext;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.stereotype.Repository;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.AccountRecord;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.AccountRoleRecord;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.DomainRecord;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.RoleRecord;
+
+import static ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.Tables.ACCOUNT;
+import static ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.Tables.ACCOUNT_ROLE;
+import static ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.Tables.DOMAIN;
+import static ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.Tables.ROLE;
+
+/**
+ * @author Adel Kalimullin
+ */
+@Repository
+@Conditional(IdmReconcileEnabledCondition.class)
+public class IdmDirectoriesDao {
+ private final DSLContext dsl;
+
+ public IdmDirectoriesDao(DSLContext dsl) {
+ this.dsl = dsl;
+ }
+
+ public RoleRecord getRoleRecord() {
+ return dsl.newRecord(ROLE);
+ }
+
+ public DomainRecord getDomainRecord() {
+ return dsl.newRecord(DOMAIN);
+ }
+
+ public AccountRecord getAccountRecord() {
+ return dsl.newRecord(ACCOUNT);
+ }
+
+ public AccountRoleRecord getAccountRoleRecord() {
+ return dsl.newRecord(ACCOUNT_ROLE);
+ }
+
+ public Set getAccountIds() {
+ return dsl.select(ACCOUNT.ID)
+ .from(ACCOUNT)
+ .fetchSet(ACCOUNT.ID);
+ }
+
+ public Set getRoleIds() {
+ return dsl.select(ROLE.ID)
+ .from(ROLE)
+ .fetchSet(ROLE.ID);
+ }
+
+ public Set getDomainIds() {
+ return dsl.select(DOMAIN.ID)
+ .from(DOMAIN)
+ .fetchSet(DOMAIN.ID);
+ }
+
+ public void insertDomainRecords(List domainRecords) {
+ dsl.batchInsert(domainRecords).execute();
+ }
+
+ public void updateDomainRecords(List domainRecords) {
+ dsl.batchUpdate(domainRecords).execute();
+ }
+
+ public void insertRoleRecords(List newRoleRecords) {
+ dsl.batchInsert(newRoleRecords).execute();
+ }
+
+ public void updateRoleRecords(List roleRecords) {
+ dsl.batchUpdate(roleRecords).execute();
+ }
+
+ public void insertAccountRecords(List newAccountRecords) {
+ dsl.batchInsert(newAccountRecords).execute();
+ }
+
+ public void updateAccountRecords(List accountRecords) {
+ dsl.batchUpdate(accountRecords).execute();
+ }
+
+ public void insertAccountRoleRecords(List newAccountRoleRecords) {
+ dsl.batchInsert(newAccountRoleRecords).execute();
+ }
+
+ public void deleteAccountRolesByAccountIds(List accountIds) {
+ dsl.deleteFrom(ACCOUNT_ROLE)
+ .where(ACCOUNT_ROLE.ACCOUNT_ID.in(accountIds))
+ .execute();
+ }
+
+ public void deleteAccountByIds(List accountIds) {
+ dsl.deleteFrom(ACCOUNT)
+ .where(ACCOUNT.ID.in(accountIds))
+ .execute();
+ }
+
+ public void deleteDomainsByIds(List domainIds) {
+ dsl.deleteFrom(DOMAIN)
+ .where(DOMAIN.ID.in(domainIds))
+ .execute();
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/kafka/KafkaConfig.java b/backend/src/main/java/ervu_business_metrics/kafka/KafkaConfig.java
new file mode 100644
index 0000000..0fd473b
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/kafka/KafkaConfig.java
@@ -0,0 +1,71 @@
+package ervu_business_metrics.kafka;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import ervu_business_metrics.config.IdmReconcileEnabledCondition;
+import org.apache.kafka.clients.CommonClientConfigs;
+import org.apache.kafka.clients.consumer.ConsumerConfig;
+import org.apache.kafka.common.config.SaslConfigs;
+import org.apache.kafka.common.serialization.StringDeserializer;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.kafka.annotation.EnableKafka;
+import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
+import org.springframework.kafka.config.KafkaListenerEndpointRegistry;
+import org.springframework.kafka.core.ConsumerFactory;
+import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
+
+/**
+ * @author Adel Kalimullin
+ */
+@Configuration
+@EnableKafka
+@Conditional(IdmReconcileEnabledCondition.class)
+public class KafkaConfig {
+ @Value("${kafka.hosts}")
+ private String bootstrapServers;
+ @Value("${kafka.auth_sec_proto}")
+ private String securityProtocol;
+ @Value("${kafka.auth_sasl_module}")
+ private String loginModule;
+ @Value("${kafka.user}")
+ private String username;
+ @Value("${kafka.pass}")
+ private String password;
+ @Value("${kafka.auth_sasl_mech}")
+ private String saslMechanism;
+
+ @Bean
+ public KafkaListenerEndpointRegistry kafkaListenerEndpointRegistry() {
+ return new KafkaListenerEndpointRegistry();
+ }
+
+ @Bean
+ public ConsumerFactory consumerFactory() {
+ return new DefaultKafkaConsumerFactory<>(consumerConfigs());
+ }
+
+ @Bean
+ public Map consumerConfigs() {
+ Map props = new HashMap<>();
+ props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
+ props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
+ props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
+ props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, securityProtocol);
+ props.put(SaslConfigs.SASL_JAAS_CONFIG, loginModule + " required username=\""
+ + username + "\" password=\"" + password + "\";");
+ props.put(SaslConfigs.SASL_MECHANISM, saslMechanism);
+ props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest");
+ return props;
+ }
+
+ @Bean
+ public ConcurrentKafkaListenerContainerFactory kafkaListenerContainerFactory() {
+ ConcurrentKafkaListenerContainerFactory factory = new ConcurrentKafkaListenerContainerFactory<>();
+ factory.setConsumerFactory(consumerFactory());
+ return factory;
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/kafka/KafkaConsumerInitializer.java b/backend/src/main/java/ervu_business_metrics/kafka/KafkaConsumerInitializer.java
new file mode 100644
index 0000000..fa362fa
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/kafka/KafkaConsumerInitializer.java
@@ -0,0 +1,38 @@
+package ervu_business_metrics.kafka;
+
+import javax.annotation.PostConstruct;
+
+import ervu_business_metrics.config.IdmReconcileEnabledCondition;
+import ervu_business_metrics.service.IdmDirectoriesService;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.DependsOn;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author Adel Kalimullin
+ */
+@Component
+@DependsOn("idmDirectoriesListener")
+@Conditional(IdmReconcileEnabledCondition.class)
+public class KafkaConsumerInitializer {
+ private final IdmDirectoriesService idmDirectoriesService;
+
+ public KafkaConsumerInitializer(IdmDirectoriesService idmDirectoriesService) {
+ this.idmDirectoriesService = idmDirectoriesService;
+ }
+
+ @PostConstruct
+ public void initialize() {
+ new Thread(this::runWithSleep).start();
+ }
+
+ private void runWithSleep() {
+ try {
+ Thread.sleep(10000);
+ }
+ catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ idmDirectoriesService.updateDirectories();
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/kafka/listener/IdmDirectoriesListener.java b/backend/src/main/java/ervu_business_metrics/kafka/listener/IdmDirectoriesListener.java
new file mode 100644
index 0000000..eda5cf5
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/kafka/listener/IdmDirectoriesListener.java
@@ -0,0 +1,68 @@
+package ervu_business_metrics.kafka.listener;
+
+import ervu_business_metrics.config.IdmReconcileEnabledCondition;
+import ervu_business_metrics.model.AccountData;
+import ervu_business_metrics.model.DomainData;
+import ervu_business_metrics.model.RoleData;
+import ervu_business_metrics.service.IdmDirectoriesService;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.kafka.annotation.KafkaListener;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author Adel Kalimullin
+ */
+@Component
+@Conditional(IdmReconcileEnabledCondition.class)
+public class IdmDirectoriesListener {
+ private final IdmDirectoriesService idmDirectoriesService;
+
+ public IdmDirectoriesListener(IdmDirectoriesService idmDirectoriesService) {
+ this.idmDirectoriesService = idmDirectoriesService;
+ }
+
+ @KafkaListener(id = "${kafka.domain.group.id}", topics = "${kafka.domain.reconciliation}")
+ public void listenKafkaDomain(String kafkaMessage) {
+ idmDirectoriesService.processUpsertMessage(kafkaMessage, DomainData.class);
+ }
+
+ @KafkaListener(id = "${kafka.role.group.id}", topics = "${kafka.role.reconciliation}")
+ public void listenKafkaRole(String kafkaMessage) {
+ idmDirectoriesService.processUpsertMessage(kafkaMessage, RoleData.class);
+ }
+
+ @KafkaListener(id = "${kafka.account.group.id}", topics = "${kafka.account.reconciliation}")
+ public void listenKafkaAccount(String kafkaMessage) {
+ idmDirectoriesService.processUpsertMessage(kafkaMessage, AccountData.class);
+ }
+
+ @KafkaListener(id = "${kafka.domain.updated.group.id}", topics = "${kafka.domain.updated}")
+ public void listenKafkaDomainUpdated(String kafkaMessage) {
+ idmDirectoriesService.processUpsertMessage(kafkaMessage, DomainData.class);
+ }
+
+ @KafkaListener(id = "${kafka.domain.created.group.id}", topics = "${kafka.domain.created}")
+ public void listenKafkaDomainCreated(String kafkaMessage) {
+ idmDirectoriesService.processUpsertMessage(kafkaMessage, DomainData.class);
+ }
+
+ @KafkaListener(id = "${kafka.account.updated.group.id}", topics = "${kafka.account.updated}")
+ public void listenKafkaAccountUpdated(String kafkaMessage) {
+ idmDirectoriesService.processUpsertMessage(kafkaMessage, AccountData.class);
+ }
+
+ @KafkaListener(id = "${kafka.account.created.group.id}", topics = "${kafka.account.created}")
+ public void listenKafkaAccountCreated(String kafkaMessage) {
+ idmDirectoriesService.processUpsertMessage(kafkaMessage, AccountData.class);
+ }
+
+ @KafkaListener(id = "${kafka.domain.deleted.group.id}", topics = "${kafka.domain.deleted}")
+ public void listenKafkaDomainDeleted(String kafkaMessage) {
+ idmDirectoriesService.processDeleteMessage(kafkaMessage, DomainData.class);
+ }
+
+ @KafkaListener(id = "${kafka.account.deleted.group.id}", topics = "${kafka.account.deleted}")
+ public void listenKafkaAccountDeleted(String kafkaMessage) {
+ idmDirectoriesService.processDeleteMessage(kafkaMessage, AccountData.class);
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/kafka/model/DeleteKafkaMessage.java b/backend/src/main/java/ervu_business_metrics/kafka/model/DeleteKafkaMessage.java
new file mode 100644
index 0000000..0382c67
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/kafka/model/DeleteKafkaMessage.java
@@ -0,0 +1,47 @@
+package ervu_business_metrics.kafka.model;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * @author Adel Kalimullin
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class DeleteKafkaMessage {
+ private boolean success;
+ private String message;
+ private List data;
+ private String origin;
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public String getOrigin() {
+ return origin;
+ }
+
+ public void setOrigin(String origin) {
+ this.origin = origin;
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/kafka/model/UpsertMessage.java b/backend/src/main/java/ervu_business_metrics/kafka/model/UpsertMessage.java
new file mode 100644
index 0000000..220dafc
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/kafka/model/UpsertMessage.java
@@ -0,0 +1,21 @@
+package ervu_business_metrics.kafka.model;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * @author Adel Kalimullin
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class UpsertMessage{
+ private List data;
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/model/AccountData.java b/backend/src/main/java/ervu_business_metrics/model/AccountData.java
new file mode 100644
index 0000000..938965a
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/model/AccountData.java
@@ -0,0 +1,135 @@
+package ervu_business_metrics.model;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import ervu_business_metrics.model.deserializer.ReferenceEntityDeserializer;
+
+/**
+ * @author Adel Kalimullin
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class AccountData {
+ private String id;
+ private int version;
+ private long modified;
+ private String schema;
+ private String start;
+ private String finish;
+ private boolean enabled;
+ private String position;
+ private String fio;
+ private String workMail;
+ private boolean esiaAccount;
+ @JsonProperty("user-domain")
+ @JsonDeserialize(using = ReferenceEntityDeserializer.class)
+ private ReferenceEntity userDomain;
+ private List roles;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public int getVersion() {
+ return version;
+ }
+
+ public void setVersion(int version) {
+ this.version = version;
+ }
+
+ public long getModified() {
+ return modified;
+ }
+
+ public void setModified(long modified) {
+ this.modified = modified;
+ }
+
+ public String getSchema() {
+ return schema;
+ }
+
+ public void setSchema(String schema) {
+ this.schema = schema;
+ }
+
+ public String getStart() {
+ return start;
+ }
+
+ public void setStart(String start) {
+ this.start = start;
+ }
+
+ public String getFinish() {
+ return finish;
+ }
+
+ public void setFinish(String finish) {
+ this.finish = finish;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public String getPosition() {
+ return position;
+ }
+
+ public void setPosition(String position) {
+ this.position = position;
+ }
+
+ public String getFio() {
+ return fio;
+ }
+
+ public void setFio(String fio) {
+ this.fio = fio;
+ }
+
+ public String getWorkMail() {
+ return workMail;
+ }
+
+ public void setWorkMail(String workMail) {
+ this.workMail = workMail;
+ }
+
+ public boolean isEsiaAccount() {
+ return esiaAccount;
+ }
+
+ public void setEsiaAccount(boolean esiaAccount) {
+ this.esiaAccount = esiaAccount;
+ }
+
+ public ReferenceEntity getUserDomain() {
+ return userDomain;
+ }
+
+ public void setUserDomain(ReferenceEntity userDomain) {
+ this.userDomain = userDomain;
+ }
+
+ public List getRoles() {
+ return roles;
+ }
+
+ public void setRoles(List roles) {
+ this.roles = roles;
+ }
+}
+
diff --git a/backend/src/main/java/ervu_business_metrics/model/DomainData.java b/backend/src/main/java/ervu_business_metrics/model/DomainData.java
new file mode 100644
index 0000000..de3db50
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/model/DomainData.java
@@ -0,0 +1,460 @@
+package ervu_business_metrics.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * @author Adel Kalimullin
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class DomainData {
+ private String id;
+ private int version;
+ private long modified;
+ private String schema;
+ private String name;
+ private String shortname;
+ private String fullname;
+ private String dns;
+ private String email;
+ private String phone;
+ private String address;
+ private String postalAddress;
+ private String addressId;
+ private String postalAddressId;
+ private String militaryCode;
+ private String timezone;
+ private boolean reportsEnabled;
+ private String inn;
+ private String leg;
+ private String ogrn;
+ private String region;
+ private String epguId;
+ private String type;
+ private boolean esiaEmployeeAuthorization;
+ private String defaultS3Bucket;
+ private String opf;
+ private String kpp;
+ private String checkingAccount;
+ private String bik;
+ private String bankName;
+ private String bankCorrespondentAccount;
+ private String oktmo;
+ private String okato;
+ private String govRegistrationDate;
+ private String govOrganizationType;
+ private String aliasKey;
+ private String passKey;
+ private String certificate;
+ private String accountNumberTOFK;
+ private String bikTOFK;
+ private String correspondentBankAccountTOFK;
+ private String nameTOFK;
+ private String nsiOrganizationId;
+ private String docHandle;
+ private String divisionType;
+ private String tnsDepartmentId;
+ private boolean enabled;
+ private String parent;
+ private String regionId;
+ private String managed;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public int getVersion() {
+ return version;
+ }
+
+ public void setVersion(int version) {
+ this.version = version;
+ }
+
+ public long getModified() {
+ return modified;
+ }
+
+ public void setModified(long modified) {
+ this.modified = modified;
+ }
+
+ public String getSchema() {
+ return schema;
+ }
+
+ public void setSchema(String schema) {
+ this.schema = schema;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getShortname() {
+ return shortname;
+ }
+
+ public void setShortname(String shortname) {
+ this.shortname = shortname;
+ }
+
+ public String getFullname() {
+ return fullname;
+ }
+
+ public void setFullname(String fullname) {
+ this.fullname = fullname;
+ }
+
+ public String getDns() {
+ return dns;
+ }
+
+ public void setDns(String dns) {
+ this.dns = dns;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getPostalAddress() {
+ return postalAddress;
+ }
+
+ public void setPostalAddress(String postalAddress) {
+ this.postalAddress = postalAddress;
+ }
+
+ public String getAddressId() {
+ return addressId;
+ }
+
+ public void setAddressId(String addressId) {
+ this.addressId = addressId;
+ }
+
+ public String getPostalAddressId() {
+ return postalAddressId;
+ }
+
+ public void setPostalAddressId(String postalAddressId) {
+ this.postalAddressId = postalAddressId;
+ }
+
+ public String getMilitaryCode() {
+ return militaryCode;
+ }
+
+ public void setMilitaryCode(String militaryCode) {
+ this.militaryCode = militaryCode;
+ }
+
+ public String getTimezone() {
+ return timezone;
+ }
+
+ public void setTimezone(String timezone) {
+ this.timezone = timezone;
+ }
+
+ public boolean isReportsEnabled() {
+ return reportsEnabled;
+ }
+
+ public void setReportsEnabled(boolean reportsEnabled) {
+ this.reportsEnabled = reportsEnabled;
+ }
+
+ public String getInn() {
+ return inn;
+ }
+
+ public void setInn(String inn) {
+ this.inn = inn;
+ }
+
+ public String getLeg() {
+ return leg;
+ }
+
+ public void setLeg(String leg) {
+ this.leg = leg;
+ }
+
+ public String getOgrn() {
+ return ogrn;
+ }
+
+ public void setOgrn(String ogrn) {
+ this.ogrn = ogrn;
+ }
+
+ public String getRegion() {
+ return region;
+ }
+
+ public void setRegion(String region) {
+ this.region = region;
+ }
+
+ public String getEpguId() {
+ return epguId;
+ }
+
+ public void setEpguId(String epguId) {
+ this.epguId = epguId;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public boolean isEsiaEmployeeAuthorization() {
+ return esiaEmployeeAuthorization;
+ }
+
+ public void setEsiaEmployeeAuthorization(boolean esiaEmployeeAuthorization) {
+ this.esiaEmployeeAuthorization = esiaEmployeeAuthorization;
+ }
+
+ public String getDefaultS3Bucket() {
+ return defaultS3Bucket;
+ }
+
+ public void setDefaultS3Bucket(String defaultS3Bucket) {
+ this.defaultS3Bucket = defaultS3Bucket;
+ }
+
+ public String getOpf() {
+ return opf;
+ }
+
+ public void setOpf(String opf) {
+ this.opf = opf;
+ }
+
+ public String getKpp() {
+ return kpp;
+ }
+
+ public void setKpp(String kpp) {
+ this.kpp = kpp;
+ }
+
+ public String getCheckingAccount() {
+ return checkingAccount;
+ }
+
+ public void setCheckingAccount(String checkingAccount) {
+ this.checkingAccount = checkingAccount;
+ }
+
+ public String getBik() {
+ return bik;
+ }
+
+ public void setBik(String bik) {
+ this.bik = bik;
+ }
+
+ public String getBankName() {
+ return bankName;
+ }
+
+ public void setBankName(String bankName) {
+ this.bankName = bankName;
+ }
+
+ public String getBankCorrespondentAccount() {
+ return bankCorrespondentAccount;
+ }
+
+ public void setBankCorrespondentAccount(String bankCorrespondentAccount) {
+ this.bankCorrespondentAccount = bankCorrespondentAccount;
+ }
+
+ public String getOktmo() {
+ return oktmo;
+ }
+
+ public void setOktmo(String oktmo) {
+ this.oktmo = oktmo;
+ }
+
+ public String getOkato() {
+ return okato;
+ }
+
+ public void setOkato(String okato) {
+ this.okato = okato;
+ }
+
+ public String getGovRegistrationDate() {
+ return govRegistrationDate;
+ }
+
+ public void setGovRegistrationDate(String govRegistrationDate) {
+ this.govRegistrationDate = govRegistrationDate;
+ }
+
+ public String getGovOrganizationType() {
+ return govOrganizationType;
+ }
+
+ public void setGovOrganizationType(String govOrganizationType) {
+ this.govOrganizationType = govOrganizationType;
+ }
+
+ public String getAliasKey() {
+ return aliasKey;
+ }
+
+ public void setAliasKey(String aliasKey) {
+ this.aliasKey = aliasKey;
+ }
+
+ public String getPassKey() {
+ return passKey;
+ }
+
+ public void setPassKey(String passKey) {
+ this.passKey = passKey;
+ }
+
+ public String getCertificate() {
+ return certificate;
+ }
+
+ public void setCertificate(String certificate) {
+ this.certificate = certificate;
+ }
+
+ public String getAccountNumberTOFK() {
+ return accountNumberTOFK;
+ }
+
+ public void setAccountNumberTOFK(String accountNumberTOFK) {
+ this.accountNumberTOFK = accountNumberTOFK;
+ }
+
+ public String getBikTOFK() {
+ return bikTOFK;
+ }
+
+ public void setBikTOFK(String bikTOFK) {
+ this.bikTOFK = bikTOFK;
+ }
+
+ public String getCorrespondentBankAccountTOFK() {
+ return correspondentBankAccountTOFK;
+ }
+
+ public void setCorrespondentBankAccountTOFK(String correspondentBankAccountTOFK) {
+ this.correspondentBankAccountTOFK = correspondentBankAccountTOFK;
+ }
+
+ public String getNameTOFK() {
+ return nameTOFK;
+ }
+
+ public void setNameTOFK(String nameTOFK) {
+ this.nameTOFK = nameTOFK;
+ }
+
+ public String getNsiOrganizationId() {
+ return nsiOrganizationId;
+ }
+
+ public void setNsiOrganizationId(String nsiOrganizationId) {
+ this.nsiOrganizationId = nsiOrganizationId;
+ }
+
+ public String getDocHandle() {
+ return docHandle;
+ }
+
+ public void setDocHandle(String docHandle) {
+ this.docHandle = docHandle;
+ }
+
+ public String getDivisionType() {
+ return divisionType;
+ }
+
+ public void setDivisionType(String divisionType) {
+ this.divisionType = divisionType;
+ }
+
+ public String getTnsDepartmentId() {
+ return tnsDepartmentId;
+ }
+
+ public void setTnsDepartmentId(String tnsDepartmentId) {
+ this.tnsDepartmentId = tnsDepartmentId;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public String getParent() {
+ return parent;
+ }
+
+ public void setParent(String parent) {
+ this.parent = parent;
+ }
+
+ public String getRegionId() {
+ return regionId;
+ }
+
+ public void setRegionId(String regionId) {
+ this.regionId = regionId;
+ }
+
+ public String getManaged() {
+ return managed;
+ }
+
+ public void setManaged(String managed) {
+ this.managed = managed;
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/model/ReferenceEntity.java b/backend/src/main/java/ervu_business_metrics/model/ReferenceEntity.java
new file mode 100644
index 0000000..2e48519
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/model/ReferenceEntity.java
@@ -0,0 +1,23 @@
+package ervu_business_metrics.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * @author Adel Kalimullin
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ReferenceEntity {
+ private String id;
+
+ public ReferenceEntity(String id) {
+ this.id = id;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/model/RoleData.java b/backend/src/main/java/ervu_business_metrics/model/RoleData.java
new file mode 100644
index 0000000..76466d2
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/model/RoleData.java
@@ -0,0 +1,109 @@
+package ervu_business_metrics.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * @author Adel Kalimullin
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class RoleData {
+ private String id;
+ private int version;
+ private long modified;
+ private String schema;
+ private String name;
+ private String shortname;
+ private String displayName;
+ private int sessionsLimit;
+ private boolean ervuRole;
+ private int imported;
+ private String description;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public int getVersion() {
+ return version;
+ }
+
+ public void setVersion(int version) {
+ this.version = version;
+ }
+
+ public long getModified() {
+ return modified;
+ }
+
+ public void setModified(long modified) {
+ this.modified = modified;
+ }
+
+ public String getSchema() {
+ return schema;
+ }
+
+ public void setSchema(String schema) {
+ this.schema = schema;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getShortname() {
+ return shortname;
+ }
+
+ public void setShortname(String shortname) {
+ this.shortname = shortname;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public int getSessionsLimit() {
+ return sessionsLimit;
+ }
+
+ public void setSessionsLimit(int sessionsLimit) {
+ this.sessionsLimit = sessionsLimit;
+ }
+
+ public boolean isErvuRole() {
+ return ervuRole;
+ }
+
+ public void setErvuRole(boolean ervuRole) {
+ this.ervuRole = ervuRole;
+ }
+
+ public int getImported() {
+ return imported;
+ }
+
+ public void setImported(int imported) {
+ this.imported = imported;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/model/deserializer/ReferenceEntityDeserializer.java b/backend/src/main/java/ervu_business_metrics/model/deserializer/ReferenceEntityDeserializer.java
new file mode 100644
index 0000000..43c244d
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/model/deserializer/ReferenceEntityDeserializer.java
@@ -0,0 +1,34 @@
+package ervu_business_metrics.model.deserializer;
+
+import java.io.IOException;
+
+import com.fasterxml.jackson.core.JacksonException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonNode;
+import ervu_business_metrics.model.ReferenceEntity;
+
+/**
+ * @author Adel Kalimullin
+ */
+public class ReferenceEntityDeserializer extends JsonDeserializer {
+
+ @Override
+ public ReferenceEntity deserialize(JsonParser jsonParser,
+ DeserializationContext deserializationContext) throws IOException, JacksonException {
+ JsonNode node = jsonParser.readValueAsTree();
+
+ if (node.isTextual()) {
+ return new ReferenceEntity(node.asText());
+ }
+ else if (node.isObject()) {
+ JsonNode idNode = node.get("id");
+ if (idNode != null && idNode.isTextual()) {
+ return new ReferenceEntity(idNode.asText());
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/service/IdmDirectoriesDaoService.java b/backend/src/main/java/ervu_business_metrics/service/IdmDirectoriesDaoService.java
new file mode 100644
index 0000000..d25b6ea
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/service/IdmDirectoriesDaoService.java
@@ -0,0 +1,103 @@
+package ervu_business_metrics.service;
+
+
+import java.util.List;
+import java.util.Set;
+
+import ervu_business_metrics.dao.IdmDirectoriesDao;
+import ervu_business_metrics.config.IdmReconcileEnabledCondition;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.stereotype.Repository;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.*;
+
+
+/**
+ * @author Adel Kalimullin
+ */
+@Repository
+@Conditional(IdmReconcileEnabledCondition.class)
+public class IdmDirectoriesDaoService {
+ private final IdmDirectoriesDao idmDirectoriesDao;
+
+ public IdmDirectoriesDaoService(IdmDirectoriesDao idmDirectoriesDao) {
+ this.idmDirectoriesDao = idmDirectoriesDao;
+ }
+
+ public RoleRecord getRoleRecord() {
+ return idmDirectoriesDao.getRoleRecord();
+ }
+
+ public DomainRecord getDomainRecord() {
+ return idmDirectoriesDao.getDomainRecord();
+ }
+
+ public AccountRecord getAccountRecord() {
+ return idmDirectoriesDao.getAccountRecord();
+ }
+
+ public AccountRoleRecord getAccountRoleRecord() {
+ return idmDirectoriesDao.getAccountRoleRecord();
+ }
+
+ @Cacheable(value = "account-ids", unless = "#result == null")
+ public Set getAccountIds() {
+ return idmDirectoriesDao.getAccountIds();
+ }
+
+ @Cacheable(value = "role-ids", unless = "#result == null")
+ public Set getRoleIds() {
+ return idmDirectoriesDao.getRoleIds();
+ }
+
+ @Cacheable(value = "domain-ids", unless = "#result == null")
+ public Set getDomainIds() {
+ return idmDirectoriesDao.getDomainIds();
+ }
+
+ @CacheEvict(value = "domain-ids", allEntries = true)
+ public void insertDomainRecords(List newDomainRecords) {
+ idmDirectoriesDao.insertDomainRecords(newDomainRecords);
+ }
+
+ public void updateDomainRecords(List domainRecords) {
+ idmDirectoriesDao.updateDomainRecords(domainRecords);
+ }
+
+ @CacheEvict(value = "role-ids", allEntries = true)
+ public void insertRoleRecords(List newRoleRecords) {
+ idmDirectoriesDao.insertRoleRecords(newRoleRecords);
+ }
+
+ public void updateRoleRecords(List roleRecords) {
+ idmDirectoriesDao.updateRoleRecords(roleRecords);
+ }
+
+ @CacheEvict(value = "account-ids", allEntries = true)
+ public void insertAccountRecords(List accountRecords) {
+ idmDirectoriesDao.insertAccountRecords(accountRecords);
+ }
+
+ public void updateAccountRecords(List accountRecords) {
+ idmDirectoriesDao.updateAccountRecords(accountRecords);
+ }
+
+ public void insertAccountRoleRecords(List newAccountRoleRecords) {
+ idmDirectoriesDao.insertAccountRoleRecords(newAccountRoleRecords);
+ }
+
+ public void deleteAccountRolesByAccountIds(List accountIds) {
+ idmDirectoriesDao.deleteAccountRolesByAccountIds(accountIds);
+ }
+
+ @CacheEvict(value = "domain-ids", allEntries = true)
+ public void deleteDomainsByIds(List domainIds) {
+ idmDirectoriesDao.deleteDomainsByIds(domainIds);
+ }
+
+ @CacheEvict(value = "account-ids", allEntries = true)
+ public void deleteAccountsByIds(List accountIds) {
+ idmDirectoriesDao.deleteAccountByIds(accountIds);
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/service/IdmDirectoriesService.java b/backend/src/main/java/ervu_business_metrics/service/IdmDirectoriesService.java
new file mode 100644
index 0000000..93d2d08
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/service/IdmDirectoriesService.java
@@ -0,0 +1,142 @@
+package ervu_business_metrics.service;
+
+import java.lang.invoke.MethodHandles;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import ervu_business_metrics.config.IdmReconcileEnabledCondition;
+import ervu_business_metrics.kafka.model.DeleteKafkaMessage;
+import ervu_business_metrics.kafka.model.UpsertMessage;
+import ervu_business_metrics.model.AccountData;
+import ervu_business_metrics.model.DomainData;
+import ervu_business_metrics.model.RoleData;
+import ervu_business_metrics.service.processor.impl.AccountDataProcessor;
+import ervu_business_metrics.service.processor.DataProcessor;
+import ervu_business_metrics.service.processor.impl.DomainDataProcessor;
+import ervu_business_metrics.service.processor.impl.RoleDataProcessor;
+import exception.IdmDirectoriesException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Caching;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.DependsOn;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @author Adel Kalimullin
+ */
+@Component
+@DependsOn("liquibase")
+@Conditional(IdmReconcileEnabledCondition.class)
+public class IdmDirectoriesService {
+ private static final Logger LOGGER = LoggerFactory.getLogger(
+ MethodHandles.lookup().lookupClass());
+ private final RestTemplate restTemplate;
+ private final ObjectMapper objectMapper;
+ private final Map, DataProcessor>> dataProcessors = new HashMap<>();
+ @Value("${ervu.idm.url}")
+ private String idmUrl;
+ @Value("${ervu.directories:domain, role , account }")
+ private String ervuDirectories;
+
+ public IdmDirectoriesService(
+ RestTemplate restTemplate,
+ AccountDataProcessor accountDataProcessor,
+ DomainDataProcessor domainDataProcessor,
+ RoleDataProcessor roleDataProcessor, ObjectMapper objectMapper) {
+ this.restTemplate = restTemplate;
+ this.objectMapper = objectMapper;
+ dataProcessors.put(AccountData.class, accountDataProcessor);
+ dataProcessors.put(DomainData.class, domainDataProcessor);
+ dataProcessors.put(RoleData.class, roleDataProcessor);
+ }
+
+ @Caching(evict = {
+ @CacheEvict(value = "domain-ids", allEntries = true),
+ @CacheEvict(value = "role-ids", allEntries = true),
+ @CacheEvict(value = "account-ids", allEntries = true)
+ })
+ public void updateDirectories() {
+ try {
+ String[] ervuDirectoriesArray = ervuDirectories.split(",");
+ Arrays.stream(ervuDirectoriesArray).forEach(ervuDirectory -> {
+ String targetUrl = idmUrl + "/reconcile/" + ervuDirectory.trim() + "/to/kafka/v1";
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
+ String emptyJson = "{}";
+ HttpEntity requestEntity = new HttpEntity<>(emptyJson, headers);
+ ResponseEntity response = restTemplate.postForEntity(targetUrl, requestEntity,
+ String.class
+ );
+ if (!response.getStatusCode().is2xxSuccessful()) {
+ LOGGER.error("Error in {} request. Status code: {}; Body: {}",
+ ervuDirectory, response.getStatusCode(), response.getBody()
+ );
+ }
+ });
+ }
+ catch (Exception e) {
+ LOGGER.error(e.getMessage());
+ throw new IdmDirectoriesException(e);
+ }
+ }
+
+ @Transactional
+ public void processUpsertMessage(String kafkaMessage, Class entityClass) {
+ try {
+ JavaType messageType = objectMapper.getTypeFactory()
+ .constructParametricType(UpsertMessage.class, entityClass);
+ JavaType arrayType = objectMapper.getTypeFactory()
+ .constructArrayType(messageType);
+
+ UpsertMessage[] messages = objectMapper.readValue(kafkaMessage, arrayType);
+ if (messages.length > 0 && messages[0].getData() != null && !messages[0].getData()
+ .isEmpty()) {
+ DataProcessor processor = (DataProcessor) dataProcessors.get(entityClass);
+ if (processor == null) {
+ throw new IllegalStateException("No processor found for " + entityClass.getSimpleName());
+ }
+
+ processor.upsertData(messages[0].getData());
+ }
+ }
+ catch (Exception e) {
+ throw new IdmDirectoriesException(e);
+ }
+ }
+
+ @Transactional
+ public void processDeleteMessage(String kafkaMessage, Class entityClass) {
+ try {
+ DeleteKafkaMessage[] deleteKafkaMessages = objectMapper.readValue(kafkaMessage,
+ DeleteKafkaMessage[].class
+ );
+
+ if (Boolean.TRUE.equals(deleteKafkaMessages[0].isSuccess())
+ && deleteKafkaMessages[0].getData() != null && !deleteKafkaMessages[0].getData()
+ .isEmpty()) {
+ DataProcessor processor = (DataProcessor) dataProcessors.get(entityClass);
+ if (processor == null) {
+ throw new IllegalStateException("No processor found for " + entityClass.getSimpleName());
+ }
+
+ processor.deleteData(deleteKafkaMessages[0].getData());
+ }
+
+ }
+ catch (Exception e) {
+ throw new IdmDirectoriesException(e);
+ }
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/service/processor/DataProcessor.java b/backend/src/main/java/ervu_business_metrics/service/processor/DataProcessor.java
new file mode 100644
index 0000000..9fb0e49
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/service/processor/DataProcessor.java
@@ -0,0 +1,11 @@
+package ervu_business_metrics.service.processor;
+
+import java.util.List;
+
+/**
+ * @author Adel Kalimullin
+ */
+public interface DataProcessor {
+ void upsertData(List dataList);
+ void deleteData(List ids);
+}
\ No newline at end of file
diff --git a/backend/src/main/java/ervu_business_metrics/service/processor/impl/AccountDataProcessor.java b/backend/src/main/java/ervu_business_metrics/service/processor/impl/AccountDataProcessor.java
new file mode 100644
index 0000000..da87328
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/service/processor/impl/AccountDataProcessor.java
@@ -0,0 +1,104 @@
+package ervu_business_metrics.service.processor.impl;
+
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import ervu_business_metrics.config.IdmReconcileEnabledCondition;
+import ervu_business_metrics.model.AccountData;
+import ervu_business_metrics.service.IdmDirectoriesDaoService;
+import ervu_business_metrics.service.processor.DataProcessor;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.stereotype.Component;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.AccountRecord;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.AccountRoleRecord;
+
+/**
+ * @author Adel Kalimullin
+ */
+@Component
+@Conditional(IdmReconcileEnabledCondition.class)
+public class AccountDataProcessor implements DataProcessor {
+ private final IdmDirectoriesDaoService idmDirectoriesDaoService;
+
+ public AccountDataProcessor(IdmDirectoriesDaoService idmDirectoriesDaoService) {
+ this.idmDirectoriesDaoService = idmDirectoriesDaoService;
+ }
+
+ @Override
+ public void upsertData(List dataList) {
+ List newAccountRecords = new ArrayList<>();
+ List accountRecordsToUpdate = new ArrayList<>();
+ List newAccountRoleRecords = new ArrayList<>();
+ List accountsToDeleteRoles = new ArrayList<>();
+ Set existingIds = idmDirectoriesDaoService.getAccountIds();
+
+ for (AccountData data : dataList) {
+ AccountRecord record = idmDirectoriesDaoService.getAccountRecord();
+ Timestamp modifiedAt = Timestamp.from(Instant.ofEpochMilli(data.getModified()));
+
+ record.setId(data.getId());
+ record.setVersion(data.getVersion());
+ record.setSchema(data.getSchema());
+ record.setModified(modifiedAt);
+ record.setStart(data.getStart());
+ record.setFinish(data.getFinish());
+ record.setEnabled(data.isEnabled());
+ record.setPosition(data.getPosition());
+ record.setFio(data.getFio());
+ record.setWorkMail(data.getWorkMail());
+ record.setEsiaAccount(data.isEsiaAccount());
+ if (data.getUserDomain() != null) {
+ record.setDomainId(data.getUserDomain().getId());
+ }
+
+ if (existingIds.contains(data.getId())) {
+ accountRecordsToUpdate.add(record);
+ accountsToDeleteRoles.add(data.getId());
+ }
+ else {
+ newAccountRecords.add(record);
+ }
+
+ if (data.getRoles() != null && !data.getRoles().isEmpty()) {
+ addRolesForAccount(data, newAccountRoleRecords);
+ }
+ }
+
+ if (!newAccountRecords.isEmpty()) {
+ idmDirectoriesDaoService.insertAccountRecords(newAccountRecords);
+ }
+
+ if (!accountRecordsToUpdate.isEmpty()) {
+ idmDirectoriesDaoService.updateAccountRecords(accountRecordsToUpdate);
+ }
+
+ if (!accountsToDeleteRoles.isEmpty()) {
+ idmDirectoriesDaoService.deleteAccountRolesByAccountIds(accountsToDeleteRoles);
+ }
+
+ if (!newAccountRoleRecords.isEmpty()) {
+ idmDirectoriesDaoService.insertAccountRoleRecords(newAccountRoleRecords);
+ }
+ }
+
+ @Override
+ public void deleteData(List ids) {
+ idmDirectoriesDaoService.deleteAccountsByIds(ids);
+ }
+
+ private void addRolesForAccount(AccountData data, List accountRoleRecords) {
+ Set existingRoleIds = idmDirectoriesDaoService.getRoleIds();
+
+ for (String roleId : data.getRoles()) {
+ if (existingRoleIds.contains(roleId)) {
+ AccountRoleRecord accountRoleRecord = idmDirectoriesDaoService.getAccountRoleRecord();
+ accountRoleRecord.setAccountId(data.getId());
+ accountRoleRecord.setRoleId(roleId);
+ accountRoleRecords.add(accountRoleRecord);
+ }
+ }
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/service/processor/impl/DomainDataProcessor.java b/backend/src/main/java/ervu_business_metrics/service/processor/impl/DomainDataProcessor.java
new file mode 100644
index 0000000..fce5f7c
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/service/processor/impl/DomainDataProcessor.java
@@ -0,0 +1,111 @@
+package ervu_business_metrics.service.processor.impl;
+
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import ervu_business_metrics.config.IdmReconcileEnabledCondition;
+import ervu_business_metrics.model.DomainData;
+import ervu_business_metrics.service.IdmDirectoriesDaoService;
+import ervu_business_metrics.service.processor.DataProcessor;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.stereotype.Component;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.DomainRecord;
+
+/**
+ * @author Adel Kalimullin
+ */
+@Component
+@Conditional(IdmReconcileEnabledCondition.class)
+public class DomainDataProcessor implements DataProcessor {
+ private final IdmDirectoriesDaoService idmDirectoriesDaoService;
+
+ public DomainDataProcessor(IdmDirectoriesDaoService idmDirectoriesDaoService) {
+ this.idmDirectoriesDaoService = idmDirectoriesDaoService;
+ }
+
+ @Override
+ public void upsertData(List dataList) {
+ List newDomainRecords = new ArrayList<>();
+ List domainRecords = new ArrayList<>();
+ Set existingIds = idmDirectoriesDaoService.getDomainIds();
+
+ for (DomainData data : dataList) {
+ DomainRecord domainRecord = idmDirectoriesDaoService.getDomainRecord();
+ Timestamp modifiedAt = Timestamp.from(Instant.ofEpochMilli(data.getModified()));
+
+ domainRecord.setId(data.getId());
+ domainRecord.setVersion(data.getVersion());
+ domainRecord.setModified(modifiedAt);
+ domainRecord.setSchema(data.getSchema());
+ domainRecord.setName(data.getName());
+ domainRecord.setShortname(data.getShortname());
+ domainRecord.setFullname(data.getFullname());
+ domainRecord.setDns(data.getDns());
+ domainRecord.setEmail(data.getEmail());
+ domainRecord.setPhone(data.getPhone());
+ domainRecord.setAddress(data.getAddress());
+ domainRecord.setPostalAddress(data.getPostalAddress());
+ domainRecord.setAddressId(data.getAddressId());
+ domainRecord.setPostalAddressId(data.getPostalAddressId());
+ domainRecord.setMilitaryCode(data.getMilitaryCode());
+ domainRecord.setTimezone(data.getTimezone());
+ domainRecord.setReportsEnabled(data.isReportsEnabled());
+ domainRecord.setInn(data.getInn());
+ domainRecord.setLeg(data.getLeg());
+ domainRecord.setOgrn(data.getOgrn());
+ domainRecord.setRegion(data.getRegion());
+ domainRecord.setEpguId(data.getEpguId());
+ domainRecord.setType(data.getType());
+ domainRecord.setEsiaEmployeeAuthorization(data.isEsiaEmployeeAuthorization());
+ domainRecord.setDefaultS3Bucket(data.getDefaultS3Bucket());
+ domainRecord.setOpf(data.getOpf());
+ domainRecord.setKpp(data.getKpp());
+ domainRecord.setCheckingAccount(data.getCheckingAccount());
+ domainRecord.setBik(data.getBik());
+ domainRecord.setBankName(data.getBankName());
+ domainRecord.setBankCorrespondentAccount(data.getBankCorrespondentAccount());
+ domainRecord.setOktmo(data.getOktmo());
+ domainRecord.setOkato(data.getOkato());
+ domainRecord.setGovRegistrationDate(data.getGovRegistrationDate());
+ domainRecord.setGovOrganizationType(data.getGovOrganizationType());
+ domainRecord.setAliasKey(data.getAliasKey());
+ domainRecord.setPassKey(data.getPassKey());
+ domainRecord.setCertificate(data.getCertificate());
+ domainRecord.setAccountNumberTofk(data.getAccountNumberTOFK());
+ domainRecord.setBikTofk(data.getBikTOFK());
+ domainRecord.setCorrespondentBankAccountTofk(data.getCorrespondentBankAccountTOFK());
+ domainRecord.setNameTofk(data.getNameTOFK());
+ domainRecord.setNsiOrganizationId(data.getNsiOrganizationId());
+ domainRecord.setDocHandle(data.getDocHandle());
+ domainRecord.setDivisionType(data.getDivisionType());
+ domainRecord.setTnsDepartmentId(data.getTnsDepartmentId());
+ domainRecord.setEnabled(data.isEnabled());
+ domainRecord.setParent(data.getParent());
+ domainRecord.setRegionId(data.getRegionId());
+ domainRecord.setManaged(data.getManaged());
+
+ if (existingIds.contains(data.getId())) {
+ domainRecords.add(domainRecord);
+ }
+ else {
+ newDomainRecords.add(domainRecord);
+ }
+ }
+
+ if (!newDomainRecords.isEmpty()) {
+ idmDirectoriesDaoService.insertDomainRecords(newDomainRecords);
+ }
+
+ if (!domainRecords.isEmpty()) {
+ idmDirectoriesDaoService.updateDomainRecords(domainRecords);
+ }
+ }
+
+ @Override
+ public void deleteData(List ids) {
+ idmDirectoriesDaoService.deleteDomainsByIds(ids);
+ }
+}
diff --git a/backend/src/main/java/ervu_business_metrics/service/processor/impl/RoleDataProcessor.java b/backend/src/main/java/ervu_business_metrics/service/processor/impl/RoleDataProcessor.java
new file mode 100644
index 0000000..d22e30c
--- /dev/null
+++ b/backend/src/main/java/ervu_business_metrics/service/processor/impl/RoleDataProcessor.java
@@ -0,0 +1,75 @@
+package ervu_business_metrics.service.processor.impl;
+
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import ervu_business_metrics.config.IdmReconcileEnabledCondition;
+import ervu_business_metrics.model.RoleData;
+import ervu_business_metrics.service.IdmDirectoriesDaoService;
+import ervu_business_metrics.service.processor.DataProcessor;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.stereotype.Component;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.RoleRecord;
+
+/**
+ * @author Adel Kalimullin
+ */
+@Component
+@Conditional(IdmReconcileEnabledCondition.class)
+public class RoleDataProcessor implements DataProcessor {
+ private final IdmDirectoriesDaoService idmDirectoriesDaoService;
+
+ public RoleDataProcessor(IdmDirectoriesDaoService idmDirectoriesDaoService) {
+ this.idmDirectoriesDaoService = idmDirectoriesDaoService;
+ }
+
+ @Override
+ public void upsertData(List dataList) {
+ List newRoleRecords = new ArrayList<>();
+ List roleRecords = new ArrayList<>();
+ Set existingIds = idmDirectoriesDaoService.getRoleIds();
+
+ for (RoleData data : dataList) {
+ if (!data.isErvuRole()) {
+ continue;
+ }
+ RoleRecord record = idmDirectoriesDaoService.getRoleRecord();
+ Timestamp modifiedAt = Timestamp.from(Instant.ofEpochMilli(data.getModified()));
+
+ record.setId(data.getId());
+ record.setName(data.getName());
+ record.setDisplayName(data.getDisplayName());
+ record.setShortname(data.getShortname());
+ record.setSchema(data.getSchema());
+ record.setVersion(data.getVersion());
+ record.setSessionsLimit(data.getSessionsLimit());
+ record.setImported(data.getImported());
+ record.setDescription(data.getDescription());
+ record.setErvuRole(data.isErvuRole());
+ record.setModified(modifiedAt);
+
+ if (existingIds.contains(data.getId())) {
+ roleRecords.add(record);
+ }
+ else {
+ newRoleRecords.add(record);
+ }
+ }
+
+ if (!newRoleRecords.isEmpty()) {
+ idmDirectoriesDaoService.insertRoleRecords(newRoleRecords);
+ }
+
+ if (!roleRecords.isEmpty()) {
+ idmDirectoriesDaoService.updateRoleRecords(roleRecords);
+ }
+ }
+
+ @Override
+ public void deleteData(List ids) {
+ // TODO удаление пока не реализовано
+ }
+}
diff --git a/backend/src/main/java/exception/IdmDirectoriesException.java b/backend/src/main/java/exception/IdmDirectoriesException.java
new file mode 100644
index 0000000..02405a0
--- /dev/null
+++ b/backend/src/main/java/exception/IdmDirectoriesException.java
@@ -0,0 +1,18 @@
+package exception;
+
+/**
+ * @author Adel Kalimullin
+ */
+public class IdmDirectoriesException extends RuntimeException{
+ public IdmDirectoriesException(String message) {
+ super(message);
+ }
+
+ public IdmDirectoriesException(Throwable cause) {
+ super(cause);
+ }
+
+ public IdmDirectoriesException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/DefaultCatalog.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/DefaultCatalog.java
index 747ba3e..5b03d9a 100644
--- a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/DefaultCatalog.java
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/DefaultCatalog.java
@@ -14,6 +14,7 @@ import org.jooq.impl.CatalogImpl;
import ru.micord.webbpm.ervu.business_metrics.db_beans.actualization.Actualization;
import ru.micord.webbpm.ervu.business_metrics.db_beans.admin_indicators.AdminIndicators;
import ru.micord.webbpm.ervu.business_metrics.db_beans.deregistration.Deregistration;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.IdmReconcile;
import ru.micord.webbpm.ervu.business_metrics.db_beans.init_registration_info.InitRegistrationInfo;
import ru.micord.webbpm.ervu.business_metrics.db_beans.journal_log.JournalLog;
import ru.micord.webbpm.ervu.business_metrics.db_beans.metrics.Metrics;
@@ -51,6 +52,11 @@ public class DefaultCatalog extends CatalogImpl {
*/
public final Deregistration DEREGISTRATION = Deregistration.DEREGISTRATION;
+ /**
+ * The schema idm_reconcile.
+ */
+ public final IdmReconcile IDM_RECONCILE = IdmReconcile.IDM_RECONCILE;
+
/**
* The schema init_registration_info.
*/
@@ -99,6 +105,7 @@ public class DefaultCatalog extends CatalogImpl {
Actualization.ACTUALIZATION,
AdminIndicators.ADMIN_INDICATORS,
Deregistration.DEREGISTRATION,
+ IdmReconcile.IDM_RECONCILE,
InitRegistrationInfo.INIT_REGISTRATION_INFO,
JournalLog.JOURNAL_LOG,
Metrics.METRICS,
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/IdmReconcile.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/IdmReconcile.java
new file mode 100644
index 0000000..8574585
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/IdmReconcile.java
@@ -0,0 +1,76 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile;
+
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.jooq.Catalog;
+import org.jooq.Table;
+import org.jooq.impl.SchemaImpl;
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.DefaultCatalog;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Account;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.AccountRole;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Domain;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Role;
+
+
+/**
+ * This class is generated by jOOQ.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class IdmReconcile extends SchemaImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The reference instance of idm_reconcile
+ */
+ public static final IdmReconcile IDM_RECONCILE = new IdmReconcile();
+
+ /**
+ * The table idm_reconcile.account.
+ */
+ public final Account ACCOUNT = Account.ACCOUNT;
+
+ /**
+ * The table idm_reconcile.account_role.
+ */
+ public final AccountRole ACCOUNT_ROLE = AccountRole.ACCOUNT_ROLE;
+
+ /**
+ * The table idm_reconcile.domain.
+ */
+ public final Domain DOMAIN = Domain.DOMAIN;
+
+ /**
+ * The table idm_reconcile.role.
+ */
+ public final Role ROLE = Role.ROLE;
+
+ /**
+ * No further instances allowed
+ */
+ private IdmReconcile() {
+ super("idm_reconcile", null);
+ }
+
+
+ @Override
+ public Catalog getCatalog() {
+ return DefaultCatalog.DEFAULT_CATALOG;
+ }
+
+ @Override
+ public final List> getTables() {
+ return Arrays.asList(
+ Account.ACCOUNT,
+ AccountRole.ACCOUNT_ROLE,
+ Domain.DOMAIN,
+ Role.ROLE
+ );
+ }
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/Keys.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/Keys.java
new file mode 100644
index 0000000..cdf9869
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/Keys.java
@@ -0,0 +1,46 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile;
+
+
+import org.jooq.ForeignKey;
+import org.jooq.TableField;
+import org.jooq.UniqueKey;
+import org.jooq.impl.DSL;
+import org.jooq.impl.Internal;
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Account;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.AccountRole;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Domain;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Role;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.AccountRecord;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.AccountRoleRecord;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.DomainRecord;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.RoleRecord;
+
+
+/**
+ * A class modelling foreign key relationships and constraints of tables in
+ * idm_reconcile.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Keys {
+
+ // -------------------------------------------------------------------------
+ // UNIQUE and PRIMARY KEY definitions
+ // -------------------------------------------------------------------------
+
+ public static final UniqueKey ACCOUNT_PKEY = Internal.createUniqueKey(Account.ACCOUNT, DSL.name("account_pkey"), new TableField[] { Account.ACCOUNT.ID }, true);
+ public static final UniqueKey PK_ACCOUNT_ROLE = Internal.createUniqueKey(AccountRole.ACCOUNT_ROLE, DSL.name("pk_account_role"), new TableField[] { AccountRole.ACCOUNT_ROLE.ACCOUNT_ID, AccountRole.ACCOUNT_ROLE.ROLE_ID }, true);
+ public static final UniqueKey DOMAIN_PKEY = Internal.createUniqueKey(Domain.DOMAIN, DSL.name("domain_pkey"), new TableField[] { Domain.DOMAIN.ID }, true);
+ public static final UniqueKey ROLE_PKEY = Internal.createUniqueKey(Role.ROLE, DSL.name("role_pkey"), new TableField[] { Role.ROLE.ID }, true);
+
+ // -------------------------------------------------------------------------
+ // FOREIGN KEY definitions
+ // -------------------------------------------------------------------------
+
+ public static final ForeignKey ACCOUNT__FK_DOMAIN = Internal.createForeignKey(Account.ACCOUNT, DSL.name("fk_domain"), new TableField[] { Account.ACCOUNT.DOMAIN_ID }, Keys.DOMAIN_PKEY, new TableField[] { Domain.DOMAIN.ID }, true);
+ public static final ForeignKey ACCOUNT_ROLE__FK_ACCOUNT_ROLE_ACCOUNT = Internal.createForeignKey(AccountRole.ACCOUNT_ROLE, DSL.name("fk_account_role_account"), new TableField[] { AccountRole.ACCOUNT_ROLE.ACCOUNT_ID }, Keys.ACCOUNT_PKEY, new TableField[] { Account.ACCOUNT.ID }, true);
+ public static final ForeignKey ACCOUNT_ROLE__FK_ACCOUNT_ROLE_ROLE = Internal.createForeignKey(AccountRole.ACCOUNT_ROLE, DSL.name("fk_account_role_role"), new TableField[] { AccountRole.ACCOUNT_ROLE.ROLE_ID }, Keys.ROLE_PKEY, new TableField[] { Role.ROLE.ID }, true);
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/Tables.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/Tables.java
new file mode 100644
index 0000000..7001362
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/Tables.java
@@ -0,0 +1,38 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile;
+
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Account;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.AccountRole;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Domain;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Role;
+
+
+/**
+ * Convenience access to all tables in idm_reconcile.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Tables {
+
+ /**
+ * The table idm_reconcile.account.
+ */
+ public static final Account ACCOUNT = Account.ACCOUNT;
+
+ /**
+ * The table idm_reconcile.account_role.
+ */
+ public static final AccountRole ACCOUNT_ROLE = AccountRole.ACCOUNT_ROLE;
+
+ /**
+ * The table idm_reconcile.domain.
+ */
+ public static final Domain DOMAIN = Domain.DOMAIN;
+
+ /**
+ * The table idm_reconcile.role.
+ */
+ public static final Role ROLE = Role.ROLE;
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/Account.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/Account.java
new file mode 100644
index 0000000..b955bcd
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/Account.java
@@ -0,0 +1,353 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables;
+
+
+import java.sql.Timestamp;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.jooq.Condition;
+import org.jooq.Field;
+import org.jooq.ForeignKey;
+import org.jooq.InverseForeignKey;
+import org.jooq.Name;
+import org.jooq.Path;
+import org.jooq.PlainSQL;
+import org.jooq.QueryPart;
+import org.jooq.Record;
+import org.jooq.SQL;
+import org.jooq.Schema;
+import org.jooq.Select;
+import org.jooq.Stringly;
+import org.jooq.Table;
+import org.jooq.TableField;
+import org.jooq.TableOptions;
+import org.jooq.UniqueKey;
+import org.jooq.impl.DSL;
+import org.jooq.impl.SQLDataType;
+import org.jooq.impl.TableImpl;
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.IdmReconcile;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.Keys;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.AccountRole.AccountRolePath;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Domain.DomainPath;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Role.RolePath;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.AccountRecord;
+
+
+/**
+ * This class is generated by jOOQ.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Account extends TableImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The reference instance of idm_reconcile.account
+ */
+ public static final Account ACCOUNT = new Account();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public Class getRecordType() {
+ return AccountRecord.class;
+ }
+
+ /**
+ * The column idm_reconcile.account.id.
+ */
+ public final TableField ID = createField(DSL.name("id"), SQLDataType.VARCHAR(36).nullable(false), this, "");
+
+ /**
+ * The column idm_reconcile.account.version.
+ */
+ public final TableField VERSION = createField(DSL.name("version"), SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column idm_reconcile.account.modified.
+ */
+ public final TableField MODIFIED = createField(DSL.name("modified"), SQLDataType.TIMESTAMP(0), this, "");
+
+ /**
+ * The column idm_reconcile.account.schema.
+ */
+ public final TableField SCHEMA = createField(DSL.name("schema"), SQLDataType.VARCHAR(100).nullable(false), this, "");
+
+ /**
+ * The column idm_reconcile.account.start.
+ */
+ public final TableField START = createField(DSL.name("start"), SQLDataType.VARCHAR(50), this, "");
+
+ /**
+ * The column idm_reconcile.account.finish.
+ */
+ public final TableField FINISH = createField(DSL.name("finish"), SQLDataType.VARCHAR(50), this, "");
+
+ /**
+ * The column idm_reconcile.account.enabled.
+ */
+ public final TableField ENABLED = createField(DSL.name("enabled"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("true"), SQLDataType.BOOLEAN)), this, "");
+
+ /**
+ * The column idm_reconcile.account.position.
+ */
+ public final TableField POSITION = createField(DSL.name("position"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.account.fio.
+ */
+ public final TableField FIO = createField(DSL.name("fio"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.account.work_mail.
+ */
+ public final TableField WORK_MAIL = createField(DSL.name("work_mail"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.account.esia_account.
+ */
+ public final TableField ESIA_ACCOUNT = createField(DSL.name("esia_account"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field(DSL.raw("false"), SQLDataType.BOOLEAN)), this, "");
+
+ /**
+ * The column idm_reconcile.account.domain_id.
+ */
+ public final TableField DOMAIN_ID = createField(DSL.name("domain_id"), SQLDataType.VARCHAR(36), this, "");
+
+ private Account(Name alias, Table aliased) {
+ this(alias, aliased, (Field>[]) null, null);
+ }
+
+ private Account(Name alias, Table aliased, Field>[] parameters, Condition where) {
+ super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
+ }
+
+ /**
+ * Create an aliased idm_reconcile.account table reference
+ */
+ public Account(String alias) {
+ this(DSL.name(alias), ACCOUNT);
+ }
+
+ /**
+ * Create an aliased idm_reconcile.account table reference
+ */
+ public Account(Name alias) {
+ this(alias, ACCOUNT);
+ }
+
+ /**
+ * Create a idm_reconcile.account table reference
+ */
+ public Account() {
+ this(DSL.name("account"), null);
+ }
+
+ public Account(Table path, ForeignKey childPath, InverseForeignKey parentPath) {
+ super(path, childPath, parentPath, ACCOUNT);
+ }
+
+ /**
+ * A subtype implementing {@link Path} for simplified path-based joins.
+ */
+ public static class AccountPath extends Account implements Path {
+ public AccountPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) {
+ super(path, childPath, parentPath);
+ }
+ private AccountPath(Name alias, Table aliased) {
+ super(alias, aliased);
+ }
+
+ @Override
+ public AccountPath as(String alias) {
+ return new AccountPath(DSL.name(alias), this);
+ }
+
+ @Override
+ public AccountPath as(Name alias) {
+ return new AccountPath(alias, this);
+ }
+
+ @Override
+ public AccountPath as(Table> alias) {
+ return new AccountPath(alias.getQualifiedName(), this);
+ }
+ }
+
+ @Override
+ public Schema getSchema() {
+ return aliased() ? null : IdmReconcile.IDM_RECONCILE;
+ }
+
+ @Override
+ public UniqueKey getPrimaryKey() {
+ return Keys.ACCOUNT_PKEY;
+ }
+
+ @Override
+ public List> getReferences() {
+ return Arrays.asList(Keys.ACCOUNT__FK_DOMAIN);
+ }
+
+ private transient DomainPath _domain;
+
+ /**
+ * Get the implicit join path to the idm_reconcile.domain
+ * table.
+ */
+ public DomainPath domain() {
+ if (_domain == null)
+ _domain = new DomainPath(this, Keys.ACCOUNT__FK_DOMAIN, null);
+
+ return _domain;
+ }
+
+ private transient AccountRolePath _accountRole;
+
+ /**
+ * Get the implicit to-many join path to the
+ * idm_reconcile.account_role table
+ */
+ public AccountRolePath accountRole() {
+ if (_accountRole == null)
+ _accountRole = new AccountRolePath(this, null, Keys.ACCOUNT_ROLE__FK_ACCOUNT_ROLE_ACCOUNT.getInverseKey());
+
+ return _accountRole;
+ }
+
+ /**
+ * Get the implicit many-to-many join path to the
+ * idm_reconcile.role table
+ */
+ public RolePath role() {
+ return accountRole().role();
+ }
+
+ @Override
+ public Account as(String alias) {
+ return new Account(DSL.name(alias), this);
+ }
+
+ @Override
+ public Account as(Name alias) {
+ return new Account(alias, this);
+ }
+
+ @Override
+ public Account as(Table> alias) {
+ return new Account(alias.getQualifiedName(), this);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public Account rename(String name) {
+ return new Account(DSL.name(name), null);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public Account rename(Name name) {
+ return new Account(name, null);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public Account rename(Table> name) {
+ return new Account(name.getQualifiedName(), null);
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Account where(Condition condition) {
+ return new Account(getQualifiedName(), aliased() ? this : null, null, condition);
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Account where(Collection extends Condition> conditions) {
+ return where(DSL.and(conditions));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Account where(Condition... conditions) {
+ return where(DSL.and(conditions));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Account where(Field condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Account where(SQL condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Account where(@Stringly.SQL String condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Account where(@Stringly.SQL String condition, Object... binds) {
+ return where(DSL.condition(condition, binds));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Account where(@Stringly.SQL String condition, QueryPart... parts) {
+ return where(DSL.condition(condition, parts));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Account whereExists(Select> select) {
+ return where(DSL.exists(select));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Account whereNotExists(Select> select) {
+ return where(DSL.notExists(select));
+ }
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/AccountRole.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/AccountRole.java
new file mode 100644
index 0000000..e0a896c
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/AccountRole.java
@@ -0,0 +1,292 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables;
+
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.jooq.Condition;
+import org.jooq.Field;
+import org.jooq.ForeignKey;
+import org.jooq.InverseForeignKey;
+import org.jooq.Name;
+import org.jooq.Path;
+import org.jooq.PlainSQL;
+import org.jooq.QueryPart;
+import org.jooq.Record;
+import org.jooq.SQL;
+import org.jooq.Schema;
+import org.jooq.Select;
+import org.jooq.Stringly;
+import org.jooq.Table;
+import org.jooq.TableField;
+import org.jooq.TableOptions;
+import org.jooq.UniqueKey;
+import org.jooq.impl.DSL;
+import org.jooq.impl.SQLDataType;
+import org.jooq.impl.TableImpl;
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.IdmReconcile;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.Keys;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Account.AccountPath;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Role.RolePath;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.AccountRoleRecord;
+
+
+/**
+ * This class is generated by jOOQ.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class AccountRole extends TableImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The reference instance of idm_reconcile.account_role
+ */
+ public static final AccountRole ACCOUNT_ROLE = new AccountRole();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public Class getRecordType() {
+ return AccountRoleRecord.class;
+ }
+
+ /**
+ * The column idm_reconcile.account_role.account_id.
+ */
+ public final TableField ACCOUNT_ID = createField(DSL.name("account_id"), SQLDataType.VARCHAR(36).nullable(false), this, "");
+
+ /**
+ * The column idm_reconcile.account_role.role_id.
+ */
+ public final TableField ROLE_ID = createField(DSL.name("role_id"), SQLDataType.VARCHAR(36).nullable(false), this, "");
+
+ private AccountRole(Name alias, Table aliased) {
+ this(alias, aliased, (Field>[]) null, null);
+ }
+
+ private AccountRole(Name alias, Table aliased, Field>[] parameters, Condition where) {
+ super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
+ }
+
+ /**
+ * Create an aliased idm_reconcile.account_role table reference
+ */
+ public AccountRole(String alias) {
+ this(DSL.name(alias), ACCOUNT_ROLE);
+ }
+
+ /**
+ * Create an aliased idm_reconcile.account_role table reference
+ */
+ public AccountRole(Name alias) {
+ this(alias, ACCOUNT_ROLE);
+ }
+
+ /**
+ * Create a idm_reconcile.account_role table reference
+ */
+ public AccountRole() {
+ this(DSL.name("account_role"), null);
+ }
+
+ public AccountRole(Table path, ForeignKey childPath, InverseForeignKey parentPath) {
+ super(path, childPath, parentPath, ACCOUNT_ROLE);
+ }
+
+ /**
+ * A subtype implementing {@link Path} for simplified path-based joins.
+ */
+ public static class AccountRolePath extends AccountRole implements Path {
+ public AccountRolePath(Table path, ForeignKey childPath, InverseForeignKey parentPath) {
+ super(path, childPath, parentPath);
+ }
+ private AccountRolePath(Name alias, Table aliased) {
+ super(alias, aliased);
+ }
+
+ @Override
+ public AccountRolePath as(String alias) {
+ return new AccountRolePath(DSL.name(alias), this);
+ }
+
+ @Override
+ public AccountRolePath as(Name alias) {
+ return new AccountRolePath(alias, this);
+ }
+
+ @Override
+ public AccountRolePath as(Table> alias) {
+ return new AccountRolePath(alias.getQualifiedName(), this);
+ }
+ }
+
+ @Override
+ public Schema getSchema() {
+ return aliased() ? null : IdmReconcile.IDM_RECONCILE;
+ }
+
+ @Override
+ public UniqueKey getPrimaryKey() {
+ return Keys.PK_ACCOUNT_ROLE;
+ }
+
+ @Override
+ public List> getReferences() {
+ return Arrays.asList(Keys.ACCOUNT_ROLE__FK_ACCOUNT_ROLE_ACCOUNT, Keys.ACCOUNT_ROLE__FK_ACCOUNT_ROLE_ROLE);
+ }
+
+ private transient AccountPath _account;
+
+ /**
+ * Get the implicit join path to the idm_reconcile.account
+ * table.
+ */
+ public AccountPath account() {
+ if (_account == null)
+ _account = new AccountPath(this, Keys.ACCOUNT_ROLE__FK_ACCOUNT_ROLE_ACCOUNT, null);
+
+ return _account;
+ }
+
+ private transient RolePath _role;
+
+ /**
+ * Get the implicit join path to the idm_reconcile.role table.
+ */
+ public RolePath role() {
+ if (_role == null)
+ _role = new RolePath(this, Keys.ACCOUNT_ROLE__FK_ACCOUNT_ROLE_ROLE, null);
+
+ return _role;
+ }
+
+ @Override
+ public AccountRole as(String alias) {
+ return new AccountRole(DSL.name(alias), this);
+ }
+
+ @Override
+ public AccountRole as(Name alias) {
+ return new AccountRole(alias, this);
+ }
+
+ @Override
+ public AccountRole as(Table> alias) {
+ return new AccountRole(alias.getQualifiedName(), this);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public AccountRole rename(String name) {
+ return new AccountRole(DSL.name(name), null);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public AccountRole rename(Name name) {
+ return new AccountRole(name, null);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public AccountRole rename(Table> name) {
+ return new AccountRole(name.getQualifiedName(), null);
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public AccountRole where(Condition condition) {
+ return new AccountRole(getQualifiedName(), aliased() ? this : null, null, condition);
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public AccountRole where(Collection extends Condition> conditions) {
+ return where(DSL.and(conditions));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public AccountRole where(Condition... conditions) {
+ return where(DSL.and(conditions));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public AccountRole where(Field condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public AccountRole where(SQL condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public AccountRole where(@Stringly.SQL String condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public AccountRole where(@Stringly.SQL String condition, Object... binds) {
+ return where(DSL.condition(condition, binds));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public AccountRole where(@Stringly.SQL String condition, QueryPart... parts) {
+ return where(DSL.condition(condition, parts));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public AccountRole whereExists(Select> select) {
+ return where(DSL.exists(select));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public AccountRole whereNotExists(Select> select) {
+ return where(DSL.notExists(select));
+ }
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/Domain.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/Domain.java
new file mode 100644
index 0000000..f3e17b2
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/Domain.java
@@ -0,0 +1,514 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables;
+
+
+import java.sql.Timestamp;
+import java.util.Collection;
+
+import org.jooq.Condition;
+import org.jooq.Field;
+import org.jooq.ForeignKey;
+import org.jooq.InverseForeignKey;
+import org.jooq.Name;
+import org.jooq.Path;
+import org.jooq.PlainSQL;
+import org.jooq.QueryPart;
+import org.jooq.Record;
+import org.jooq.SQL;
+import org.jooq.Schema;
+import org.jooq.Select;
+import org.jooq.Stringly;
+import org.jooq.Table;
+import org.jooq.TableField;
+import org.jooq.TableOptions;
+import org.jooq.UniqueKey;
+import org.jooq.impl.DSL;
+import org.jooq.impl.SQLDataType;
+import org.jooq.impl.TableImpl;
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.IdmReconcile;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.Keys;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Account.AccountPath;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.DomainRecord;
+
+
+/**
+ * This class is generated by jOOQ.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Domain extends TableImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The reference instance of idm_reconcile.domain
+ */
+ public static final Domain DOMAIN = new Domain();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public Class getRecordType() {
+ return DomainRecord.class;
+ }
+
+ /**
+ * The column idm_reconcile.domain.id.
+ */
+ public final TableField ID = createField(DSL.name("id"), SQLDataType.VARCHAR(255).nullable(false), this, "");
+
+ /**
+ * The column idm_reconcile.domain.version.
+ */
+ public final TableField VERSION = createField(DSL.name("version"), SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column idm_reconcile.domain.modified.
+ */
+ public final TableField MODIFIED = createField(DSL.name("modified"), SQLDataType.TIMESTAMP(0), this, "");
+
+ /**
+ * The column idm_reconcile.domain.schema.
+ */
+ public final TableField SCHEMA = createField(DSL.name("schema"), SQLDataType.VARCHAR(255).nullable(false), this, "");
+
+ /**
+ * The column idm_reconcile.domain.name.
+ */
+ public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.shortname.
+ */
+ public final TableField SHORTNAME = createField(DSL.name("shortname"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.fullname.
+ */
+ public final TableField FULLNAME = createField(DSL.name("fullname"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.dns.
+ */
+ public final TableField DNS = createField(DSL.name("dns"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.email.
+ */
+ public final TableField EMAIL = createField(DSL.name("email"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.phone.
+ */
+ public final TableField PHONE = createField(DSL.name("phone"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.address.
+ */
+ public final TableField ADDRESS = createField(DSL.name("address"), SQLDataType.VARCHAR(1024), this, "");
+
+ /**
+ * The column idm_reconcile.domain.postal_address.
+ */
+ public final TableField POSTAL_ADDRESS = createField(DSL.name("postal_address"), SQLDataType.VARCHAR(1024), this, "");
+
+ /**
+ * The column idm_reconcile.domain.address_id.
+ */
+ public final TableField ADDRESS_ID = createField(DSL.name("address_id"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.postal_address_id.
+ */
+ public final TableField POSTAL_ADDRESS_ID = createField(DSL.name("postal_address_id"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.military_code.
+ */
+ public final TableField MILITARY_CODE = createField(DSL.name("military_code"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.timezone.
+ */
+ public final TableField TIMEZONE = createField(DSL.name("timezone"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.reports_enabled.
+ */
+ public final TableField REPORTS_ENABLED = createField(DSL.name("reports_enabled"), SQLDataType.BOOLEAN, this, "");
+
+ /**
+ * The column idm_reconcile.domain.inn.
+ */
+ public final TableField INN = createField(DSL.name("inn"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.leg.
+ */
+ public final TableField LEG = createField(DSL.name("leg"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.ogrn.
+ */
+ public final TableField OGRN = createField(DSL.name("ogrn"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.region.
+ */
+ public final TableField REGION = createField(DSL.name("region"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.epgu_id.
+ */
+ public final TableField EPGU_ID = createField(DSL.name("epgu_id"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.type.
+ */
+ public final TableField TYPE = createField(DSL.name("type"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.esia_employee_authorization.
+ */
+ public final TableField ESIA_EMPLOYEE_AUTHORIZATION = createField(DSL.name("esia_employee_authorization"), SQLDataType.BOOLEAN, this, "");
+
+ /**
+ * The column idm_reconcile.domain.default_s3_bucket.
+ */
+ public final TableField DEFAULT_S3_BUCKET = createField(DSL.name("default_s3_bucket"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.opf.
+ */
+ public final TableField OPF = createField(DSL.name("opf"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.kpp.
+ */
+ public final TableField KPP = createField(DSL.name("kpp"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.checking_account.
+ */
+ public final TableField CHECKING_ACCOUNT = createField(DSL.name("checking_account"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.bik.
+ */
+ public final TableField BIK = createField(DSL.name("bik"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.bank_name.
+ */
+ public final TableField BANK_NAME = createField(DSL.name("bank_name"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.bank_correspondent_account.
+ */
+ public final TableField BANK_CORRESPONDENT_ACCOUNT = createField(DSL.name("bank_correspondent_account"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.oktmo.
+ */
+ public final TableField OKTMO = createField(DSL.name("oktmo"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.okato.
+ */
+ public final TableField OKATO = createField(DSL.name("okato"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.gov_registration_date.
+ */
+ public final TableField GOV_REGISTRATION_DATE = createField(DSL.name("gov_registration_date"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.gov_organization_type.
+ */
+ public final TableField GOV_ORGANIZATION_TYPE = createField(DSL.name("gov_organization_type"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.alias_key.
+ */
+ public final TableField ALIAS_KEY = createField(DSL.name("alias_key"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.pass_key.
+ */
+ public final TableField PASS_KEY = createField(DSL.name("pass_key"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.certificate.
+ */
+ public final TableField CERTIFICATE = createField(DSL.name("certificate"), SQLDataType.VARCHAR(2048), this, "");
+
+ /**
+ * The column idm_reconcile.domain.account_number_tofk.
+ */
+ public final TableField ACCOUNT_NUMBER_TOFK = createField(DSL.name("account_number_tofk"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.bik_tofk.
+ */
+ public final TableField BIK_TOFK = createField(DSL.name("bik_tofk"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column
+ * idm_reconcile.domain.correspondent_bank_account_tofk.
+ */
+ public final TableField CORRESPONDENT_BANK_ACCOUNT_TOFK = createField(DSL.name("correspondent_bank_account_tofk"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.name_tofk.
+ */
+ public final TableField NAME_TOFK = createField(DSL.name("name_tofk"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.nsi_organization_id.
+ */
+ public final TableField NSI_ORGANIZATION_ID = createField(DSL.name("nsi_organization_id"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.doc_handle.
+ */
+ public final TableField DOC_HANDLE = createField(DSL.name("doc_handle"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.division_type.
+ */
+ public final TableField DIVISION_TYPE = createField(DSL.name("division_type"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.tns_department_id.
+ */
+ public final TableField TNS_DEPARTMENT_ID = createField(DSL.name("tns_department_id"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.enabled.
+ */
+ public final TableField ENABLED = createField(DSL.name("enabled"), SQLDataType.BOOLEAN, this, "");
+
+ /**
+ * The column idm_reconcile.domain.parent.
+ */
+ public final TableField PARENT = createField(DSL.name("parent"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.region_id.
+ */
+ public final TableField REGION_ID = createField(DSL.name("region_id"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.domain.managed.
+ */
+ public final TableField MANAGED = createField(DSL.name("managed"), SQLDataType.VARCHAR(255), this, "");
+
+ private Domain(Name alias, Table aliased) {
+ this(alias, aliased, (Field>[]) null, null);
+ }
+
+ private Domain(Name alias, Table aliased, Field>[] parameters, Condition where) {
+ super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
+ }
+
+ /**
+ * Create an aliased idm_reconcile.domain table reference
+ */
+ public Domain(String alias) {
+ this(DSL.name(alias), DOMAIN);
+ }
+
+ /**
+ * Create an aliased idm_reconcile.domain table reference
+ */
+ public Domain(Name alias) {
+ this(alias, DOMAIN);
+ }
+
+ /**
+ * Create a idm_reconcile.domain table reference
+ */
+ public Domain() {
+ this(DSL.name("domain"), null);
+ }
+
+ public Domain(Table path, ForeignKey childPath, InverseForeignKey parentPath) {
+ super(path, childPath, parentPath, DOMAIN);
+ }
+
+ /**
+ * A subtype implementing {@link Path} for simplified path-based joins.
+ */
+ public static class DomainPath extends Domain implements Path {
+ public DomainPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) {
+ super(path, childPath, parentPath);
+ }
+ private DomainPath(Name alias, Table aliased) {
+ super(alias, aliased);
+ }
+
+ @Override
+ public DomainPath as(String alias) {
+ return new DomainPath(DSL.name(alias), this);
+ }
+
+ @Override
+ public DomainPath as(Name alias) {
+ return new DomainPath(alias, this);
+ }
+
+ @Override
+ public DomainPath as(Table> alias) {
+ return new DomainPath(alias.getQualifiedName(), this);
+ }
+ }
+
+ @Override
+ public Schema getSchema() {
+ return aliased() ? null : IdmReconcile.IDM_RECONCILE;
+ }
+
+ @Override
+ public UniqueKey getPrimaryKey() {
+ return Keys.DOMAIN_PKEY;
+ }
+
+ private transient AccountPath _account;
+
+ /**
+ * Get the implicit to-many join path to the
+ * idm_reconcile.account table
+ */
+ public AccountPath account() {
+ if (_account == null)
+ _account = new AccountPath(this, null, Keys.ACCOUNT__FK_DOMAIN.getInverseKey());
+
+ return _account;
+ }
+
+ @Override
+ public Domain as(String alias) {
+ return new Domain(DSL.name(alias), this);
+ }
+
+ @Override
+ public Domain as(Name alias) {
+ return new Domain(alias, this);
+ }
+
+ @Override
+ public Domain as(Table> alias) {
+ return new Domain(alias.getQualifiedName(), this);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public Domain rename(String name) {
+ return new Domain(DSL.name(name), null);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public Domain rename(Name name) {
+ return new Domain(name, null);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public Domain rename(Table> name) {
+ return new Domain(name.getQualifiedName(), null);
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Domain where(Condition condition) {
+ return new Domain(getQualifiedName(), aliased() ? this : null, null, condition);
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Domain where(Collection extends Condition> conditions) {
+ return where(DSL.and(conditions));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Domain where(Condition... conditions) {
+ return where(DSL.and(conditions));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Domain where(Field condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Domain where(SQL condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Domain where(@Stringly.SQL String condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Domain where(@Stringly.SQL String condition, Object... binds) {
+ return where(DSL.condition(condition, binds));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Domain where(@Stringly.SQL String condition, QueryPart... parts) {
+ return where(DSL.condition(condition, parts));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Domain whereExists(Select> select) {
+ return where(DSL.exists(select));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Domain whereNotExists(Select> select) {
+ return where(DSL.notExists(select));
+ }
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/Role.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/Role.java
new file mode 100644
index 0000000..d6a1afd
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/Role.java
@@ -0,0 +1,327 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables;
+
+
+import java.sql.Timestamp;
+import java.util.Collection;
+
+import org.jooq.Condition;
+import org.jooq.Field;
+import org.jooq.ForeignKey;
+import org.jooq.InverseForeignKey;
+import org.jooq.Name;
+import org.jooq.Path;
+import org.jooq.PlainSQL;
+import org.jooq.QueryPart;
+import org.jooq.Record;
+import org.jooq.SQL;
+import org.jooq.Schema;
+import org.jooq.Select;
+import org.jooq.Stringly;
+import org.jooq.Table;
+import org.jooq.TableField;
+import org.jooq.TableOptions;
+import org.jooq.UniqueKey;
+import org.jooq.impl.DSL;
+import org.jooq.impl.SQLDataType;
+import org.jooq.impl.TableImpl;
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.IdmReconcile;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.Keys;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Account.AccountPath;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.AccountRole.AccountRolePath;
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records.RoleRecord;
+
+
+/**
+ * This class is generated by jOOQ.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class Role extends TableImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The reference instance of idm_reconcile.role
+ */
+ public static final Role ROLE = new Role();
+
+ /**
+ * The class holding records for this type
+ */
+ @Override
+ public Class getRecordType() {
+ return RoleRecord.class;
+ }
+
+ /**
+ * The column idm_reconcile.role.id.
+ */
+ public final TableField ID = createField(DSL.name("id"), SQLDataType.VARCHAR(255).nullable(false), this, "");
+
+ /**
+ * The column idm_reconcile.role.version.
+ */
+ public final TableField VERSION = createField(DSL.name("version"), SQLDataType.INTEGER.nullable(false), this, "");
+
+ /**
+ * The column idm_reconcile.role.modified.
+ */
+ public final TableField MODIFIED = createField(DSL.name("modified"), SQLDataType.TIMESTAMP(0), this, "");
+
+ /**
+ * The column idm_reconcile.role.schema.
+ */
+ public final TableField SCHEMA = createField(DSL.name("schema"), SQLDataType.VARCHAR(255).nullable(false), this, "");
+
+ /**
+ * The column idm_reconcile.role.name.
+ */
+ public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.role.shortname.
+ */
+ public final TableField SHORTNAME = createField(DSL.name("shortname"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.role.display_name.
+ */
+ public final TableField DISPLAY_NAME = createField(DSL.name("display_name"), SQLDataType.VARCHAR(255), this, "");
+
+ /**
+ * The column idm_reconcile.role.sessions_limit.
+ */
+ public final TableField SESSIONS_LIMIT = createField(DSL.name("sessions_limit"), SQLDataType.INTEGER, this, "");
+
+ /**
+ * The column idm_reconcile.role.ervu_role.
+ */
+ public final TableField ERVU_ROLE = createField(DSL.name("ervu_role"), SQLDataType.BOOLEAN, this, "");
+
+ /**
+ * The column idm_reconcile.role.imported.
+ */
+ public final TableField IMPORTED = createField(DSL.name("imported"), SQLDataType.INTEGER, this, "");
+
+ /**
+ * The column idm_reconcile.role.description.
+ */
+ public final TableField DESCRIPTION = createField(DSL.name("description"), SQLDataType.CLOB, this, "");
+
+ private Role(Name alias, Table aliased) {
+ this(alias, aliased, (Field>[]) null, null);
+ }
+
+ private Role(Name alias, Table aliased, Field>[] parameters, Condition where) {
+ super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
+ }
+
+ /**
+ * Create an aliased idm_reconcile.role table reference
+ */
+ public Role(String alias) {
+ this(DSL.name(alias), ROLE);
+ }
+
+ /**
+ * Create an aliased idm_reconcile.role table reference
+ */
+ public Role(Name alias) {
+ this(alias, ROLE);
+ }
+
+ /**
+ * Create a idm_reconcile.role table reference
+ */
+ public Role() {
+ this(DSL.name("role"), null);
+ }
+
+ public Role(Table path, ForeignKey childPath, InverseForeignKey parentPath) {
+ super(path, childPath, parentPath, ROLE);
+ }
+
+ /**
+ * A subtype implementing {@link Path} for simplified path-based joins.
+ */
+ public static class RolePath extends Role implements Path {
+ public RolePath(Table path, ForeignKey childPath, InverseForeignKey parentPath) {
+ super(path, childPath, parentPath);
+ }
+ private RolePath(Name alias, Table aliased) {
+ super(alias, aliased);
+ }
+
+ @Override
+ public RolePath as(String alias) {
+ return new RolePath(DSL.name(alias), this);
+ }
+
+ @Override
+ public RolePath as(Name alias) {
+ return new RolePath(alias, this);
+ }
+
+ @Override
+ public RolePath as(Table> alias) {
+ return new RolePath(alias.getQualifiedName(), this);
+ }
+ }
+
+ @Override
+ public Schema getSchema() {
+ return aliased() ? null : IdmReconcile.IDM_RECONCILE;
+ }
+
+ @Override
+ public UniqueKey getPrimaryKey() {
+ return Keys.ROLE_PKEY;
+ }
+
+ private transient AccountRolePath _accountRole;
+
+ /**
+ * Get the implicit to-many join path to the
+ * idm_reconcile.account_role table
+ */
+ public AccountRolePath accountRole() {
+ if (_accountRole == null)
+ _accountRole = new AccountRolePath(this, null, Keys.ACCOUNT_ROLE__FK_ACCOUNT_ROLE_ROLE.getInverseKey());
+
+ return _accountRole;
+ }
+
+ /**
+ * Get the implicit many-to-many join path to the
+ * idm_reconcile.account table
+ */
+ public AccountPath account() {
+ return accountRole().account();
+ }
+
+ @Override
+ public Role as(String alias) {
+ return new Role(DSL.name(alias), this);
+ }
+
+ @Override
+ public Role as(Name alias) {
+ return new Role(alias, this);
+ }
+
+ @Override
+ public Role as(Table> alias) {
+ return new Role(alias.getQualifiedName(), this);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public Role rename(String name) {
+ return new Role(DSL.name(name), null);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public Role rename(Name name) {
+ return new Role(name, null);
+ }
+
+ /**
+ * Rename this table
+ */
+ @Override
+ public Role rename(Table> name) {
+ return new Role(name.getQualifiedName(), null);
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Role where(Condition condition) {
+ return new Role(getQualifiedName(), aliased() ? this : null, null, condition);
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Role where(Collection extends Condition> conditions) {
+ return where(DSL.and(conditions));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Role where(Condition... conditions) {
+ return where(DSL.and(conditions));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Role where(Field condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Role where(SQL condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Role where(@Stringly.SQL String condition) {
+ return where(DSL.condition(condition));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Role where(@Stringly.SQL String condition, Object... binds) {
+ return where(DSL.condition(condition, binds));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ @PlainSQL
+ public Role where(@Stringly.SQL String condition, QueryPart... parts) {
+ return where(DSL.condition(condition, parts));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Role whereExists(Select> select) {
+ return where(DSL.exists(select));
+ }
+
+ /**
+ * Create an inline derived table from this table
+ */
+ @Override
+ public Role whereNotExists(Select> select) {
+ return where(DSL.notExists(select));
+ }
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/AccountRecord.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/AccountRecord.java
new file mode 100644
index 0000000..68db55d
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/AccountRecord.java
@@ -0,0 +1,246 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records;
+
+
+import java.sql.Timestamp;
+
+import org.jooq.Record1;
+import org.jooq.impl.UpdatableRecordImpl;
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Account;
+
+
+/**
+ * This class is generated by jOOQ.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class AccountRecord extends UpdatableRecordImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Setter for idm_reconcile.account.id.
+ */
+ public void setId(String value) {
+ set(0, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.id.
+ */
+ public String getId() {
+ return (String) get(0);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.version.
+ */
+ public void setVersion(Integer value) {
+ set(1, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.version.
+ */
+ public Integer getVersion() {
+ return (Integer) get(1);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.modified.
+ */
+ public void setModified(Timestamp value) {
+ set(2, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.modified.
+ */
+ public Timestamp getModified() {
+ return (Timestamp) get(2);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.schema.
+ */
+ public void setSchema(String value) {
+ set(3, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.schema.
+ */
+ public String getSchema() {
+ return (String) get(3);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.start.
+ */
+ public void setStart(String value) {
+ set(4, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.start.
+ */
+ public String getStart() {
+ return (String) get(4);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.finish.
+ */
+ public void setFinish(String value) {
+ set(5, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.finish.
+ */
+ public String getFinish() {
+ return (String) get(5);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.enabled.
+ */
+ public void setEnabled(Boolean value) {
+ set(6, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.enabled.
+ */
+ public Boolean getEnabled() {
+ return (Boolean) get(6);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.position.
+ */
+ public void setPosition(String value) {
+ set(7, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.position.
+ */
+ public String getPosition() {
+ return (String) get(7);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.fio.
+ */
+ public void setFio(String value) {
+ set(8, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.fio.
+ */
+ public String getFio() {
+ return (String) get(8);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.work_mail.
+ */
+ public void setWorkMail(String value) {
+ set(9, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.work_mail.
+ */
+ public String getWorkMail() {
+ return (String) get(9);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.esia_account.
+ */
+ public void setEsiaAccount(Boolean value) {
+ set(10, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.esia_account.
+ */
+ public Boolean getEsiaAccount() {
+ return (Boolean) get(10);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.domain_id.
+ */
+ public void setDomainId(String value) {
+ set(11, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.domain_id.
+ */
+ public String getDomainId() {
+ return (String) get(11);
+ }
+
+ /**
+ * Setter for idm_reconcile.account.person_id.
+ */
+ public void setPersonId(String value) {
+ set(12, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account.person_id.
+ */
+ public String getPersonId() {
+ return (String) get(12);
+ }
+
+ // -------------------------------------------------------------------------
+ // Primary key information
+ // -------------------------------------------------------------------------
+
+ @Override
+ public Record1 key() {
+ return (Record1) super.key();
+ }
+
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+
+ /**
+ * Create a detached AccountRecord
+ */
+ public AccountRecord() {
+ super(Account.ACCOUNT);
+ }
+
+ /**
+ * Create a detached, initialised AccountRecord
+ */
+ public AccountRecord(String id, Integer version, Timestamp modified, String schema, String start, String finish, Boolean enabled, String position, String fio, String workMail, Boolean esiaAccount, String domainId, String personId) {
+ super(Account.ACCOUNT);
+
+ setId(id);
+ setVersion(version);
+ setModified(modified);
+ setSchema(schema);
+ setStart(start);
+ setFinish(finish);
+ setEnabled(enabled);
+ setPosition(position);
+ setFio(fio);
+ setWorkMail(workMail);
+ setEsiaAccount(esiaAccount);
+ setDomainId(domainId);
+ setPersonId(personId);
+ resetChangedOnNotNull();
+ }
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/AccountRoleRecord.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/AccountRoleRecord.java
new file mode 100644
index 0000000..7fad8f8
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/AccountRoleRecord.java
@@ -0,0 +1,79 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records;
+
+
+import org.jooq.Record2;
+import org.jooq.impl.UpdatableRecordImpl;
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.AccountRole;
+
+
+/**
+ * This class is generated by jOOQ.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class AccountRoleRecord extends UpdatableRecordImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Setter for idm_reconcile.account_role.account_id.
+ */
+ public void setAccountId(String value) {
+ set(0, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account_role.account_id.
+ */
+ public String getAccountId() {
+ return (String) get(0);
+ }
+
+ /**
+ * Setter for idm_reconcile.account_role.role_id.
+ */
+ public void setRoleId(String value) {
+ set(1, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.account_role.role_id.
+ */
+ public String getRoleId() {
+ return (String) get(1);
+ }
+
+ // -------------------------------------------------------------------------
+ // Primary key information
+ // -------------------------------------------------------------------------
+
+ @Override
+ public Record2 key() {
+ return (Record2) super.key();
+ }
+
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+
+ /**
+ * Create a detached AccountRoleRecord
+ */
+ public AccountRoleRecord() {
+ super(AccountRole.ACCOUNT_ROLE);
+ }
+
+ /**
+ * Create a detached, initialised AccountRoleRecord
+ */
+ public AccountRoleRecord(String accountId, String roleId) {
+ super(AccountRole.ACCOUNT_ROLE);
+
+ setAccountId(accountId);
+ setRoleId(roleId);
+ resetChangedOnNotNull();
+ }
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/DomainRecord.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/DomainRecord.java
new file mode 100644
index 0000000..d14d4fd
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/DomainRecord.java
@@ -0,0 +1,803 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records;
+
+
+import java.sql.Timestamp;
+
+import org.jooq.Record1;
+import org.jooq.impl.UpdatableRecordImpl;
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Domain;
+
+
+/**
+ * This class is generated by jOOQ.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class DomainRecord extends UpdatableRecordImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Setter for idm_reconcile.domain.id.
+ */
+ public void setId(String value) {
+ set(0, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.id.
+ */
+ public String getId() {
+ return (String) get(0);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.version.
+ */
+ public void setVersion(Integer value) {
+ set(1, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.version.
+ */
+ public Integer getVersion() {
+ return (Integer) get(1);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.modified.
+ */
+ public void setModified(Timestamp value) {
+ set(2, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.modified.
+ */
+ public Timestamp getModified() {
+ return (Timestamp) get(2);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.schema.
+ */
+ public void setSchema(String value) {
+ set(3, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.schema.
+ */
+ public String getSchema() {
+ return (String) get(3);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.name.
+ */
+ public void setName(String value) {
+ set(4, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.name.
+ */
+ public String getName() {
+ return (String) get(4);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.shortname.
+ */
+ public void setShortname(String value) {
+ set(5, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.shortname.
+ */
+ public String getShortname() {
+ return (String) get(5);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.fullname.
+ */
+ public void setFullname(String value) {
+ set(6, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.fullname.
+ */
+ public String getFullname() {
+ return (String) get(6);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.dns.
+ */
+ public void setDns(String value) {
+ set(7, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.dns.
+ */
+ public String getDns() {
+ return (String) get(7);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.email.
+ */
+ public void setEmail(String value) {
+ set(8, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.email.
+ */
+ public String getEmail() {
+ return (String) get(8);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.phone.
+ */
+ public void setPhone(String value) {
+ set(9, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.phone.
+ */
+ public String getPhone() {
+ return (String) get(9);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.address.
+ */
+ public void setAddress(String value) {
+ set(10, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.address.
+ */
+ public String getAddress() {
+ return (String) get(10);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.postal_address.
+ */
+ public void setPostalAddress(String value) {
+ set(11, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.postal_address.
+ */
+ public String getPostalAddress() {
+ return (String) get(11);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.address_id.
+ */
+ public void setAddressId(String value) {
+ set(12, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.address_id.
+ */
+ public String getAddressId() {
+ return (String) get(12);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.postal_address_id.
+ */
+ public void setPostalAddressId(String value) {
+ set(13, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.postal_address_id.
+ */
+ public String getPostalAddressId() {
+ return (String) get(13);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.military_code.
+ */
+ public void setMilitaryCode(String value) {
+ set(14, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.military_code.
+ */
+ public String getMilitaryCode() {
+ return (String) get(14);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.timezone.
+ */
+ public void setTimezone(String value) {
+ set(15, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.timezone.
+ */
+ public String getTimezone() {
+ return (String) get(15);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.reports_enabled.
+ */
+ public void setReportsEnabled(Boolean value) {
+ set(16, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.reports_enabled.
+ */
+ public Boolean getReportsEnabled() {
+ return (Boolean) get(16);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.inn.
+ */
+ public void setInn(String value) {
+ set(17, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.inn.
+ */
+ public String getInn() {
+ return (String) get(17);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.leg.
+ */
+ public void setLeg(String value) {
+ set(18, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.leg.
+ */
+ public String getLeg() {
+ return (String) get(18);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.ogrn.
+ */
+ public void setOgrn(String value) {
+ set(19, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.ogrn.
+ */
+ public String getOgrn() {
+ return (String) get(19);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.region.
+ */
+ public void setRegion(String value) {
+ set(20, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.region.
+ */
+ public String getRegion() {
+ return (String) get(20);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.epgu_id.
+ */
+ public void setEpguId(String value) {
+ set(21, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.epgu_id.
+ */
+ public String getEpguId() {
+ return (String) get(21);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.type.
+ */
+ public void setType(String value) {
+ set(22, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.type.
+ */
+ public String getType() {
+ return (String) get(22);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.esia_employee_authorization.
+ */
+ public void setEsiaEmployeeAuthorization(Boolean value) {
+ set(23, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.esia_employee_authorization.
+ */
+ public Boolean getEsiaEmployeeAuthorization() {
+ return (Boolean) get(23);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.default_s3_bucket.
+ */
+ public void setDefaultS3Bucket(String value) {
+ set(24, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.default_s3_bucket.
+ */
+ public String getDefaultS3Bucket() {
+ return (String) get(24);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.opf.
+ */
+ public void setOpf(String value) {
+ set(25, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.opf.
+ */
+ public String getOpf() {
+ return (String) get(25);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.kpp.
+ */
+ public void setKpp(String value) {
+ set(26, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.kpp.
+ */
+ public String getKpp() {
+ return (String) get(26);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.checking_account.
+ */
+ public void setCheckingAccount(String value) {
+ set(27, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.checking_account.
+ */
+ public String getCheckingAccount() {
+ return (String) get(27);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.bik.
+ */
+ public void setBik(String value) {
+ set(28, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.bik.
+ */
+ public String getBik() {
+ return (String) get(28);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.bank_name.
+ */
+ public void setBankName(String value) {
+ set(29, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.bank_name.
+ */
+ public String getBankName() {
+ return (String) get(29);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.bank_correspondent_account.
+ */
+ public void setBankCorrespondentAccount(String value) {
+ set(30, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.bank_correspondent_account.
+ */
+ public String getBankCorrespondentAccount() {
+ return (String) get(30);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.oktmo.
+ */
+ public void setOktmo(String value) {
+ set(31, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.oktmo.
+ */
+ public String getOktmo() {
+ return (String) get(31);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.okato.
+ */
+ public void setOkato(String value) {
+ set(32, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.okato.
+ */
+ public String getOkato() {
+ return (String) get(32);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.gov_registration_date.
+ */
+ public void setGovRegistrationDate(String value) {
+ set(33, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.gov_registration_date.
+ */
+ public String getGovRegistrationDate() {
+ return (String) get(33);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.gov_organization_type.
+ */
+ public void setGovOrganizationType(String value) {
+ set(34, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.gov_organization_type.
+ */
+ public String getGovOrganizationType() {
+ return (String) get(34);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.alias_key.
+ */
+ public void setAliasKey(String value) {
+ set(35, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.alias_key.
+ */
+ public String getAliasKey() {
+ return (String) get(35);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.pass_key.
+ */
+ public void setPassKey(String value) {
+ set(36, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.pass_key.
+ */
+ public String getPassKey() {
+ return (String) get(36);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.certificate.
+ */
+ public void setCertificate(String value) {
+ set(37, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.certificate.
+ */
+ public String getCertificate() {
+ return (String) get(37);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.account_number_tofk.
+ */
+ public void setAccountNumberTofk(String value) {
+ set(38, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.account_number_tofk.
+ */
+ public String getAccountNumberTofk() {
+ return (String) get(38);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.bik_tofk.
+ */
+ public void setBikTofk(String value) {
+ set(39, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.bik_tofk.
+ */
+ public String getBikTofk() {
+ return (String) get(39);
+ }
+
+ /**
+ * Setter for
+ * idm_reconcile.domain.correspondent_bank_account_tofk.
+ */
+ public void setCorrespondentBankAccountTofk(String value) {
+ set(40, value);
+ }
+
+ /**
+ * Getter for
+ * idm_reconcile.domain.correspondent_bank_account_tofk.
+ */
+ public String getCorrespondentBankAccountTofk() {
+ return (String) get(40);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.name_tofk.
+ */
+ public void setNameTofk(String value) {
+ set(41, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.name_tofk.
+ */
+ public String getNameTofk() {
+ return (String) get(41);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.nsi_organization_id.
+ */
+ public void setNsiOrganizationId(String value) {
+ set(42, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.nsi_organization_id.
+ */
+ public String getNsiOrganizationId() {
+ return (String) get(42);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.doc_handle.
+ */
+ public void setDocHandle(String value) {
+ set(43, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.doc_handle.
+ */
+ public String getDocHandle() {
+ return (String) get(43);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.division_type.
+ */
+ public void setDivisionType(String value) {
+ set(44, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.division_type.
+ */
+ public String getDivisionType() {
+ return (String) get(44);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.tns_department_id.
+ */
+ public void setTnsDepartmentId(String value) {
+ set(45, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.tns_department_id.
+ */
+ public String getTnsDepartmentId() {
+ return (String) get(45);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.enabled.
+ */
+ public void setEnabled(Boolean value) {
+ set(46, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.enabled.
+ */
+ public Boolean getEnabled() {
+ return (Boolean) get(46);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.parent.
+ */
+ public void setParent(String value) {
+ set(47, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.parent.
+ */
+ public String getParent() {
+ return (String) get(47);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.region_id.
+ */
+ public void setRegionId(String value) {
+ set(48, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.region_id.
+ */
+ public String getRegionId() {
+ return (String) get(48);
+ }
+
+ /**
+ * Setter for idm_reconcile.domain.managed.
+ */
+ public void setManaged(String value) {
+ set(49, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.domain.managed.
+ */
+ public String getManaged() {
+ return (String) get(49);
+ }
+
+ // -------------------------------------------------------------------------
+ // Primary key information
+ // -------------------------------------------------------------------------
+
+ @Override
+ public Record1 key() {
+ return (Record1) super.key();
+ }
+
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+
+ /**
+ * Create a detached DomainRecord
+ */
+ public DomainRecord() {
+ super(Domain.DOMAIN);
+ }
+
+ /**
+ * Create a detached, initialised DomainRecord
+ */
+ public DomainRecord(String id, Integer version, Timestamp modified, String schema, String name, String shortname, String fullname, String dns, String email, String phone, String address, String postalAddress, String addressId, String postalAddressId, String militaryCode, String timezone, Boolean reportsEnabled, String inn, String leg, String ogrn, String region, String epguId, String type, Boolean esiaEmployeeAuthorization, String defaultS3Bucket, String opf, String kpp, String checkingAccount, String bik, String bankName, String bankCorrespondentAccount, String oktmo, String okato, String govRegistrationDate, String govOrganizationType, String aliasKey, String passKey, String certificate, String accountNumberTofk, String bikTofk, String correspondentBankAccountTofk, String nameTofk, String nsiOrganizationId, String docHandle, String divisionType, String tnsDepartmentId, Boolean enabled, String parent, String regionId, String managed) {
+ super(Domain.DOMAIN);
+
+ setId(id);
+ setVersion(version);
+ setModified(modified);
+ setSchema(schema);
+ setName(name);
+ setShortname(shortname);
+ setFullname(fullname);
+ setDns(dns);
+ setEmail(email);
+ setPhone(phone);
+ setAddress(address);
+ setPostalAddress(postalAddress);
+ setAddressId(addressId);
+ setPostalAddressId(postalAddressId);
+ setMilitaryCode(militaryCode);
+ setTimezone(timezone);
+ setReportsEnabled(reportsEnabled);
+ setInn(inn);
+ setLeg(leg);
+ setOgrn(ogrn);
+ setRegion(region);
+ setEpguId(epguId);
+ setType(type);
+ setEsiaEmployeeAuthorization(esiaEmployeeAuthorization);
+ setDefaultS3Bucket(defaultS3Bucket);
+ setOpf(opf);
+ setKpp(kpp);
+ setCheckingAccount(checkingAccount);
+ setBik(bik);
+ setBankName(bankName);
+ setBankCorrespondentAccount(bankCorrespondentAccount);
+ setOktmo(oktmo);
+ setOkato(okato);
+ setGovRegistrationDate(govRegistrationDate);
+ setGovOrganizationType(govOrganizationType);
+ setAliasKey(aliasKey);
+ setPassKey(passKey);
+ setCertificate(certificate);
+ setAccountNumberTofk(accountNumberTofk);
+ setBikTofk(bikTofk);
+ setCorrespondentBankAccountTofk(correspondentBankAccountTofk);
+ setNameTofk(nameTofk);
+ setNsiOrganizationId(nsiOrganizationId);
+ setDocHandle(docHandle);
+ setDivisionType(divisionType);
+ setTnsDepartmentId(tnsDepartmentId);
+ setEnabled(enabled);
+ setParent(parent);
+ setRegionId(regionId);
+ setManaged(managed);
+ resetChangedOnNotNull();
+ }
+}
diff --git a/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/RoleRecord.java b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/RoleRecord.java
new file mode 100644
index 0000000..009e902
--- /dev/null
+++ b/backend/src/main/java/ru/micord/webbpm/ervu/business_metrics/db_beans/idm_reconcile/tables/records/RoleRecord.java
@@ -0,0 +1,216 @@
+/*
+ * This file is generated by jOOQ.
+ */
+package ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.records;
+
+
+import java.sql.Timestamp;
+
+import org.jooq.Record1;
+import org.jooq.impl.UpdatableRecordImpl;
+
+import ru.micord.webbpm.ervu.business_metrics.db_beans.idm_reconcile.tables.Role;
+
+
+/**
+ * This class is generated by jOOQ.
+ */
+@SuppressWarnings({ "all", "unchecked", "rawtypes" })
+public class RoleRecord extends UpdatableRecordImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Setter for idm_reconcile.role.id.
+ */
+ public void setId(String value) {
+ set(0, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.id.
+ */
+ public String getId() {
+ return (String) get(0);
+ }
+
+ /**
+ * Setter for idm_reconcile.role.version.
+ */
+ public void setVersion(Integer value) {
+ set(1, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.version.
+ */
+ public Integer getVersion() {
+ return (Integer) get(1);
+ }
+
+ /**
+ * Setter for idm_reconcile.role.modified.
+ */
+ public void setModified(Timestamp value) {
+ set(2, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.modified.
+ */
+ public Timestamp getModified() {
+ return (Timestamp) get(2);
+ }
+
+ /**
+ * Setter for idm_reconcile.role.schema.
+ */
+ public void setSchema(String value) {
+ set(3, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.schema.
+ */
+ public String getSchema() {
+ return (String) get(3);
+ }
+
+ /**
+ * Setter for idm_reconcile.role.name.
+ */
+ public void setName(String value) {
+ set(4, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.name.
+ */
+ public String getName() {
+ return (String) get(4);
+ }
+
+ /**
+ * Setter for idm_reconcile.role.shortname.
+ */
+ public void setShortname(String value) {
+ set(5, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.shortname.
+ */
+ public String getShortname() {
+ return (String) get(5);
+ }
+
+ /**
+ * Setter for idm_reconcile.role.display_name.
+ */
+ public void setDisplayName(String value) {
+ set(6, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.display_name.
+ */
+ public String getDisplayName() {
+ return (String) get(6);
+ }
+
+ /**
+ * Setter for idm_reconcile.role.sessions_limit.
+ */
+ public void setSessionsLimit(Integer value) {
+ set(7, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.sessions_limit.
+ */
+ public Integer getSessionsLimit() {
+ return (Integer) get(7);
+ }
+
+ /**
+ * Setter for idm_reconcile.role.ervu_role.
+ */
+ public void setErvuRole(Boolean value) {
+ set(8, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.ervu_role.
+ */
+ public Boolean getErvuRole() {
+ return (Boolean) get(8);
+ }
+
+ /**
+ * Setter for idm_reconcile.role.imported.
+ */
+ public void setImported(Integer value) {
+ set(9, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.imported.
+ */
+ public Integer getImported() {
+ return (Integer) get(9);
+ }
+
+ /**
+ * Setter for idm_reconcile.role.description.
+ */
+ public void setDescription(String value) {
+ set(10, value);
+ }
+
+ /**
+ * Getter for idm_reconcile.role.description.
+ */
+ public String getDescription() {
+ return (String) get(10);
+ }
+
+ // -------------------------------------------------------------------------
+ // Primary key information
+ // -------------------------------------------------------------------------
+
+ @Override
+ public Record1 key() {
+ return (Record1) super.key();
+ }
+
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+
+ /**
+ * Create a detached RoleRecord
+ */
+ public RoleRecord() {
+ super(Role.ROLE);
+ }
+
+ /**
+ * Create a detached, initialised RoleRecord
+ */
+ public RoleRecord(String id, Integer version, Timestamp modified, String schema, String name, String shortname, String displayName, Integer sessionsLimit, Boolean ervuRole, Integer imported, String description) {
+ super(Role.ROLE);
+
+ setId(id);
+ setVersion(version);
+ setModified(modified);
+ setSchema(schema);
+ setName(name);
+ setShortname(shortname);
+ setDisplayName(displayName);
+ setSessionsLimit(sessionsLimit);
+ setErvuRole(ervuRole);
+ setImported(imported);
+ setDescription(description);
+ resetChangedOnNotNull();
+ }
+}
diff --git a/backend/src/main/resources/config/v_1.0/20250418-SUPPORT-9122_add_idm.xml b/backend/src/main/resources/config/v_1.0/20250418-SUPPORT-9122_add_idm.xml
new file mode 100644
index 0000000..18731d0
--- /dev/null
+++ b/backend/src/main/resources/config/v_1.0/20250418-SUPPORT-9122_add_idm.xml
@@ -0,0 +1,131 @@
+
+
+
+
+ create schema idm_reconcile
+
+ CREATE SCHEMA IF NOT EXISTS idm_reconcile;
+ ALTER SCHEMA idm_reconcile OWNER TO ervu_business_metrics;
+
+
+
+
+ creat table domain
+
+ CREATE TABLE IF NOT EXISTS idm_reconcile.domain (
+ id varchar(255) PRIMARY KEY,
+ version int NOT NULL,
+ modified timestamp without time zone,
+ schema varchar(255) NOT NULL,
+ name varchar(255),
+ shortname varchar(255),
+ fullname varchar(255),
+ dns varchar(255),
+ email varchar(255),
+ phone varchar(255),
+ address varchar(1024),
+ postal_address varchar(1024),
+ address_id varchar(255),
+ postal_address_id varchar(255),
+ military_code varchar(255),
+ timezone varchar(255),
+ reports_enabled boolean,
+ inn varchar(255),
+ leg varchar(255),
+ ogrn varchar(255),
+ region varchar(255),
+ epgu_id varchar(255),
+ type varchar(255),
+ esia_employee_authorization boolean,
+ default_s3_bucket varchar(255),
+ opf varchar(255),
+ kpp varchar(255),
+ checking_account varchar(255),
+ bik varchar(255),
+ bank_name varchar(255),
+ bank_correspondent_account varchar(255),
+ oktmo varchar(255),
+ okato varchar(255),
+ gov_registration_date varchar(255),
+ gov_organization_type varchar(255),
+ alias_key varchar(255),
+ pass_key varchar(255),
+ certificate varchar(2048),
+ account_number_tofk varchar(255),
+ bik_tofk varchar(255),
+ correspondent_bank_account_tofk varchar(255),
+ name_tofk varchar(255),
+ nsi_organization_id varchar(255),
+ doc_handle varchar(255),
+ division_type varchar(255),
+ tns_department_id varchar(255),
+ enabled boolean,
+ parent varchar(255),
+ region_id varchar(255),
+ managed varchar(255)
+ );
+
+ ALTER TABLE idm_reconcile.domain OWNER TO ervu_business_metrics;
+
+
+
+
+ create table role
+
+ CREATE TABLE IF NOT EXISTS idm_reconcile.role (
+ id varchar(255) PRIMARY KEY,
+ version int NOT NULL,
+ modified timestamp without time zone,
+ schema varchar(255) NOT NULL,
+ name varchar(255),
+ shortname varchar(255),
+ display_name varchar(255),
+ sessions_limit int,
+ ervu_role boolean,
+ imported int,
+ description TEXT
+ );
+
+ ALTER TABLE idm_reconcile.role OWNER TO ervu_business_metrics;
+
+
+
+
+ create table account and account_role
+
+ CREATE TABLE IF NOT EXISTS idm_reconcile.account (
+ id varchar(36) PRIMARY KEY,
+ version int NOT NULL,
+ modified timestamp without time zone,
+ schema varchar(100) NOT NULL,
+ start varchar(50),
+ finish varchar(50),
+ enabled boolean NOT NULL DEFAULT TRUE,
+ position varchar(255),
+ fio varchar(255),
+ work_mail varchar(255),
+ esia_account boolean NOT NULL DEFAULT FALSE,
+ domain_id varchar(36)
+ );
+
+ ALTER TABLE idm_reconcile.account OWNER TO ervu_business_metrics;
+
+ CREATE TABLE IF NOT EXISTS idm_reconcile.account_role (
+ account_id varchar(36) NOT NULL,
+ role_id varchar(36) NOT NULL,
+
+ CONSTRAINT pk_account_role PRIMARY KEY (account_id, role_id),
+
+ CONSTRAINT fk_account_role_account FOREIGN KEY (account_id)
+ REFERENCES idm_reconcile.account (id)
+ ON DELETE CASCADE
+ );
+
+ ALTER TABLE idm_reconcile.account_role OWNER TO ervu_business_metrics;
+
+
+
\ No newline at end of file
diff --git a/backend/src/main/resources/config/v_1.0/changelog-1.0.xml b/backend/src/main/resources/config/v_1.0/changelog-1.0.xml
index b2348bc..e2fd638 100644
--- a/backend/src/main/resources/config/v_1.0/changelog-1.0.xml
+++ b/backend/src/main/resources/config/v_1.0/changelog-1.0.xml
@@ -27,7 +27,8 @@
+
-
+
\ No newline at end of file
diff --git a/config/micord.env b/config/micord.env
index 11671a1..6af5df5 100644
--- a/config/micord.env
+++ b/config/micord.env
@@ -5,3 +5,31 @@ DB_APP_PASSWORD=ervu_business_metrics
DB_APP_HOST=10.10.31.119
DB_APP_PORT=5432
DB_APP_NAME=ervu-dashboard-recr
+
+#Kafka
+KAFKA_HOSTS=10.10.31.11:32609
+KAFKA_AUTH_SEC_PROTO=SASL_PLAINTEXT
+KAFKA_AUTH_SASL_MECH=SCRAM-SHA-256
+KAFKA_AUTH_SASL_MODULE=org.apache.kafka.common.security.scram.ScramLoginModule
+KAFKA_USER=user1
+KAFKA_PASS=Blfi9d2OFG
+KAFKA_DOMAIN_GROUP_ID=ervu-business-metrics-backend-domain
+KAFKA_ROLE_GROUP_ID=ervu-business-metrics-backend-role
+KAFKA_ACCOUNT_GROUP_ID=ervu-business-metrics-backend-account
+KAFKA_ROLE_RECONCILIATION=idmv2.role.reconciliation
+KAFKA_DOMAIN_RECONCILIATION=idmv2.domain.reconciliation
+KAFKA_ACCOUNT_RECONCILIATION=idmv2.account.reconciliation
+KAFKA_DOMAIN_UPDATED_GROUP_ID=ervu-business-metrics-backend-domain-updated
+KAFKA_DOMAIN_UPDATED=idmv2.domain.updated
+KAFKA_DOMAIN_CREATED_GROUP_ID=ervu-business-metrics-backend-domain-created
+KAFKA_DOMAIN_CREATED=idmv2.domain.created
+KAFKA_ACCOUNT_UPDATED_GROUP_ID=ervu-business-metrics-backend-account-updated
+KAFKA_ACCOUNT_UPDATED=idmv2.account.updated
+KAFKA_ACCOUNT_CREATED_GROUP_ID=ervu-business-metrics-backend-account-created
+KAFKA_ACCOUNT_CREATED=idmv2.account.created
+KAFKA_DOMAIN_DELETED_GROUP_ID=ervu-business-metrics-backend-domain-deleted
+KAFKA_DOMAIN_DELETED=idmv2.domain.deleted
+KAFKA_ACCOUNT_DELETED_GROUP_ID=ervu-business-metrics-backend-account-deleted
+KAFKA_ACCOUNT_DELETED=idmv2.account.deleted
+ERVU_IDM_RECONCILE_ENABLED=false
+ERVU_IDM_URL=http://idm
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index bf523a8..9a9c344 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,6 +15,7 @@
scm:git:git://gitserver/webbpm/webbpm-components.git
+ 2.9.13
1.60
UTF-8
false
@@ -285,6 +286,28 @@
log4j-web
2.23.1
+
+ org.springframework.kafka
+ spring-kafka
+ ${spring-kafka.version}
+
+
+ org.apache.kafka
+ kafka-clients
+
+
+
+
+ org.apache.kafka
+ kafka-clients
+ 3.9.0
+
+
+ org.xerial.snappy
+ snappy-java
+
+
+
diff --git a/resources/src/main/resources/database/datasource.xml b/resources/src/main/resources/database/datasource.xml
index 77aa28d..de989c7 100644
--- a/resources/src/main/resources/database/datasource.xml
+++ b/resources/src/main/resources/database/datasource.xml
@@ -10,6 +10,7 @@
actualization
admin_indicators
deregistration
+ idm_reconcile
init_registration_info
journal_log
metrics