forked from finos/waltz
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request finos#407: Bulk uploader for entity relationships
Merge in WALTZ/waltz from WALTZ/waltz-sj:db-feature/CTCTOWALTZ-3403-bulk-uploader-for-entity-relationships to db-feature/waltz-7171-bulk-uploader-for-entity-relationships * commit '0fd9aad736e2d47bc61f6fe133fd09ea33997c1e': remove comment cleanup add comment code cleanup code cleanup add / update - 6 totlal tests + minor indentaion change in ui component code cleanup indentation changes remove dummy response add: tests; change: indentation; wip: tests add: test items; update: test UI component for bulk relationships upload add: bulk upload relationship service and endpoint add: Item parser for relationship items add: models for bulk relationship upload add: get entity relationships by relationship kind / code add: get relationship kind by id
- Loading branch information
Showing
22 changed files
with
1,517 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
506 changes: 506 additions & 0 deletions
506
...ava/org/finos/waltz/integration_test/inmem/service/BulkUploadRelationshipServiceTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
.../finos/waltz/model/bulk_upload/entity_relationship/BulkUploadRelationshipApplyResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.finos.waltz.model.bulk_upload.entity_relationship; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableBulkUploadRelationshipApplyResult.class) | ||
public interface BulkUploadRelationshipApplyResult { | ||
|
||
Long recordsAdded(); | ||
|
||
Long recordsUpdated(); | ||
|
||
Long skippedRows(); | ||
} |
25 changes: 25 additions & 0 deletions
25
...ava/org/finos/waltz/model/bulk_upload/entity_relationship/BulkUploadRelationshipItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.finos.waltz.model.bulk_upload.entity_relationship; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAlias; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import org.finos.waltz.model.Nullable; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonDeserialize(as = ImmutableBulkUploadRelationshipItem.class) | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonFormat(with = JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_PROPERTIES) | ||
public interface BulkUploadRelationshipItem { | ||
|
||
@JsonAlias({"source_external_id", "source_id"}) | ||
String sourceExternalId(); | ||
|
||
@JsonAlias({"target_external_id", "target_id"}) | ||
String targetExternalId(); | ||
|
||
@Nullable | ||
String description(); | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
...finos/waltz/model/bulk_upload/entity_relationship/BulkUploadRelationshipParsedResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package org.finos.waltz.model.bulk_upload.entity_relationship; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import org.finos.waltz.model.Nullable; | ||
import org.immutables.value.Value; | ||
|
||
import java.util.List; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableBulkUploadRelationshipParsedResult.class) | ||
public interface BulkUploadRelationshipParsedResult { | ||
|
||
@Value.Immutable | ||
interface BulkUploadRelationshipParseError { | ||
String message(); | ||
|
||
@Nullable | ||
Integer line(); | ||
|
||
@Nullable | ||
Integer column(); | ||
} | ||
|
||
String input(); | ||
|
||
List<BulkUploadRelationshipItem> parsedItems(); | ||
|
||
@Nullable | ||
BulkUploadRelationshipParseError error(); | ||
|
||
static BulkUploadRelationshipParsedResult mkResult(List<BulkUploadRelationshipItem> items, | ||
String input) { | ||
if(items.isEmpty()) { | ||
return ImmutableBulkUploadRelationshipParsedResult | ||
.builder() | ||
.input(input) | ||
.error(ImmutableBulkUploadRelationshipParseError | ||
.builder() | ||
.message("Cannot parse input.") | ||
.build()) | ||
.build(); | ||
} | ||
|
||
return ImmutableBulkUploadRelationshipParsedResult | ||
.builder() | ||
.parsedItems(items) | ||
.input(input) | ||
.build(); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...inos/waltz/model/bulk_upload/entity_relationship/BulkUploadRelationshipValidatedItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.finos.waltz.model.bulk_upload.entity_relationship; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import org.finos.waltz.model.EntityReference; | ||
import org.finos.waltz.model.Nullable; | ||
import org.immutables.value.Value; | ||
|
||
import java.util.Set; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableBulkUploadRelationshipValidatedItem.class) | ||
public interface BulkUploadRelationshipValidatedItem { | ||
BulkUploadRelationshipItem parsedItem(); | ||
|
||
@Nullable | ||
EntityReference sourceEntityRef(); | ||
|
||
@Nullable | ||
EntityReference targetEntityRef(); | ||
|
||
@Nullable | ||
String description(); | ||
|
||
@Nullable | ||
Set<ValidationError> error(); | ||
|
||
UploadOperation uploadOperation(); | ||
} |
16 changes: 16 additions & 0 deletions
16
...s/waltz/model/bulk_upload/entity_relationship/BulkUploadRelationshipValidationResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.finos.waltz.model.bulk_upload.entity_relationship; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import org.finos.waltz.model.Nullable; | ||
import org.immutables.value.Value; | ||
|
||
import java.util.List; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutableBulkUploadRelationshipValidationResult.class) | ||
public interface BulkUploadRelationshipValidationResult { | ||
List<BulkUploadRelationshipValidatedItem> validatedItems(); | ||
|
||
@Nullable | ||
BulkUploadRelationshipParsedResult.BulkUploadRelationshipParseError parseError(); | ||
} |
7 changes: 7 additions & 0 deletions
7
.../src/main/java/org/finos/waltz/model/bulk_upload/entity_relationship/UploadOperation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.finos.waltz.model.bulk_upload.entity_relationship; | ||
|
||
public enum UploadOperation { | ||
ADD, | ||
UPDATE, | ||
NONE | ||
} |
9 changes: 9 additions & 0 deletions
9
.../src/main/java/org/finos/waltz/model/bulk_upload/entity_relationship/ValidationError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.finos.waltz.model.bulk_upload.entity_relationship; | ||
|
||
public enum ValidationError { | ||
SOURCE_INVALID, | ||
SOURCE_NOT_FOUND, | ||
TARGET_INVALID, | ||
TARGET_NOT_FOUND | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.