47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* 文件功能:百家乐买单活动测试工厂
|
|
*
|
|
* 用于在测试中快速创建不同状态的百家乐买单活动记录。
|
|
*/
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\BaccaratLossCoverEvent>
|
|
*/
|
|
class BaccaratLossCoverEventFactory extends Factory
|
|
{
|
|
/**
|
|
* 定义默认测试数据。
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$startsAt = now()->subMinutes(5);
|
|
$endsAt = now()->addMinutes(25);
|
|
|
|
return [
|
|
'title' => '你玩游戏我买单',
|
|
'description' => '测试活动说明',
|
|
'status' => 'active',
|
|
'starts_at' => $startsAt,
|
|
'ends_at' => $endsAt,
|
|
'claim_deadline_at' => $endsAt->copy()->addHours(24),
|
|
'created_by_user_id' => User::factory(),
|
|
'closed_by_user_id' => null,
|
|
'started_notice_sent_at' => null,
|
|
'ended_notice_sent_at' => null,
|
|
'participant_count' => 0,
|
|
'compensable_user_count' => 0,
|
|
'total_loss_amount' => 0,
|
|
'total_claimed_amount' => 0,
|
|
];
|
|
}
|
|
}
|