-
-
Notifications
You must be signed in to change notification settings - Fork 0
v3 API improvements, multi currency support #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NonSwag
wants to merge
31
commits into
main
Choose a base branch
from
feat/v3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,353
−765
Conversation
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
Updated version in `build.gradle.kts`.
Introduced `CurrencyHolder` to centralize currency management logic. Applied the interface to `EconomyController`, `BankController`, and related classes to unify and enhance functionality. Deprecated older currency formatting methods in favor of `Currency` methods.
Introduced `Currency` interface to define currency properties and formatting. Deprecated older `EconomyController` methods in favor of `Currency` methods for better consistency and multi-currency support.
Replaced direct balance manipulation methods with `Currency`-based equivalents for consistency and multi-currency support. Deprecated older methods and introduced `WrappedCurrency` for compatibility with Vault's economy API. Updated placeholders and wrapper classes accordingly.
Outlined areas for improvement, including API cleanup, error handling, data loss warnings, and progress tracking.
Updated deprecation annotations to mark methods for removal in version 3.0.0. Added `@since 3.0.0` annotations to newly introduced methods in `CurrencyHolder`.
Enhanced method contracts with `@Contract` annotations to improve nullability and immutability handling while clarifying method behaviors.
Refactored `EconomyController` and `BankController` methods to include `@Nullable` `World` parameters. Adjusted method signatures and default behaviors to accommodate this change.
Introduced `hasMultiWorldSupport` method in `EconomyController` and `BankController`. This determines multi-world handling capabilities and clarifies parameter behavior for non-supported cases.
Enhanced documentation across `EconomyController` and `CurrencyHolder`. Clarified behaviors, improved annotations, and ensured consistent descriptions for return values and exceptions.
Updated methods to use `getHolder` for consistency with the `CurrencyHolder` interface.
Replaced `try-catch` blocks with streamlined `join` and `Optional` chaining for cleaner and more concise code. Eliminated imports for `InterruptedException` and `ExecutionException`.
Eliminated unused `deleteAccounts` method and corresponding import to streamline the `EconomyServiceWrapper` class.
Replaced unfinished bank and account conversion workflows with `CompletableFuture.completedFuture(null)`. Added TODOs and FIXMEs to address unresolved implementation details.
Documented the version in which interfaces, methods, and classes were introduced.
Refactored controllers and related methods to support `@Nullable World` parameters. Adjusted method signatures and default behaviors, introducing helper methods for context handling. This simplifies multi-world and default-world operations.
Introduced `displayNamesSingular()` and `displayNamesPlural()` methods in `Currency.Builder`. These provide unmodifiable mappings of singular and plural display names for various locales, improving extensibility and localization support.
Updated `Currency` interface methods to return `Optional` values, improving null safety. Added builders and editing functionalities. Enhanced `Account` methods for simpler balance operations, with `BigDecimal` returns for precision. Bumped version to 3.0.0-pre2.
Updated `Currency` methods to return `Optional`, improving null safety. Redesigned `setBalance` in `WrappedAccount` to return `BigDecimal` for better precision. Adjusted `WrappedCurrency` to include editing logic and improve locale-based display name handling for currencies. Bumped version to 3.0.0-pre3.
Declared `throws IllegalArgumentException` for `editCurrency` to handle duplicate currency names explicitly. This improves API safety and clarity for consumers.
Introduced a default method to delete currencies using their object reference. Delegates internally to `deleteCurrency(String)` for streamlined logic and API flexibility.
Added a `toBuilder` method to the `Currency` interface and implemented it in `WrappedCurrency` using a `NoOpBuilder`. This allows modification or reconstruction of a `Currency` instance.
Refactored `EconomyController`, `BankController`, and related APIs to delegate currency management to `CurrencyHolder`. Removed deprecated methods from `Account` and `CurrencyHolder`. Updated implementations and placeholder resolvers to align with the changes. Bumped version to 3.0.0-pre4.
Expanded `BankController` with multiple `hasBank` overloads for better account-checking flexibility. Updated `Currency` to include `getHolder`, improving association tracking. Adjusted wrappers to align with these changes.
Replaced `UnsupportedOperationException` with a fully implemented method. Leveraged builder details for initializing currency attributes such as names, fractional digits, and symbols. Simplified creation logic and enhanced API usability.
Enhanced descriptions for method parameters, added `@apiNote` annotations for clarity, and standardized return value formatting with `{@code}`. Updated references to `uuid` instead of `UUID`. Improved consistency in `Account` API behavior with `BigDecimal.ZERO` returns for unsupported operations.
Enhanced `Bank` and `Account` APIs with balance operation checks. Implemented default behaviors and updated wrappers to align with the new methods for consistent validation logic.
Documented version information for newly introduced methods in `Bank` and `Account` to improve clarity and maintainability.
Updated project version in `build.gradle.kts` to reflect the latest pre-release iteration.
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.
Closes #39
@since
to all docs