✨ integrates Dynamic ENUM Metadata within Rules #3
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/allow-enums-in-rules"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary:
This commit revolutionizes our approach to handling ENUM metadata for
rule input structures by embedding this metadata directly within each
rule's definition. By leveraging the
EnumProvider
interface andutilizing reflection, we've created a system where rules self-describe
their ENUM fields, enhancing the API's flexibility and maintainability.
The
GetRuleStruct
API endpoint is now capable of dynamically generatingresponses that include both the input structure and ENUM options, directly
derived from the rule definitions themselves.
Key Changes:
Introduced
EnumProvider
Interface:Allows rule structs to define their own ENUM options, centralizing this
information within the rule implementations.
Enhanced Rule Descriptors:
Rule descriptors are streamlined to focus on factory methods and input
struct types, with ENUM metadata being provided by the rules themselves
through the
EnumProvider
interface.Dynamic ENUM Metadata Retrieval:
The
GetRuleStruct
function dynamically extracts ENUM metadata fromrules that implement the
EnumProvider
, ensuring the API responseincludes relevant ENUM options for frontend UI generation.
API Response Enhancement:
Adjusted the API to provide a response that includes the rule's input
structure, possible ENUM values, and the rule instance representation,
all derived dynamically to support extensible and maintainable rule
definitions.
Closes: #2
WIP: ✨ integrates Dynamic ENUM Metadata within Rulesto ✨ integrates Dynamic ENUM Metadata within Rules