Interface ModuleEditHandler<T>

Type Parameters:
T - module type handled by this service

public interface ModuleEditHandler<T>
Application service contract for edit form rendering, update handling, and delete handling.

Framework boundary: SimplyPages invokes these hooks but does not decide persistence model, approval workflow, or authorization policy.

  • Method Details

    • renderEditForm

      Component renderEditForm(String moduleId)
      Renders edit UI for a module id.
      Parameters:
      moduleId - the unique identifier of the module to edit
      Returns:
      Component representing the edit form
    • handleUpdate

      Component handleUpdate(String moduleId, Map<String,String> editData, EditMode editMode)
      Handles submitted edit payload.

      Implementations typically branch on editMode to either apply immediately or enqueue approval. Returned component is rendered back to caller/HTMX target.

      Parameters:
      moduleId - the unique identifier of the module being updated
      editData - the submitted edit data (form field name → value)
      editMode - the edit mode (USER_EDIT or OWNER_EDIT)
      Returns:
      Updated module (OWNER_EDIT) or approval message (USER_EDIT)
    • handleDelete

      Component handleDelete(String moduleId, EditMode editMode)
      Handles delete request for a module id.

      Implementations may apply immediate deletion or return approval-state feedback based on editMode.

      Parameters:
      moduleId - the unique identifier of the module to delete
      editMode - the edit mode (USER_EDIT or OWNER_EDIT)
      Returns:
      Empty component (OWNER_EDIT) or confirmation message (USER_EDIT)