Comprehensive guides and references for the OpenFrame platform
The Api Lib Dto And Mapping module provides the shared Data Transfer Objects (DTOs), filter models, pagination inputs, and entity mappers used across the OpenFrame platform.
It acts as the contract layer between:
By centralizing DTOs and mapping logic, this module ensures:
The Api Lib Dto And Mapping module sits between the API service layer and the data/domain layers.
flowchart TD
Client["Client Applications"] --> Rest["REST Controllers"]
Client --> GraphQL["GraphQL Data Fetchers"]
Rest --> Dto["Api Lib Dto And Mapping"]
GraphQL --> Dto
Dto --> Services["Domain Services"]
Services --> Repos["Mongo Repositories"]
Repos --> Docs["Mongo Documents"]
This module does not:
It strictly defines data contracts and mapping logic.
The module can be logically grouped into the following areas:
public class CountedGenericQueryResult<T> extends GenericQueryResult<T> {
private int filteredCount;
}
Extends a generic query result with an additional filteredCount field.
When implementing filtered list endpoints (devices, logs, tools, etc.), APIs often need to return:
filteredCount enables the UI to:
This model is used across multiple resource types to enforce consistency.
These DTOs define the structure of audit logs and log filtering behavior.
Represents a lightweight log entry.
Key fields:
toolEventIdeventTypetoolTypeseverityuserIddeviceIdorganizationIdtimestampUsed for:
Extends the event concept with full message content:
messagedetailsUsed when retrieving a specific log entry for inspection.
Defines input criteria when querying logs:
startDate, endDate)Represents available filter values returned to the client:
Represents a dropdown-ready organization option:
idnameflowchart LR
Client["Client"] --> FilterInput["LogFilterOptions"]
FilterInput --> Service["Log Service"]
Service --> Repo["Log Repository"]
Repo --> Service
Service --> Result["LogEvent or LogDetails"]
This separation ensures:
The device DTO layer supports complex filtering and UI-driven dashboards.
Represents raw filter input values such as:
These correspond closely to underlying persistence fields.
Represents structured filter metadata returned to clients.
Includes:
DeviceFilterOption listsTagFilterOption listsfilteredCountEach filter option contains:
valuelabelcountThis enables UI components to show:
Specifically supports tag-based filtering with count metadata.
Defines filtering criteria for events:
userIdseventTypesstartDateendDateRepresents simplified filter sets:
userIdseventTypesThese are used in both REST and GraphQL layers to standardize event querying.
This is the most structurally rich area of the module.
Shared response DTO used by:
Key properties include:
createdAt, updatedAt)This ensures one consistent organization representation across the platform.
Wraps a list of organization entities for list-style responses.
Internal filtering DTO for organization-specific queries:
The OrganizationMapper is a Spring component responsible for translating between:
flowchart TD
CreateReq["CreateOrganizationRequest"] --> Mapper["OrganizationMapper"]
Mapper --> Entity["Organization Document"]
UpdateReq["UpdateOrganizationRequest"] --> Mapper
Entity --> Mapper
Mapper --> Response["OrganizationResponse"]
The mapper handles nested conversions:
This isolates entity structure from API representation.
Defines filtering criteria for tools:
Represents aggregated filter metadata:
Wraps a list of integrated tools for response purposes.
Used when returning tool catalogs or integration lists.
Defines cursor-based pagination input.
Fields:
limit (1 to 100, validated)cursorUsed across:
Many filter DTOs include:
This reflects a deliberate design for:
The same DTOs are reused by:
This guarantees consistent contracts across the platform.
The OrganizationMapper demonstrates best practices:
The Api Lib Dto And Mapping module is the canonical contract layer for the OpenFrame backend.
It provides:
Without this module:
By centralizing these responsibilities, the platform maintains clean architectural boundaries and consistent data models across REST, GraphQL, and external APIs.