Major additions: - Knowledge base with categories, articles, revisions, and voting - Enhanced ticket system: departments, SLA policies, canned responses, tags, custom fields, satisfaction ratings, internal notes - Multi-currency support with exchange rate sync - Shopping cart and quote system with PDF generation - Affiliate program with referrals, commissions, and payouts - Account credits, credit notes, and debit notes - Staff management with granular role-based permissions - Fraud detection and order risk assessment - ServerHunter SEO integration - Service lifecycle events (suspend/unsuspend/terminate) - Service management panels for VPS, Dedicated, Hosting, and Game servers - Plan lifecycle fields and per-customer overrides - 30+ migrations, 17 factories, 8 feature test suites Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Affiliate;
|
|
use App\Models\AffiliateReferral;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/** @extends Factory<AffiliateReferral> */
|
|
class AffiliateReferralFactory extends Factory
|
|
{
|
|
protected $model = AffiliateReferral::class;
|
|
|
|
/** @return array<string, mixed> */
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'affiliate_id' => Affiliate::factory(),
|
|
'referred_user_id' => User::factory(),
|
|
'subscription_id' => null,
|
|
'status' => 'pending',
|
|
'signup_ip' => fake()->ipv4(),
|
|
'referral_url' => fake()->url(),
|
|
];
|
|
}
|
|
|
|
public function approved(): static
|
|
{
|
|
return $this->state(fn (): array => [
|
|
'status' => 'approved',
|
|
'approved_at' => now(),
|
|
]);
|
|
}
|
|
|
|
public function rejected(): static
|
|
{
|
|
return $this->state(fn (): array => [
|
|
'status' => 'rejected',
|
|
]);
|
|
}
|
|
}
|