feat: implement wallet and invoice factories, enhance wallet service methods, and add comprehensive tests

This commit is contained in:
2026-09-21 05:01:19 +03:30
parent 45da0103c0
commit b4b1fdc288
8 changed files with 568 additions and 37 deletions
+2 -2
View File
@@ -27,12 +27,12 @@ class WalletService
public function forUser(User $user): Wallet
{
return Wallet::firstOrCreate(['user_id' => $user->id]);
return Wallet::firstOrCreate(['user_id' => $user->id], ['balance' => 0]);
}
public function system(): Wallet
{
return Wallet::firstOrCreate(['user_id' => null]);
return Wallet::firstOrCreate(['user_id' => null], ['balance' => 0]);
}
public function deposit(User $user, int $amount, WalletTransactionReasonEnum $reason, ?Payment $payment = null): WalletTransaction