Skip to content
Draft
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,27 @@ public class TagAssignment implements TenantScoped {
@Id

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🦩 🟠 TagAssignment.entityType/entityId relationship undocumented despite non-obvious polymorphic semantics

Added Javadoc comments in the TagAssignment class body above the entityId field (documenting its polymorphic relationship to entityType), above the entityType field (documenting its role as discriminator for entityId), and above the taggedBy field (documenting its meaning). No behavioral or structural code changes were made, only comments inserted, preserving existing formatting/style.

🤖 Prompt for AI agents
In openframe-data-mongo-common/src/main/java/com/openframe/data/document/tag/TagAssignment.java around line 22, review and complete this code-review fix: TagAssignment.entityType/entityId relationship undocumented despite non-obvious polymorphic semantics.
What the draft fix changed: Added Javadoc comments in the `TagAssignment` class body above the `entityId` field (documenting its polymorphic relationship to `entityType`), above the `entityType` field (documenting its role as discriminator for `entityId`), and above the `taggedBy` field (documenting its meaning). No behavioral or structural code changes were made, only comments inserted, preserving existing formatting/style.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟡 70 medium — react 👍/👎 to teach the reviewer

private String id;
private String tenantId;
/**
* Identifier of the tagged entity. The type of entity this id refers to
* (e.g., a device, a script, etc.) is determined by the sibling
* {@link #entityType} field.
*/
private String entityId;
private String tagId;
/**
* Discriminator for {@link #entityId}, indicating which kind of entity
* (device, script, etc.) the id refers to.
*/
private TagEntityType entityType;
/**
* Per-device values for the tag key (e.g., ["site1", "site2"] for key "site").
* Empty list for simple label tags with no values.
*/
private List<String> values;
private Instant taggedAt;
/**
* Identifier of the user or system that created this tag assignment.
*/
private String taggedBy;
}