...
We don't want to create a separate dummy capability set table since we will always create capability sets, regardless of whether they include all capabilities, only a partial set, or are empty.
If a capability does not exist, we will create a record in the dummy capability ID mapping table to resolve the relationship in the future.
Each time we create a new capability, we check the dummy capability ID mapping table to resolve any missing relations and run the update capability set method, which will create Keycloak resources and other necessary components.
The process of updating the capability set should be event-driven and need to use Kafka events instead of Spring events. This approach will help maintain data consistency in case the service crashes. (No need to an additional Kafka event does not for version one and requires additional design for the future to avoid issues that we faced in the past)
Delete the event and record in the dummy mapping table only when the capability set is fully updated
...