Skip to content

REST API: support creating replies and a full reply hierarchy #28

Description

@iTerminate

While adding a reply-tree view to bely-cli's TUI, found two gaps in the REST API around log entry replies. The DB already supports both (Log.parentLog / Log.childLogList is an arbitrary-depth tree), and the JSF portal already creates replies via ItemDomainLogbookController.prepareAddLogReply, but this isn't reachable over /api.

  • Support creating a reply via the API. PUT /api/Logbook/AddUpdateLogEntry (LogbookRoute.addUpdateLogEntry) can only create top-level entries — the LogEntry DTO has no parent field. Add a parentLogId field to rest/entities/LogEntry.java, and branch in addUpdateLogEntry (when logId is null and parentLogId is set) to build the entry the same way ItemDomainLogbookController.prepareAddLogReply does: LogUtility.createLogEntry(user) + setParentLog(parentLog), not ItemDomainLogbookControllerUtility.prepareAddLog (which would wire it into the document's own item-element list and make it a top-level entry instead of a reply).
  • Support the full reply hierarchy, not just one level. GET /api/Logbook/LogEntries/{logDocumentId}?loadReplies=true only returns direct replies — LogEntry.java's constructor hardcodes false for loadReplies in the recursive call that builds logReplies, so replies-of-replies are silently dropped even though the DB has no such limit.
  • Regenerate bely-api (tools/developer_tools/python-client) once both land, so clients (including bely-cli) can pick it up.

Prerequisite for bely-cli's reply-tree viewer to support composing a reply and to correctly render nested threads deeper than one level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions