Overview
Implement dynamic API support for Business Entities using the JSON field_mapping configuration generated by the Foundation Business Entity Builder.
The API should dynamically resolve the business entity definition, traverse configured relationships, load meta fields, and return nested data structures without hardcoded entity-specific logic.
Scope
List API
Add support for:
GET /api/business-entity/list/{business_entity_name}
Requirements:
- Resolve Business Entity by name, slug, or UID
- Parse field_mapping JSON
- Load primary entity records
- Load configured meta fields
- Traverse relationship definitions from JSON
- Support nested relationships
- Support association/pivot entities through JSON-defined relationships
- Return paginated results
Show API
Add support for:
GET /api/business-entity/show/{business_entity_name}/{data_uid}
Requirements:
- Resolve a single primary record by uid/id
- Load configured meta fields
- Load nested related entities
- Reuse the same relationship traversal logic used by List API
- Return a single business entity record
Technical Notes
- Relationship resolution must be JSON-driven
- No hardcoded entity-specific logic
- No automatic relationship generation
- No automatic through_conditions generation
- Business Entity execution must rely entirely on field_mapping.relationships
Expected Outcome
Business Entities can be exposed through dynamic APIs and return nested responses based entirely on the Business Entity JSON configuration.
Files changed:
routes/api.php
Files added:
src/Http/Controllers/DynamicBusinessEntityController.php
Overview
Implement dynamic API support for Business Entities using the JSON field_mapping configuration generated by the Foundation Business Entity Builder.
The API should dynamically resolve the business entity definition, traverse configured relationships, load meta fields, and return nested data structures without hardcoded entity-specific logic.
Scope
List API
Add support for:
GET /api/business-entity/list/{business_entity_name}
Requirements:
Show API
Add support for:
GET /api/business-entity/show/{business_entity_name}/{data_uid}
Requirements:
Technical Notes
Expected Outcome
Business Entities can be exposed through dynamic APIs and return nested responses based entirely on the Business Entity JSON configuration.
Files changed:
routes/api.php
Files added:
src/Http/Controllers/DynamicBusinessEntityController.php