040d25423d
GET /api/billing/wallet (баланс + тариф + runway), /transactions (пагинированный balance_transactions с фильтром type), /invoices (saas_invoices, real-but-empty до Б-1). TariffPlan модель + Tenant::tariff() relation + BalanceTransactionFactory. Sprint 2 Plan C, audit E3 (backend). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35 lines
819 B
PHP
35 lines
819 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\BalanceTransaction;
|
|
use App\Models\Tenant;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<BalanceTransaction>
|
|
*/
|
|
class BalanceTransactionFactory extends Factory
|
|
{
|
|
protected $model = BalanceTransaction::class;
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'tenant_id' => Tenant::factory(),
|
|
'type' => BalanceTransaction::TYPE_TOPUP,
|
|
'amount_rub' => '100.00',
|
|
'amount_leads' => 0,
|
|
'balance_rub_after' => '100.00',
|
|
'balance_leads_after' => 0,
|
|
'description' => 'Тестовая транзакция',
|
|
'created_at' => now(),
|
|
];
|
|
}
|
|
}
|