Draft
Conversation
Adds `errorResponse` extension functions to `Message` for simplified error handling in Vert.x event bus. This allows sending standardized error responses with failure codes and messages.
Adds website and store-view creation via event bus. Replaces old createScope method. Uses `createScopes.kt` for new functions. Complexity is medium.
The comment indicates a need for stricter editScope functions and deprecation of the global one.
Replaces hardcoded string "scopes" with ScopeJdbcVerticle.CACHE_ADDRESS to improve maintainability and reduce potential errors.
Refactors scope tests to use JsonObject. The Scope data class is deprecated.
Adds ScopeLevel enum with GLOBAL, WEBSITE, and STORE_VIEW values.
Replaces hardcoded string "ScopeCodec" with the class reference to get delivery options. This ensures type safety and avoids potential errors due to typos or inconsistencies.
Adds the Attributes abstract class to define attribute handling in exDock. This class serves as the foundation for different types of attributes, providing methods for getting, setting, and clearing attribute values, as well as type checking. It also defines abstract methods for attribute creation, deletion and clearing all attributes.
Removes unused imports and adds missing ones. This improves code readability and ensures necessary dependencies are available.
Refactors scope handling logic and updates event bus consumers for scope management. Updates `getScopes.kt` to use cached scopes and modifies `ScopeJdbcVerticle.kt` to align with changes in scope handling and adds create website/storeview and edit/delete scope functionality.
Fixes incorrect variable name in error handling within ScopeJdbcVerticle, changing 'res' to 'err'.
Removes unused editScope function and imports. Improves deleteScope function's query execution.
This commit introduces in-memory caching for scopes to improve performance. The changes include: - Added a `cachedScopes` variable to store scopes in memory. - Updated `createScopes.kt`, `getScopes.kt`, and `ScopeJdbcVerticle.kt` to utilize and update the cache. - Refactored `getScopes.kt` to initially load all scopes into the cache. - Added new file `scopes.kt` to contain cachedScopes variable.
…e getAttributeValue functions Refactors attribute retrieval logic for efficiency. Uses cached scopes and Future.all for concurrent data fetching from different scope levels (global, website, scope). Fixes scoping and data merging.
…ctions Refactor `getAttributeValue` to retrieve data by scope, allowing for global, website, and scope-specific data.
The getScopedData and getScopedDataSingle functions were changed from private to internal, increasing their visibility within the module. This allows for greater flexibility and testability.
The `client` field in the `Attributes` class was changed from `protected` to `internal`. This restricts access to only modules within the same package.
The function `getCollectionKey` was changed from private to internal. This allows it to be accessed from other modules within the project.
The `clearAllAttributesValue` function was made non-abstract and implemented to remove attribute values for a given entity ID from all cached scopes and the main collection. This change ensures that attribute values are properly cleared across the entire system.
Adds `isValidAttributeKey` to validate attribute keys. Uses regex to enforce naming conventions.
Adds extension function to handle Future failures by failing the provided Promise.
…configuration The Attributes class was refactored to handle the async attributes configuration. Specifically includes: - Renamed getAttributeType function to return a Future to handle asynchronous type checking. - Moved `checkValueType` to return a Future to support async value validation. - Modified `setAttributeValue` and `setAttributesValue` to perform asynchronous type checking before setting attributes. - Added proper Future handling for asynchronous operations.
Adds onSuccess method to complement onFailure for promise completion.
This adds an `onSuccess` extension function to `Future` that completes a provided `Promise` when the `Future` completes successfully.
Adds an abstract val allowedTypes property to the Attributes class
Updates checkValueType method to use KClass.
The `checkValueType` methods and `setAttributeValue` and `setAttributesValue` functions were refactored to improve type checking and error handling for attribute values. The changes ensure that the correct type is used for each attribute, and clearer error messages are displayed when type mismatches occur.
This commit refactors the Attributes class to improve attribute management and add support for creating attributes. The changes include: - Add validation for attribute keys - Improve the logic for retrieving scoped data - Add support for creating attributes
Adds a `ProductAttributes` class that extends `Attributes`. This class defines the allowed types for product attributes and the collection name for products.
Adds function to clear all values for an attribute. This assists with attribute removal by resetting values.
Adds extension functions to Future to simplify handling both success and failure cases for promises. This avoids redundant code.
Adds AttributeConfiguration.kt to define the structure for attribute configurations including key, name, data type, and scope level. Provides a toDocument() function for converting to a JsonObject.
This commit introduces the concept of system attributes and refactors the ProductAttributes class to include them. - Adds a `systemAttributes` property to the `Attributes` class. - Implements the `systemAttributes` in `ProductAttributes` class.
Adds an empty `initialiseSystemAttributes` function to the `Attributes` class. This function will check for missing system attributes and add them.
Moltensnor
requested changes
Oct 31, 2025
Collaborator
Moltensnor
left a comment
There was a problem hiding this comment.
Everything looks good, but there a some small things that need some changes. Do make sure that the pipeline passes before merging
src/main/kotlin/com/ex_dock/ex_dock/database/scope/createScopes.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/ex_dock/ex_dock/database/scope/createScopes.kt
Outdated
Show resolved
Hide resolved
|
|
||
| internal fun EventBus.getScopeById(client: MongoClient) { | ||
| this.consumer<String>("process.scope.getScopeById").handler { message -> | ||
| val websiteId = message.body() |
Collaborator
There was a problem hiding this comment.
This key is supposed to be an ObjectID instead of a String. So in needs to be initialized by ObjectId(data.getString(...))
Collaborator
There was a problem hiding this comment.
We can also put the scopes in the ExdockCache but we can also do that later. The cache is a bit better optimized for data fetching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces the attribute system with scopes
closes #73