Files
hoshpoint-backend/app/Models/Wallet.php
soheil khaledabadi 46ae711a20 feat(api): add AI text-to-deck generation, wallet deposit structure, and profile/notification endpoints
Fills the gaps between the admin panel screens and the backend: a full
free-text + slide-count + language -> AI-generated presentation flow with
new slide-cloning logic in TemplateFillService, a "my presentations" list
endpoint, a swappable payment-gateway structure for wallet top-ups (fake
driver for now), and avatar upload / public-profile toggle / account
deletion / password change / notification preference endpoints.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-29 01:36:17 +03:30

48 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
#[Fillable(['user_id', 'balance', 'is_active'])]
class Wallet extends Model
{
/**
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* @return HasMany<WalletTransaction, $this>
*/
public function transactions(): HasMany
{
return $this->hasMany(WalletTransaction::class)->latest();
}
/**
* @return HasMany<WalletDeposit, $this>
*/
public function deposits(): HasMany
{
return $this->hasMany(WalletDeposit::class)->latest();
}
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'balance' => 'integer',
'is_active' => 'boolean',
];
}
}