ICustomerManagementGET Apex Interface
The ICustomerManagementGET Apex interface provides extensibility for TMF629 GET operations through Apex pre- and post-hooks and GraphQL query customization. Implementations can validate incoming requests, modify query structures, and refine the response to support business-specific retrieval rules while maintaining TMF-compliant behavior.
This interface supports the following hooks.
The configureDefaultValidations hook is not used for the Customer Management API. If implemented, the method may be invoked, but its return values are ignored.
This table lists common use cases and the hooks required for the GET operation.
| Use Case | Hook(s) | Description | Example Scenarios | Benefit |
|---|---|---|---|---|
| Role-Based Data Filtering | applyCustomValidations, handlePostOperation | Enforces access rules by validating user permissions before execution and filtering sensitive data after retrieval. Supports role-based visibility at field and record levels. | • Restrict access to VIP or high-value customer profiles• Hide sensitive fields (e.g., credit score) for frontline agents• Enforce region-based access boundaries | Strengthens data governance and ensures secure, compliant access to customer data |
| Custom Field Enrichment | handlePostOperation | Adds calculated or derived fields to API responses without changing the base TMF schema, allowing customers to extend or modify as needed. Enables enrichment using internal business rules or external systems. | • Add customer health score• Flag “preferred customer” status• Include aggregated financial or usage insights | Delivers richer, more contextual responses while preserving TMF schema integrity |
| Dynamic Query Customization | customiseGraphQLQuery | Modifies GraphQL queries dynamically based on client or request context by adding fields, filters, or transformations. | • Mobile app requests only essential fields• Portal requires additional entitlement or hierarchy fields• Apply filters automatically for partner channels | Supports diverse client requirements using a single API and reduces need for API versioning |
| Business Rule Validation | applyCustomValidations | Applies business and eligibility rules before processing requests, stopping invalid operations early in the lifecycle. | • Ensure customer is “active” before retrieving services• Reject unauthorized or unverified channel requests• Enforce lifecycle or dependency checks | Provides strong business consistency and reduces downstream errors by blocking invalid requests early |
This hook transforms the request context before processing any operation. It is invoked early in the request lifecycle, allowing implementers to adjust the context for subsequent extensibility hooks.
Map<String, Object> transformRequest(Map<String, Object> context)
This hook validates custom business logic before retrieving customer record. If validation fails, rejects the request and returns an error response.
The handler processes return values as follows.
Success:
- Return a map with validationStatus set to "pass" (case-insensitive).
- The API request continues normally.
- Other fields in the map are logged but not used.
Failure:
- Return a map with validationStatus set to "fail" (case-insensitive).
- The API request is terminated immediately.
- Raise a ValidationException containing
- message: value from validationMessage key (or "Validation failed" by default)
- details: value from validationDetails key (optional)
- The client receives an HTTP 400 error response.
Map<String, Object> applyCustomValidations(Map<String, Object> context)
This hook modifies the GraphQL query before execution to add fields, filters, or transformations. Returns a map with a spec key containing a list of QueryTransformationNode objects.
Map<String, Object> customiseGraphQLQuery(Map<String, Object> graphQLAsMap, Map<String, Object> context)
This hook post-processes and transforms the API response after data retrieval.
Map<String, Object> handlePostOperation(Map<String, Object> graphQLQueryResultAsMap, Map<String, Object> constructedTMFResponse, Map<String, Object> context)
Here's a complete sample Apex implementation using all supported hooks.
Query transformations provide the ability to enhance GraphQL queries by adding fields, applying filters, or modifying the sort order, while preserving the original query definition.
For the Customer Management API, use the uiapi.query.Account path to reference the primary Account field.
Original Query (GraphQL):
Transformation Instructions (JSON):
Result (GraphQL):
Original Query (GraphQL):
Transformation Instructions (JSON):
Result (GraphQL):
Original Query (GraphQL):
Transformation Instructions (JSON):
Result (GraphQL):
Original Query (GraphQL):
Transformation Instructions (JSON):
Result (GraphQL):