Closed megoxv closed 2 months ago
The changes involve a transition from integer to floating-point representations for balance calculations across multiple files. The WalletAction.php
file updates methods to handle balanceFloatNum
instead of balance
, while TransactionResource.php
modifies how amounts are displayed in the table. Additionally, WalletResource.php
adjusts the logic for calculating balances during transactions, ensuring consistency in the use of floating-point numbers throughout the application.
Files | Change Summary |
---|---|
src/Filament/Actions/WalletAction.php |
Updated balance calculations to use balanceFloatNum instead of balance . Changed method signatures for withdraw and deposit to withdrawFloat and depositFloat . |
src/Filament/Resources/TransactionResource.php |
Modified the amount column formatting from numeric(2) to a calculated integer format dividing by 100. Retained badge color logic and sortable property. |
src/Filament/Resources/WalletResource.php |
Adjusted balance calculations in the form method to use balanceFloatNum for both debit and credit transactions. Updated the table representation to display balanceFloatNum . |
README.md |
Updated the Account class to use the HasWalletFloat trait instead of HasWallet , reflecting a change in wallet functionality. |
sequenceDiagram
participant User
participant WalletAction
participant WalletResource
participant TransactionResource
User->>WalletAction: Initiate transaction
WalletAction->>WalletResource: Update balance with balanceFloatNum
WalletAction->>TransactionResource: Update transaction amount
TransactionResource->>User: Display updated transaction
🐰 In the meadow, numbers dance,
Floating points in a joyful prance.
Balances shift with a gentle sway,
Rabbit's math leads the way!
With every hop, precision reigns,
In the world of coins, no more pains! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Improvements