diff --git a/.env.common b/.env.common index bad833f..5b29754 100644 --- a/.env.common +++ b/.env.common @@ -7,10 +7,11 @@ YLEM_REDIS_HOST=ylem_session_storage YLEM_REDIS_PORT=6379 YLEM_REDIS_PASSWORD=dtmnpassword -# Ylem requires your own Apache Kafka to be installed to be able to process pipelines and tasks. -# Add the URL of your Apache Kafka instance here or keep it as host.docker.internal:9092 if you have a standard -# Kafka set up on your host machine. -YLEM_KAFKA_BOOTSTRAP_SERVERS=host.docker.internal:9092 +# Ylem uses Apache Kafka to exchange messages for processing pipelines and tasks. +# If you use our standard container defined in docker-compose.yml keep this value as ylem_kafka_broker:39092 +# If you have your own standard Apache Kafka on the host machine keep it as host.docker.internal:9092 +# Or modify it accordingly if you have a custom setup. +YLEM_KAFKA_BOOTSTRAP_SERVERS=ylem_kafka_broker:39092 YLEM_KAFKA_TASK_RUNS_LOAD_BALANCED_TOPIC=task_runs_load_balanced YLEM_KAFKA_TASK_RUNS_TOPIC=task_runs diff --git a/backend/integrations/api/CreateSQLIntegration.go b/backend/integrations/api/CreateSQLIntegration.go index d150524..0fac1ab 100644 --- a/backend/integrations/api/CreateSQLIntegration.go +++ b/backend/integrations/api/CreateSQLIntegration.go @@ -198,7 +198,7 @@ func createElasticsearchSQLIntegration(db *sql.DB, user *services.Authentication return nil } - err = repositories.CreateSQLIntegration(db, entity) + _, err = repositories.CreateSQLIntegration(db, entity) if err != nil { log.Error(err) @@ -320,7 +320,7 @@ func createGenericSQLIntegration(db *sql.DB, user *services.AuthenticationData, return nil } - err = repositories.CreateSQLIntegration(db, entity) + ent, err := repositories.CreateSQLIntegration(db, entity) if err != nil { log.Error(err) helpers.HttpReturnErrorInternal(w) @@ -339,6 +339,7 @@ func createGenericSQLIntegration(db *sql.DB, user *services.AuthenticationData, return nil } + entity.Integration.Uuid = ent.Integration.Uuid w.WriteHeader(http.StatusOK) jsonResponse, _ := json.Marshal(entity) _, err = w.Write(jsonResponse) @@ -432,7 +433,7 @@ func createBigQuerySQLIntegration(db *sql.DB, user *services.AuthenticationData, return nil } - err = repositories.CreateSQLIntegration(db, entity) + _, err = repositories.CreateSQLIntegration(db, entity) if err != nil { log.Error(err) diff --git a/backend/integrations/repositories/SQLRepository.go b/backend/integrations/repositories/SQLRepository.go index 21a6993..f481949 100644 --- a/backend/integrations/repositories/SQLRepository.go +++ b/backend/integrations/repositories/SQLRepository.go @@ -9,7 +9,7 @@ import ( log "github.com/sirupsen/logrus" ) -func CreateSQLIntegration(db *sql.DB, entity *entities.SQLIntegration) error { +func CreateSQLIntegration(db *sql.DB, entity *entities.SQLIntegration) (*entities.SQLIntegration, error) { log.Tracef("Creating SQL Integration") tx, err := db.Begin() @@ -17,7 +17,7 @@ func CreateSQLIntegration(db *sql.DB, entity *entities.SQLIntegration) error { if err != nil { log.Error(err) - return err + return nil, err } entity.Integration.Uuid = uuid.NewString() @@ -40,7 +40,7 @@ func CreateSQLIntegration(db *sql.DB, entity *entities.SQLIntegration) error { _ = tx.Rollback() log.Error(err) - return err + return nil, err } defer stmt.Close() @@ -59,7 +59,7 @@ func CreateSQLIntegration(db *sql.DB, entity *entities.SQLIntegration) error { if err != nil { _ = tx.Rollback() log.Error(err) - return err + return nil, err } entity.Integration.Id, _ = result.LastInsertId() @@ -73,7 +73,7 @@ func CreateSQLIntegration(db *sql.DB, entity *entities.SQLIntegration) error { _ = tx.Rollback() log.Error(err) - return err + return nil, err } defer stmt.Close() @@ -105,17 +105,17 @@ func CreateSQLIntegration(db *sql.DB, entity *entities.SQLIntegration) error { if err != nil { _ = tx.Rollback() log.Error(err) - return err + return nil, err } } err = tx.Commit() if err != nil { log.Error(err) - return err + return nil, err } - return nil + return entity, nil } func FindSQLIntegration(db *sql.DB, Uuid string) (*entities.SQLIntegration, error) { diff --git a/backend/pipelines/app/trial/creator.go b/backend/pipelines/app/trial/creator.go index 3577279..e208b39 100644 --- a/backend/pipelines/app/trial/creator.go +++ b/backend/pipelines/app/trial/creator.go @@ -84,6 +84,37 @@ func createTrialPipeline(db *sql.DB, pipelineUuid string, pipelineName string, o return err } + + tx, err = db.Begin() + if err != nil { + log.Error(err) + return err + } + + tplWf, tasks, tts, err = loadPipelineData(db, newWfUuid) + if err != nil { + _ = tx.Rollback() + log.Error(err) + return err + } + + var query *task.Query + var uQuery *task.HttpApiUpdatedQuery + for _, qTask := range tasks.Items { + if qTask.Type == task.TaskTypeQuery { + query, _ = task.GetQuery(db, qTask.Id) + uQuery.SourceUuid = sourceUuid + uQuery.SQLQuery = query.SQLQuery + _ = task.UpdateQueryTx(tx, qTask.Id, uQuery) + } + } + + err = tx.Commit() + if err != nil { + log.Error(err) + return err + } + return nil } diff --git a/backend/pipelines/db/migration/000002_pipeline_templates.up.sql b/backend/pipelines/db/migration/000002_pipeline_templates.up.sql index fd91f05..a05b230 100644 --- a/backend/pipelines/db/migration/000002_pipeline_templates.up.sql +++ b/backend/pipelines/db/migration/000002_pipeline_templates.up.sql @@ -545,7 +545,7 @@ INSERT INTO `aggregators` (`id`, `uuid`, `expression`, `variable_name`, `is_acti VALUES (1, '9f37a684-1aa9-46ca-8817-0119106b0dd4', X'53554D28616D6F756E7429', 'value', 1), (2, 'bd76e868-daf0-475d-b8c9-684344116630', X'53554D28616D6F756E7429', 'value', 1), - (3, '23dc5b6c-c7c3-4161-8a0a-e51e25e41373', X'524F554E4428415647286E756D6265725F66616D696C696573292C20322C2022666C6F6F722229', 'value', 1), + (3, '23dc5b6c-c7c3-4161-8a0a-e51e25e41373', X'524F554E442841564728616D6F756E74292C20322C2022666C6F6F722229', 'value', 1), (4, '859e5c14-9d22-42ce-8d57-5f24ae9707ca', X'41564728616D6F756E7429', 'value', 1), (5, 'd6f110b4-9574-4658-ae4e-5bc14eac9665', X'4D494E28616D6F756E7429', 'value', 1), (6, '15922fe2-6404-4ae1-a1f4-57c5d0f72637', X'4D415828616D6F756E7429', 'value', 1), @@ -588,7 +588,7 @@ VALUES INSERT INTO `codes` (`id`, `uuid`, `type`, `code`, `is_active`) VALUES - (1, '05f11c00-ffdd-4a5f-846d-b9f1d897161a', '', X'726573756C74203D205B5D0A0A666F72206920696E20696E7075743A0A2020696620695B226E756D6265725F66616D696C696573225D206973206E6F74204E6F6E6520616E6420695B226E756D6265725F66616D696C696573225D203C20323030303A0A20202020726573756C742E617070656E642869290A0A696E707574203D20726573756C74', 1); + (1, '05f11c00-ffdd-4a5f-846d-b9f1d897161a', '', X'726573756C74203D205B5D0A0A666F72206920696E20696E7075743A0A2020696620695B22616D6F756E74225D206973206E6F74204E6F6E6520616E6420695B22616D6F756E74225D203C20323030303A0A20202020726573756C742E617070656E642869290A0A696E707574203D20726573756C74', 1); INSERT INTO `conditions` (`id`, `uuid`, `expression`, `is_active`) @@ -760,7 +760,7 @@ VALUES (9, 'be3b9142-24f5-4243-beb2-e8b15cabe487', '', X'53454C454354202A0A46524F4D20747269616C5F64617461626173652E637573746F6D6572733B', 1), (10, '964dc92d-9f96-4009-9aa8-44ea10164418', '', X'53454C454354202A0A46524F4D20747269616C5F64617461626173652E7061796D656E74733B', 1), (11, '05f6ca8b-2b8c-4abb-ba4b-7512473751a1', '', X'53454C454354202A0A46524F4D20747269616C5F64617461626173652E6F72646572733B', 1), - (12, '563e4981-87a6-44d2-ab3c-e434fc7d28c1', '', X'53454C454354202A0A46524F4D205266616D2E76657273696F6E0A4C494D495420310A3B', 1), + (12, '563e4981-87a6-44d2-ab3c-e434fc7d28c1', '', X'53454C454354202A0A46524F4D2066696E616E63652E696E766F696365730A3B', 1), (13, '4b2880af-cded-43b8-9307-fbe6c56968f6', '', X'53454C454354202A0A46524F4D20747269616C5F64617461626173652E6F72646572733B', 1), (14, 'a2829443-f6f5-4e78-b71f-49d0b3ee9e90', '', X'53454C454354202A0A46524F4D20747269616C5F64617461626173652E6F72646572733B', 1), (15, '13e72f79-dc85-4185-97db-d6e756cb908a', '', X'53454C454354202A0A46524F4D20747269616C5F64617461626173652E6F72646572733B', 1), @@ -794,13 +794,13 @@ VALUES (43, 'ed1c305e-6be9-47b4-8798-fc19a21e6dbb', '', X'', 1), (44, '364e9d81-54e1-4e8d-bfd6-0d0975a19495', '', X'', 1), (45, '2e4a07ad-d3a7-414a-8bd9-0a0b596aaadf', '', X'53454C454354202A0A46524F4D205266616D2E736565645F726567696F6E0A4C494D495420310A3B', 1), - (46, '6e4a30fa-b4b8-4f9a-b9c8-3deb8ddad64a', '', X'53454C454354202A0A46524F4D20637573746F6D65725F737563636573732E6F7267616E697A6174696F6E730A3B', 1), - (47, 'eb1dc26b-190f-4611-a366-904834726b33', '', X'53454C454354202A0A46524F4D205266616D2E76657273696F6E0A4C494D495420310A3B', 1), + (46, '6e4a30fa-b4b8-4f9a-b9c8-3deb8ddad64a', '', X'53454C454354202A0A46524F4D2066696E616E63652E696E766F696365730A3B', 1), + (47, 'eb1dc26b-190f-4611-a366-904834726b33', '', X'53454C454354202A0A46524F4D2066696E616E63652E696E766F696365730A3B', 1), (48, '1050a550-a358-4cf1-8448-5695f90a1b03', '', X'', 1), (49, 'f8255205-d651-4a17-b5e4-b05a5ce51f89', '', X'', 1), (50, '58023f9a-fed3-4a17-9c7d-150c874cd9e8', '', X'', 1), (51, '0b4bd16a-fd3a-4013-bae7-42b3eb2ccf3c', '', X'53454C454354202A0A46524F4D2074656D706C617465312E6E756C6C0A3B', 1), - (52, '96b43e21-f1b4-458a-a1d9-04186d1cc536', '', X'53454C454354202A0A46524F4D205266616D2E76657273696F6E0A4C494D495420310A3B', 1), + (52, '96b43e21-f1b4-458a-a1d9-04186d1cc536', '', X'53454C454354202A0A46524F4D2066696E616E63652E696E766F696365730A3B', 1), (53, 'f160e3f6-0378-43c0-a2e4-560218fb3007', '', X'53454C454354202A0A46524F4D2068722E68697265730A574845524520594541522868697265645F617429203D20594541522843555252454E545F4441544528292920414E44204D4F4E54482868697265645F617429203D204D4F4E54482843555252454E545F444154452829290A3B', 1), (54, 'f773c4f2-c4f4-43e5-8e9e-d1a5d621dbba', '', X'53454C454354202A0A46524F4D2065636F6D6D657263652E6F72646572730A5748455245205945415228637265617465645F617429203D20594541522843555252454E545F4441544528292920414E44204D4F4E544828637265617465645F617429203D204D4F4E54482843555252454E545F444154452829290A3B', 1), (55, '0027a56a-03a2-4cb2-bd7f-bd9a33a14a58', '', X'53454C454354202A0A46524F4D2065636F6D6D657263652E6F72646572730A574845524520637265617465645F6174203E20444154455F535542284E4F5728292C20494E54455256414C20333020444159290A2020414E4420737461747573203D2022636F6D706C65746564220A3B', 1), diff --git a/backend/statistics/docker-compose.yml b/backend/statistics/docker-compose.yml index 1b78e7c..e0aa145 100644 --- a/backend/statistics/docker-compose.yml +++ b/backend/statistics/docker-compose.yml @@ -23,9 +23,9 @@ services: container_name: ylem_statistics_database healthcheck: interval: 10s - retries: 5 + retries: 50 test: wget --no-verbose --tries=1 --spider http://127.0.0.1:8123/ping || exit 1 - timeout: 10s + timeout: 15s ylem_statistics_migrations: env_file: diff --git a/backend/users/services/CreateTrialDBDataSource.go b/backend/users/services/CreateTrialDBDataSource.go index d080c28..073cbd6 100644 --- a/backend/users/services/CreateTrialDBDataSource.go +++ b/backend/users/services/CreateTrialDBDataSource.go @@ -27,12 +27,12 @@ type dataSource struct { func newTrialDataSource(organizationUuid string) *dataSource { d := dataSource{OrganizationUuid: organizationUuid} d.Type = "mysql" - d.Name = "Public Rfam Database for testing" - d.Host = "mysql-rfam-public.ebi.ac.uk" - d.Port = 4497 - d.User = "rfamro" - d.Password = "" - d.Database = "Rfam" + d.Name = "Ylem test" + d.Host = "ylem_database" + d.Port = 3306 + d.User = "dtmntestuser" + d.Password = "dtmntestpassword" + d.Database = "" d.ConnectionType = "direct" return &d diff --git a/database/init.sql b/database/init.sql index 85ed3b9..2c2750b 100644 --- a/database/init.sql +++ b/database/init.sql @@ -13,3 +13,474 @@ GRANT ALL PRIVILEGES ON pipelines.* TO 'dtmnuser'@'%'; FLUSH PRIVILEGES; SET GLOBAL max_allowed_packet=1073741824; + +CREATE USER 'dtmntestuser'@'%' IDENTIFIED BY 'dtmntestpassword'; + +CREATE DATABASE IF NOT EXISTS trial_database CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +GRANT ALL PRIVILEGES ON trial_database.* TO 'dtmntestuser'@'%'; + +CREATE DATABASE IF NOT EXISTS compliance CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +GRANT ALL PRIVILEGES ON compliance.* TO 'dtmntestuser'@'%'; + +CREATE DATABASE IF NOT EXISTS customer_success CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +GRANT ALL PRIVILEGES ON customer_success.* TO 'dtmntestuser'@'%'; + +CREATE DATABASE IF NOT EXISTS data_monitoring CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +GRANT ALL PRIVILEGES ON data_monitoring.* TO 'dtmntestuser'@'%'; + +CREATE DATABASE IF NOT EXISTS ecommerce CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +GRANT ALL PRIVILEGES ON ecommerce.* TO 'dtmntestuser'@'%'; + +CREATE DATABASE IF NOT EXISTS finance CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +GRANT ALL PRIVILEGES ON finance.* TO 'dtmntestuser'@'%'; + +CREATE DATABASE IF NOT EXISTS hr CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +GRANT ALL PRIVILEGES ON hr.* TO 'dtmntestuser'@'%'; + +FLUSH PRIVILEGES; + +USE `trial_database`; + +CREATE TABLE `customers` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `email` varchar(255) DEFAULT NULL, + `first_name` varchar(255) DEFAULT NULL, + `last_name` varchar(255) DEFAULT NULL, + `status` varchar(255) DEFAULT NULL, + `IP` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `customers` (`id`, `email`, `first_name`, `last_name`, `status`, `IP`, `created_at`) +VALUES + (1,'test@example.com','Emily','James','pending','178.5.92.123','2021-02-05 23:16:07'), + (2,'test2@example.com','Jack','Lonely :)','waiting_for_approval','183.4.42.352','2021-02-05 23:17:06'), + (3,'test3@example.com','Marc ;-)','Watson','phone_confirmed','3.45.22.11','2021-02-05 23:17:27'), + (4,'test4@example.com','Liza','Conolly','profile_created','47.12.654.4','2021-02-05 23:17:56'), + (5,'fraudster1@example.com','Bb','gg','complete','12.135.67.45','2022-02-07 21:47:51'), + (6,'fraudster2@example.com','Bb','gg','complete','12.135.67.45','2022-02-07 21:47:53'), + (7,'fraudster3@example.com','Bb','gg','complete','12.135.67.45','2022-02-07 21:47:55'), + (8,'complete@example.com','Bill','Wilson','complete','3.45.22.12','2022-02-06 09:11:46'); + +CREATE TABLE `orders` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `amount` decimal(10,2) DEFAULT NULL, + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `customer_id` int unsigned DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `orders` (`id`, `amount`, `status`, `customer_id`, `created_at`) +VALUES + (1,380.25,'shipped',8,'2021-02-05 22:39:32'), + (2,1380.25,'shipped',8,'2021-02-12 22:39:32'), + (3,5425.89,'shipped',8,'2021-03-05 22:39:32'), + (4,10.44,'In_delivery',8,'2021-12-05 22:39:32'), + (5,110.44,'In_delivery',8,'2021-12-05 22:39:32'); + +CREATE TABLE `payments` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `amount` decimal(10,2) DEFAULT NULL, + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `order_id` int unsigned DEFAULT NULL, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `payments` (`id`, `amount`, `status`, `order_id`, `created_at`) +VALUES + (1,180.25,'paid',1,'2021-02-05 22:43:42'), + (2,1380.25,'pending',2,'2022-02-05 22:44:41'), + (3,200.05,'paid',1,'2021-02-05 22:43:42'), + (4,5425.89,'paid',3,'2022-02-05 22:45:58'), + (5,10.44,'failed',4,'2022-02-05 22:46:08'); + +USE `compliance`; + +CREATE TABLE `organizations` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `organizations` (`id`, `name`, `status`, `created_at`, `updated_at`) +VALUES + (1,'Delivery scale Ltd','complete','2022-10-01 14:31:43','2022-10-01 14:31:43'), + (2,'Security scale Ltd','complete','2022-10-01 14:31:56','2022-10-01 14:31:56'), + (3,'Mountain one GmbH','new','2022-10-01 14:32:41','2022-10-01 14:32:41'), + (4,'Surfing camp Ltd','complete','2022-10-01 14:32:57','2022-10-01 14:32:57'), + (5,'Organization UG','verification_pending','2022-10-01 14:33:11','2022-10-01 14:33:11'); + +CREATE TABLE `documents` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(255) DEFAULT NULL, + `organization_id` int unsigned DEFAULT NULL, + `uploaded_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `organization_id` (`organization_id`), + + CONSTRAINT `documents_ibfk_1` FOREIGN KEY (organization_id) REFERENCES organizations(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `documents` (`id`, `type`, `organization_id`, `uploaded_at`) +VALUES + (1,'incorporation_certificate',1,'2022-10-01 15:43:05'), + (2,'incorporation_certificate',2,'2022-10-01 15:43:17'), + (3,'shareholders_list',1,'2022-10-01 15:43:41'), + (4,'shareholders_list',2,'2022-10-01 15:43:41'), + (5,'shareholders_list',3,'2022-10-01 15:43:41'), + (6,'shareholders_list',4,'2022-10-01 15:43:41'), + (9,'incorporation_certificate',5,'2022-10-01 15:43:17'), + (12,'incorporation_certificate',1,'2024-03-26 16:46:00'); + +CREATE TABLE `kycs` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `organization_id` int unsigned DEFAULT NULL, + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `completed_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `organization_id` (`organization_id`), + CONSTRAINT `kycs_ibfk_1` FOREIGN KEY (organization_id) REFERENCES organizations(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `kycs` (`id`, `organization_id`, `status`, `started_at`, `completed_at`) +VALUES + (1,1,'new','2022-10-01 15:40:34',NULL), + (2,2,'complete','2022-10-01 15:40:51','2022-10-01 15:40:51'), + (3,3,'complete','2022-10-01 15:40:57','2022-10-01 15:40:57'), + (4,4,'request_sent','2022-10-01 15:41:05',NULL), + (5,5,'failed','2022-10-01 15:41:23',NULL); + +CREATE TABLE `questionaires` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `organization_id` int unsigned DEFAULT NULL, + `status` varchar(255) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `uodated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `organization_id` (`organization_id`), + CONSTRAINT `questionaires_ibfk_1` FOREIGN KEY (organization_id) REFERENCES organizations(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `questionaires` (`id`, `organization_id`, `status`, `created_at`, `uodated_at`) +VALUES + (1,1,'filled','2022-10-01 15:49:45','2022-10-01 15:49:45'), + (2,2,'pending','2022-10-01 15:49:52','2022-10-01 15:49:52'), + (3,3,'filled','2022-10-01 15:50:00','2022-10-01 15:50:00'), + (4,4,'filled','2022-10-01 15:50:06','2022-10-01 15:50:06'), + (5,5,'pending','2022-10-01 15:50:11','2022-10-01 15:50:11'); + +USE `customer_success`; + +CREATE TABLE `organizations` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `creator_id` int unsigned DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `creator_id` (`creator_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `organizations` (`id`, `name`, `creator_id`, `created_at`, `updated_at`) +VALUES + (1,'Datacom Ltd',1,'2022-10-01 14:11:05','2022-10-01 14:11:05'), + (2,'Delivery moon GmbH',4,'2022-10-01 14:11:20','2022-10-01 14:11:20'), + (3,'Security Cloud Ltd',5,'2022-10-01 14:11:31','2022-10-01 14:11:31'), + (4,'Step One AG',8,'2022-10-01 14:11:42','2022-10-01 14:11:42'), + (5,'Recovery Side GmbH',9,'2022-10-01 14:11:54','2022-10-01 14:11:54'), + (6,'Veggies and fruits UG',10,'2022-10-01 14:12:17','2022-10-01 14:12:17'); + +CREATE TABLE `users` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `organization_id` int unsigned DEFAULT NULL, + `first_name` varchar(255) DEFAULT NULL, + `last_name` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `actions` int DEFAULT NULL, + `last_time_logged_in` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `organization_id` (`organization_id`), + CONSTRAINT `users_ibfk_1` FOREIGN KEY (organization_id) REFERENCES organizations(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `users` (`id`, `organization_id`, `first_name`, `last_name`, `email`, `status`, `actions`, `last_time_logged_in`, `created_at`, `updated_at`) +VALUES + (1,1,'Liza','Jensen','liza@example.com','complete',567,'2022-10-01 14:12:52','2022-10-01 14:12:52','2022-10-01 14:12:52'), + (2,1,'John','Meyer','john@example.com','verification_pending',1,'2022-10-01 14:13:41','2022-10-01 14:13:41','2022-10-01 14:13:41'), + (3,1,'Carlo','Miglione','carlo@example.com','complete',11,'2022-10-01 14:13:58','2022-10-01 14:13:58','2022-10-01 14:13:58'), + (4,2,'Rachel','Rocks','rachel@example.com','complete',110,'2022-10-01 14:14:38','2022-10-01 14:14:38','2022-10-01 14:14:38'), + (5,3,'David','Lee','david@example.com','complete',24,'2022-10-01 14:14:56','2022-10-01 14:14:56','2022-10-01 14:14:56'), + (6,3,'Jessica','Lambert','jessica@example.com','new',35,'2022-10-01 14:15:27','2022-10-01 14:15:27','2022-10-01 14:15:27'), + (7,3,'Killian','Chee','killian@example.com','verification_pending',0,'2022-10-01 14:16:08','2022-10-01 14:16:08','2022-10-01 14:16:08'), + (8,4,'Bianca','Mele','bianca@example.com','complete',59,'2022-10-01 14:16:34','2022-10-01 14:16:34','2022-10-01 14:16:34'), + (9,5,'Jorg','Schulze','jorg@example.com','complete',70,'2022-10-01 14:17:35','2022-10-01 14:17:35','2022-10-01 14:17:35'), + (10,6,'Vera','Magnus','vera@example.com','complete',48,'2022-10-01 14:18:11','2022-10-01 14:18:11','2022-10-01 14:18:11'), + (11,6,'Jan','Johansson','jan@example.com','verification_pending',34,'2022-10-01 14:18:42','2022-10-01 14:18:42','2022-10-01 14:18:42'); + +USE `data_monitoring`; + +CREATE TABLE `third_party_scoring_data` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `organization_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, + `provider` varchar(255) DEFAULT NULL, + `score` decimal(5,2) DEFAULT NULL, + `component_1` decimal(5,2) DEFAULT NULL, + `component_2` decimal(5,2) DEFAULT NULL, + `component_3` decimal(5,2) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `third_party_scoring_data` (`id`, `organization_name`, `type`, `provider`, `score`, `component_1`, `component_2`, `component_3`, `created_at`) +VALUES + (1,'Organization 1','company_score','north_data',67.00,50.00,35.00,85.00,'2022-10-01 14:25:20'), + (2,'Organization 2','company_score','schufa',49.00,2.00,NULL,87.00,'2022-10-01 14:25:52'), + (3,'Organization 3','personal_score','scorer',96.00,98.00,91.00,93.00,'2022-10-01 14:26:13'), + (4,'Organization 4','credit_score','crefo',46.00,21.00,22.00,76.00,'2022-10-01 14:26:37'), + (5,'Organization 5','personal_score','scorer',84.00,80.00,71.00,69.00,'2022-10-01 14:26:57'), + (6,'Organization 6','credit_score','crefo',51.00,55.00,62.00,26.00,'2022-10-01 14:27:15'), + (7,'Organization 7','company_score','north_data',NULL,NULL,25.00,42.00,'2022-10-01 14:27:32'); + +CREATE TABLE `units` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `status` varchar(255) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `units` (`id`, `name`, `status`, `created_at`, `updated_at`) +VALUES + (1,'First unit','new','2022-10-01 14:20:54','2022-10-01 14:20:54'), + (2,'Another unit','done','2022-10-01 14:21:12','2022-10-01 14:21:12'), + (3,'Unit three','done','2022-10-01 14:21:21','2022-10-01 14:21:21'), + (4,'And one more ','pending','2022-10-01 14:21:31','2022-10-01 14:21:31'), + (5,'Created recently','new','2022-10-01 14:21:39','2022-10-01 14:21:39'), + (6,'Complete unit','done','2022-10-01 14:21:53','2022-10-01 14:21:53'); + +USE `ecommerce`; + +CREATE TABLE `orders` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `status` varchar(255) DEFAULT NULL, + `organization_id` int unsigned DEFAULT NULL, + `amount` decimal(10,2) DEFAULT NULL, + `currency` varchar(255) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `orders` (`id`, `status`, `organization_id`, `amount`, `currency`, `created_at`, `updated_at`) +VALUES + (1,'dispatched',1,250.00,'USD','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (2,'paid',1,250.00,'USD','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (3,'completed',2,3677.20,'USD','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (4,'assembled',1,21.87,'EUR','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (5,'assembled',4,21.87,'EUR','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (6,'complete',1,341.76,'EUR','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (7,'new',3,2110.76,'USD','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (8,'new',3,127.89,'USD','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (9,'new',4,127.90,'EUR','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (10,'paid',5,344.44,'USD','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (11,'paid',1,1344.44,'USD','2022-10-01 16:01:11','2022-10-01 16:01:11'), + (12,'assembled',2,67.01,'EUR','2022-10-01 16:01:11','2022-10-01 16:01:11'); + +CREATE TABLE `organizations` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `creator_id` int unsigned DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `creator_id` (`creator_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `organizations` (`id`, `name`, `creator_id`, `created_at`, `updated_at`) +VALUES + (1,'Datacom Ltd',1,'2022-10-01 14:11:05','2022-10-01 14:11:05'), + (2,'Delivery moon GmbH',4,'2022-10-01 14:11:20','2022-10-01 14:11:20'), + (3,'Security Cloud Ltd',5,'2022-10-01 14:11:31','2022-10-01 14:11:31'), + (4,'Step One AG',8,'2022-10-01 14:11:42','2022-10-01 14:11:42'), + (5,'Recovery Side GmbH',9,'2022-10-01 14:11:54','2022-10-01 14:11:54'), + (6,'Veggies and fruits UG',10,'2022-10-01 14:12:17','2022-10-01 14:12:17'); + +CREATE TABLE `products` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `num_in_stock` int DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `products` (`id`, `name`, `num_in_stock`) +VALUES + (1,'Pencil',50), + (2,'Book',3), + (3,'Notebook',78), + (4,'Eraser',4); + +CREATE TABLE `users` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `organization_id` int unsigned DEFAULT NULL, + `first_name` varchar(255) DEFAULT NULL, + `last_name` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `actions` int DEFAULT NULL, + `last_time_logged_in` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `organization_id` (`organization_id`), + CONSTRAINT `users_ibfk_1` FOREIGN KEY (organization_id) REFERENCES organizations(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `users` (`id`, `organization_id`, `first_name`, `last_name`, `email`, `status`, `actions`, `last_time_logged_in`, `created_at`, `updated_at`) +VALUES + (1,1,'Liza','Jensen','liza@example.com','complete',567,'2022-10-01 14:12:52','2022-10-01 14:12:52','2022-10-01 14:12:52'), + (2,1,'John','Meyer','john@example.com','verification_pending',1,'2022-10-01 14:13:41','2022-10-01 14:13:41','2022-10-01 14:13:41'), + (3,1,'Carlo','Miglione','carlo@example.com','complete',11,'2022-10-01 14:13:58','2022-10-01 14:13:58','2022-10-01 14:13:58'), + (4,2,'Rachel','Rocks','rachel@example.com','complete',110,'2022-10-01 14:14:38','2022-10-01 14:14:38','2022-10-01 14:14:38'), + (5,3,'David','Lee','david@example.com','complete',24,'2022-10-01 14:14:56','2022-10-01 14:14:56','2022-10-01 14:14:56'), + (6,3,'Jessica','Lambert','jessica@example.com','new',35,'2022-10-01 14:15:27','2022-10-01 14:15:27','2022-10-01 14:15:27'), + (7,3,'Killian','Chee','killian@example.com','verification_pending',0,'2022-10-01 14:16:08','2022-10-01 14:16:08','2022-10-01 14:16:08'), + (8,4,'Bianca','Mele','bianca@example.com','complete',59,'2022-10-01 14:16:34','2022-10-01 14:16:34','2022-10-01 14:16:34'), + (9,5,'Jorg','Schulze','jorg@example.com','complete',70,'2022-10-01 14:17:35','2022-10-01 14:17:35','2022-10-01 14:17:35'), + (10,6,'Vera','Magnus','vera@example.com','complete',48,'2022-10-01 14:18:11','2022-10-01 14:18:11','2022-10-01 14:18:11'), + (11,6,'Jan','Johansson','jan@example.com','verification_pending',34,'2022-10-01 14:18:42','2022-10-01 14:18:42','2022-10-01 14:18:42'); + +USE `finance`; + +CREATE TABLE `customers` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `status` varchar(255) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `customers` (`id`, `name`, `status`, `created_at`, `updated_at`) +VALUES + (1,'Detailed Payments Ltd.','complete','2022-09-30 18:37:25','2022-09-30 18:37:25'), + (2,'Startup Merchant GmbH','verification_pending','2022-09-30 18:37:57','2022-09-30 18:37:57'), + (3,'Delivery space Ltd.','complete','2022-09-30 18:37:25','2022-09-30 18:37:25'), + (4,'Existing stars AG','new','2022-09-30 18:38:37','2022-09-30 18:38:37'), + (5,'Banking owners UG','complete','2022-09-30 18:38:52','2022-09-30 18:38:52'); + +CREATE TABLE `invoices` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `customer_from_id` int unsigned DEFAULT NULL, + `customer_to_id` int unsigned DEFAULT NULL, + `amount` decimal(8,2) DEFAULT NULL, + `currency` varchar(255) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `customer_from_id` (`customer_from_id`), + KEY `customer_to_id` (`customer_to_id`), + CONSTRAINT `invoices_ibfk_1` FOREIGN KEY (customer_from_id) REFERENCES customers(id), + CONSTRAINT `invoices_ibfk_2` FOREIGN KEY (customer_to_id) REFERENCES customers(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `invoices` (`id`, `customer_from_id`, `customer_to_id`, `amount`, `currency`, `created_at`, `updated_at`) +VALUES + (1,1,2,299.76,'EUR','2022-09-30 18:53:35','2022-09-30 18:53:35'), + (2,1,2,11.01,'EUR','2022-09-30 18:57:35','2022-09-30 18:53:35'), + (3,1,2,11.01,'EUR','2022-09-30 18:53:35','2022-09-30 18:53:35'), + (4,3,5,1300.00,'USD','2022-09-30 18:54:26','2022-09-30 18:54:26'), + (5,3,5,1300.00,'USD','2022-09-30 18:54:26','2022-09-30 18:54:26'), + (6,5,3,1504.36,'USD','2022-09-30 18:54:39','2022-09-30 18:54:39'), + (7,4,1,34.89,'EUR','2022-09-30 18:55:10','2022-09-30 18:55:10'), + (8,1,4,564.89,'EUR','2022-09-30 18:55:28','2022-09-30 18:55:28'), + (9,1,4,1567.51,'EUR','2022-09-30 18:55:28','2022-09-30 18:55:28'), + (10,2,1,21.11,'EUR','2022-09-30 18:56:06','2022-09-30 18:56:06'), + (11,3,5,34.35,'USD','2022-09-30 18:56:26','2022-09-30 18:56:26'), + (12,5,3,112.56,'USD','2022-09-30 18:56:44','2022-09-30 18:56:44'); + +CREATE TABLE `bank_accounts` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `iban` varchar(255) DEFAULT NULL, + `status` varchar(255) DEFAULT NULL, + `owner_id` int unsigned DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `owner_id` (`owner_id`), + CONSTRAINT `bank_accounts_ibfk_1` FOREIGN KEY (owner_id) REFERENCES customers(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `bank_accounts` (`id`, `iban`, `status`, `owner_id`, `created_at`, `updated_at`) +VALUES + (1,'NL22ABNA9242086444','verified',1,'2022-09-30 18:39:38','2022-09-30 18:39:38'), + (2,'DE28500105175143257851','pending',2,'2022-09-30 18:39:57','2022-09-30 18:39:57'), + (3,'IT10E0300203280154176113663','verified',3,'2022-09-30 18:40:18','2022-09-30 18:40:18'), + (4,'ES0800758582392111774524','pending',4,'2022-09-30 18:40:36','2022-09-30 18:40:36'), + (5,'SE1693857923159423561388','verified',5,'2022-09-30 18:41:03','2022-09-30 18:41:03'); + +CREATE TABLE `bank_transfers` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `account_from_id` int unsigned DEFAULT NULL, + `account_to_id` int unsigned DEFAULT NULL, + `invoice_id` int unsigned DEFAULT NULL, + `status` varchar(255) DEFAULT NULL, + `amount` decimal(8,2) DEFAULT NULL, + `currency` varchar(255) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `account_from_id` (`account_from_id`), + KEY `account_to_id` (`account_to_id`), + KEY `invoice_id` (`invoice_id`), + CONSTRAINT `bank_transfers_ibfk_1` FOREIGN KEY (account_from_id) REFERENCES customers(id), + CONSTRAINT `bank_transfers_ibfk_2` FOREIGN KEY (account_to_id) REFERENCES customers(id), + CONSTRAINT `bank_transfers_ibfk_3` FOREIGN KEY (invoice_id) REFERENCES invoices(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `bank_transfers` (`id`, `account_from_id`, `account_to_id`, `invoice_id`, `status`, `amount`, `currency`, `created_at`, `updated_at`) +VALUES + (1,1,2,1,'complete',299.76,'EUR','2022-09-30 18:53:35','2022-09-30 18:53:35'), + (2,1,2,2,'complete',11.01,'EUR','2022-09-30 18:57:35','2022-09-30 18:53:35'), + (3,1,2,3,'complete',11.01,'EUR','2022-09-30 18:53:35','2022-09-30 18:53:35'), + (4,3,5,4,'failed',1300.00,'USD','2022-09-30 18:54:26','2022-09-30 18:54:26'), + (5,3,5,5,'failed',1300.00,'USD','2022-09-30 18:54:26','2022-09-30 18:54:26'), + (6,5,3,6,'pending',1504.36,'USD','2022-09-30 18:54:39','2022-09-30 18:54:39'), + (7,4,1,7,'complete',34.89,'EUR','2022-09-30 18:55:10','2022-09-30 18:55:10'), + (8,1,4,8,'pending',564.89,'EUR','2022-09-30 18:55:28','2022-09-30 18:55:28'), + (9,1,4,9,'pending',1567.51,'EUR','2022-09-30 18:55:28','2022-09-30 18:55:28'), + (10,2,1,10,'complete',21.11,'EUR','2022-09-30 18:56:06','2022-09-30 18:56:06'), + (11,3,5,11,'complete',34.35,'USD','2022-09-30 18:56:26','2022-09-30 18:56:26'), + (12,5,3,12,'pending',112.56,'USD','2022-09-30 18:56:44','2022-09-30 18:56:44'); + +USE `hr`; + +CREATE TABLE `hires` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `first_name` varchar(255) DEFAULT NULL, + `last_name` varchar(255) DEFAULT NULL, + `department` varchar(255) DEFAULT NULL, + `position` varchar(255) DEFAULT NULL, + `hired_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO `hires` (`id`, `first_name`, `last_name`, `department`, `position`, `hired_at`) +VALUES + (1,'Emily','Hughes','Engineering','Senior Software Engineer','2023-01-13 13:43:42'), + (2,'George','Dawson','Engineering','QA','2023-01-13 13:43:54'), + (3,'Maria','Rodrigues','Marketing','PR specialist','2023-01-13 13:44:18'), + (4,'Patrick','Mueller','Sales','Account manager','2023-01-13 13:44:32'), + (5,'Zoe','Walter','Sales','Account manager','2023-01-13 13:44:47'), + (6,'Rachel','Queen','Product','Senior Product Manager','2023-01-13 13:45:06'); diff --git a/docker-compose.yml b/docker-compose.yml index 720574c..b711e35 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,8 +21,8 @@ services: - ./database/data:/var/lib/mysql container_name: ylem_database healthcheck: - interval: 5s - retries: 5 + interval: 10s + retries: 50 test: [ "CMD", @@ -31,7 +31,7 @@ services: "--connect", "--innodb_initialized" ] - timeout: 5s + timeout: 15s ylem_session_storage: env_file: @@ -53,6 +53,42 @@ services: depends_on: ylem_database: condition: service_healthy + # Comment this one out if you use your own Apache Kafka cluster + ylem_kafka_topic_creator: + condition: service_completed_successfully + + # Comment this one out if you use your own Apache Kafka cluster + ylem_kafka_broker: + image: confluentinc/confluent-local:7.7.1 + container_name: ylem_kafka_broker + networks: + - ylem_network + environment: + KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:9092,PLAINTEXT_YLEM://ylem_kafka_broker:39092" + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,PLAINTEXT_YLEM:PLAINTEXT" + KAFKA_LISTENERS: "PLAINTEXT://localhost:29092,CONTROLLER://localhost:29093,PLAINTEXT_HOST://0.0.0.0:9092,PLAINTEXT_YLEM://ylem_kafka_broker:39092" + ports: + - "39092:39092" + volumes: + - ./database/kafka_data:/var/lib/kafka/data + healthcheck: + test: /bin/kafka-topics --list --bootstrap-server localhost:9092 || exit 1 + interval: 1s + timeout: 60s + retries: 60 + ylem_kafka_topic_creator: + image: confluentinc/confluent-local:7.7.1 + container_name: ylem_kafka_topic_creator + networks: + - ylem_network + depends_on: + ylem_kafka_broker: + condition: service_healthy + command: "bash -c 'kafka-topics --create --if-not-exists --bootstrap-server ylem_kafka_broker:39092 --partitions 1 --replication-factor 1 --topic task_runs && \ + kafka-topics --create --if-not-exists --bootstrap-server ylem_kafka_broker:39092 --partitions 1 --replication-factor 1 --topic task_runs_load_balanced && \ + kafka-topics --create --if-not-exists --bootstrap-server ylem_kafka_broker:39092 --partitions 1 --replication-factor 1 --topic task_run_results && \ + kafka-topics --create --if-not-exists --bootstrap-server ylem_kafka_broker:39092 --partitions 1 --replication-factor 1 --topic query_task_run_results && \ + kafka-topics --create --if-not-exists --bootstrap-server ylem_kafka_broker:39092 --partitions 1 --replication-factor 1 --topic notification_task_run_results'" networks: ylem_network: diff --git a/ui/src/components/pipelines/pipeline.component.js b/ui/src/components/pipelines/pipeline.component.js index 98580e9..257324e 100644 --- a/ui/src/components/pipelines/pipeline.component.js +++ b/ui/src/components/pipelines/pipeline.component.js @@ -171,12 +171,13 @@ class Pipeline extends Component { this.handleRunningOutput = this.handleRunningOutput.bind(this); this.cleanOutput = this.cleanOutput.bind(this); this.changeRunningClass = this.changeRunningClass.bind(this); + this.cleanUpElementsLayout = this.cleanUpElementsLayout.bind(this); this.reactFlowWrapper = React.createRef(); this.state = { organization: localStorage.getItem('organization') ? JSON.parse(localStorage.getItem('organization')) : [], - elements: JSON.parse(this.props.elements), + elements: this.cleanUpElementsLayout(JSON.parse(this.props.elements)), name: this.props.newTitle, preview: "", item: this.props.item, @@ -199,6 +200,16 @@ class Pipeline extends Component { }; } + cleanUpElementsLayout(elements) { + for(var i = 0; i < elements.length; i++){ + if (elements[i].type === "run_workflow") { + elements[i].type = TASK_TYPE_RUN_PIPELINE + } + } + + return elements + } + componentDidMount() { this.mounted = true; if (this.props.item !== null) {