feat(economy): add economy module with wallet and transaction system#177
feat(economy): add economy module with wallet and transaction system#177danielhe4rt merged 1 commit into4.xfrom
Conversation
- Add Wallet and Transaction models with relationships - Implement Credit, Debit, and Transfer actions with DTOs - Add HasWallet trait for models that need wallet functionality - Add Currency and TransactionType enums - Add InsufficientBalanceException for balance validation - Integrate HasWallet trait into Character model - Add comprehensive tests for economy flows
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request introduces a new economy module as a Laravel package at 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can use your project's `phpmd` ruleset to improve the quality of PHP code reviews.You can customize the |
Summary
economymodule with wallet and transaction functionalityHasWallettraitChanges
New Economy Module (
app-modules/economy/)Models:
Wallet- Stores balance per currency for any modelTransaction- Records all credit/debit/transfer operationsActions:
CreateWallet- Initialize a wallet for a modelCredit- Add funds to a walletDebit- Remove funds from a walletTransfer- Move funds between walletsDTOs:
CreditDTO,DebitDTO,TransferDTO- Type-safe data transfer objectsEnums:
Currency- Supported currency typesTransactionType- Transaction categorizationExceptions:
InsufficientBalanceException- Thrown when debit/transfer exceeds balanceIntegration
HasWallettrait toCharactermodel for wallet functionalityTesting
Summary by CodeRabbit
Release Notes