Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bde7650
feat(core): update Entity Dto contract, mapper and controllers tests
brandPittCode Jul 8, 2026
5de8436
feat(core): update Entity Dto contract, mapper and controllers tests
brandPittCode Jul 8, 2026
c7efad0
feat(core): update Entity Dto contract, mapper and controllers tests
brandPittCode Jul 8, 2026
6be5966
feat(core): update Entity Dto contract, mapper and controllers tests
brandPittCode Jul 8, 2026
a104d92
feat(core): update Entity Dto contract, mapper and controllers tests
brandPittCode Jul 9, 2026
de07bd3
feat(core): update Entity Dto contract, mapper and controllers tests
brandPittCode Jul 9, 2026
a14ee99
feat(core): update Entity Dto contract, mapper and controllers tests
brandPittCode Jul 9, 2026
61ee074
feat(core): update Entity Dto contract, mapper and controllers tests
brandPittCode Jul 13, 2026
3cfe929
feat(core): update Entity Dto contract, mapper and controllers tests
brandPittCode Jul 13, 2026
2632230
feat(core): update Entity output contract.
brandPittCode Jul 16, 2026
646e269
feat(core): update Entity output contract.
brandPittCode Jul 16, 2026
d4dad57
feat(core): update Entity output contract.
brandPittCode Jul 16, 2026
87ad843
feat(core): update Entity output contract
brandPittCode Jul 16, 2026
7bdbefc
feat(core): update Entity output contract
brandPittCode Jul 16, 2026
99a8a26
feat(core): update Entity output contract
brandPittCode Jul 16, 2026
9dde05e
feat(core): update Entity output contract
brandPittCode Jul 16, 2026
179d70b
feat(core): update Entity output contract
brandPittCode Jul 16, 2026
be64d9d
fet(core): update entity get endpoint tu use graph service
brandPittCode Jul 17, 2026
f52aae3
Merge branch 'main' into feat/update-entity-output-for-having-relatio…
brandPittCode Jul 20, 2026
3388155
fet(core): update entity get endpoint tu use graph service
brandPittCode Jul 20, 2026
0e4607b
fet(core): update entity get endpoint tu use graph service
brandPittCode Jul 20, 2026
f7dcfc8
Merge branch 'feat/add-relation-depth-to-get-entity-endpoint' into fe…
brandPittCode Jul 21, 2026
04310e2
fet(core): update entity get endpoint tu use graph service
brandPittCode Jul 21, 2026
c4353e5
Merge branch 'main' into feat/update-entity-output-for-having-relatio…
brandPittCode Jul 21, 2026
1c7def8
fet(core): update entity get endpoint tu use graph service
brandPittCode Jul 21, 2026
74496d5
Merge branch 'feat/update-entity-output-for-having-relations-grouped'…
brandPittCode Jul 21, 2026
3d5db3e
fet(core): update entity get endpoint tu use graph service
brandPittCode Jul 21, 2026
06c4c3f
fet(core): update entity get endpoint tu use graph service
brandPittCode Jul 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 21 additions & 50 deletions docs/src/concepts/entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ Here's an entity instantiated from the `web-service` template:
"name": "Web API 1"
}
]
},
"relations_as_target": {}
}
}
```

Expand Down Expand Up @@ -220,6 +219,25 @@ When creating an entity, you specify relations as an array of objects, each with
}
```

### One-to-Many Relations (`to_many: true`)

When multiple related entities are allowed, list several identifiers:

```json
{
"relations": [
{
"name": "components",
"target_entity_identifiers": [
"frontend",
"backend",
"database"
]
}
]
}
```

### Relations in Responses

In API responses, relations are grouped by name and include summary information about each target entity:
Expand All @@ -237,56 +255,10 @@ In API responses, relations are grouped by name and include summary information
"name": "Web API 2"
}
]
},
"relations_as_target": {
"depends-on": [
{
"identifier": "frontend-app",
"name": "Frontend App"
}
]
}
}
```

The `relations_as_target` field shows reverse relationships—other entities that reference this entity.

### One-to-One Relations (`to_many: false`)

For consistency, even single relations are represented as arrays:

```json
{
"relations": [
{
"name": "owned_by",
"target_entity_identifiers": [
"platform-team"
]
}
]
}
```

### One-to-Many Relations (`to_many: true`)

When multiple related entities are allowed, list several identifiers:

```json
{
"relations": [
{
"name": "components",
"target_entity_identifiers": [
"frontend",
"backend",
"database"
]
}
]
}
```

---

## Retrieving Entities
Expand Down Expand Up @@ -386,8 +358,7 @@ curl -X PUT http://localhost:8084/api/v1/entities/web-service/my-web-service \
"protocol": "HTTP",
"programmingLanguage": "JAVA"
},
"relations": {},
"relations_as_target": {}
"relations": {}
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/concepts/entity-filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ relation.database.name:prod

#### Reverse Relation Filters

Use `relations_as_target.<name>.<property>` to find entities that _appear as targets_ in a relation of type `<name>`. The `<property>` must be `identifier` or `name` and refers to the **source** entity in that relation.
Use `relations_as_target.<name>.<property>` to find entities that have inbound relation of type `<name>`. The `<property>` must be `identifier` or `name` and refers to the **source** entity in that relation.

```text
relations_as_target.owned_by.name:platform-team
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/// - Dependency impact analysis before entity deletion
/// - Bidirectional relationship navigation
/// - Audit trails for relationship changes
/// - Template-aware relation summaries for unified API responses
public record RelationAsTargetSummary(String targetEntityIdentifier, String relationName,
String sourceEntityIdentifier, String sourceEntityName) {
String sourceEntityIdentifier, String sourceEntityName, String sourceTemplateIdentifier) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering sourceTemplateIdentifier is never used by the domain, isn't more an infra concern ? And should only be for dto and api responses

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually at the end RelationAsTargetSummary object is the metadata for an entity. (identifier, name, template identifier) so it is stil a domain concern. I'l will check for maybe change the name. Or manage this in another way.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still used by the mapper for the search. I propose to treat the mapper update for the search in another pr.

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.decathlon.idp_core.domain.model.entity_graph;

/// Internal flow direction states used during graph traversal.
///
/// Maps to relationship directions (outbound vs inbound) during BFS propagation.
/// This enum is used internally by [EntityGraphHelper] to track traversal flow
/// and should not be exposed in public APIs.
public enum FlowDirection {
/// Follow outbound relationships only (downstream dependencies)
OUTBOUND,
/// Follow inbound relationships only (upstream dependents)
INBOUND,
/// Follow both outbound and inbound relationships
ANY
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.decathlon.idp_core.domain.port;

import java.util.Collection;
import java.util.Map;
import java.util.UUID;

Expand Down Expand Up @@ -50,7 +51,7 @@ public interface EntityGraphRepositoryPort {
/// @return an immutable map of all discovered entities keyed by their UUID,
/// including the root entity. Returns an empty map if the root entity
/// does not exist.
Map<UUID, Entity> findEntityGraph(UUID entityId, int depth, boolean includeProperties,
Map<UUID, Entity> findEntityGraph(Collection<UUID> rootIds, int depth, boolean includeProperties,
EntityGraphTraversalMode mode);

}
Loading
Loading