Add SMS bulk delay configuration and validate coupon phone function
This commit is contained in:
1 parent
275ee63ffb
commit
c74330cfaf
18 files changed
+1637
No files matched your search
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\SmsSendStatus;
|
||||
use App\Models\Coupon;
|
||||
use App\Models\SmsCampaign;
|
||||
use App\Models\SmsSendLog;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<SmsSendLog>
|
||||
*/
|
||||
class SmsSendLogFactory extends Factory
|
||||
{
|
||||
protected $model = SmsSendLog::class;
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$campaign = SmsCampaign::factory()->create();
|
||||
$coupon = Coupon::factory()->create();
|
||||
|
||||
return [
|
||||
'sms_campaign_id' => $campaign->id,
|
||||
'coupon_id' => $coupon->id,
|
||||
'phone' => $coupon->phone,
|
||||
'message' => $campaign->message,
|
||||
'status' => SmsSendStatus::Pending,
|
||||
'error_message' => null,
|
||||
'attempted_at' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user