Add SMS bulk delay configuration and validate coupon phone function

This commit is contained in:
Mekan1206
2026-06-03 20:57:54 +05:00
parent 275ee63ffb
commit c74330cfaf
18 changed files with 1637 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('sms_campaigns', function (Blueprint $table) {
$table->id();
$table->text('message');
$table->string('mode');
$table->unsignedInteger('recipient_count')->default(0);
$table->unsignedInteger('sent_count')->default(0);
$table->unsignedInteger('failed_count')->default(0);
$table->unsignedInteger('skipped_count')->default(0);
$table->string('laravel_batch_id')->nullable();
$table->foreignId('created_by')->constrained('users')->cascadeOnDelete();
$table->timestamp('completed_at')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('sms_campaigns');
}
};

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('sms_send_logs', function (Blueprint $table) {
$table->id();
$table->foreignId('sms_campaign_id')->constrained()->cascadeOnDelete();
$table->foreignId('coupon_id')->nullable()->constrained()->nullOnDelete();
$table->string('phone');
$table->text('message');
$table->string('status');
$table->text('error_message')->nullable();
$table->timestamp('attempted_at')->nullable();
$table->timestamps();
$table->index(['sms_campaign_id', 'status']);
});
}
public function down(): void
{
Schema::dropIfExists('sms_send_logs');
}
};