This commit is contained in:
@@ -25,8 +25,11 @@ class AgentStatus extends Model
|
||||
];
|
||||
|
||||
public const STATUS_ONLINE = 'online';
|
||||
|
||||
public const STATUS_AWAY = 'away';
|
||||
|
||||
public const STATUS_BUSY = 'busy';
|
||||
|
||||
public const STATUS_OFFLINE = 'offline';
|
||||
|
||||
public static function statuses(): array
|
||||
|
||||
@@ -9,34 +9,34 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
// Add rating fields to crm_threads (skip if already exist)
|
||||
if (!Schema::hasColumn('crm_threads', 'rating')) {
|
||||
if (! Schema::hasColumn('crm_threads', 'rating')) {
|
||||
Schema::table('crm_threads', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('rating')->nullable();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('crm_threads', 'rating_comment')) {
|
||||
if (! Schema::hasColumn('crm_threads', 'rating_comment')) {
|
||||
Schema::table('crm_threads', function (Blueprint $table) {
|
||||
$table->text('rating_comment')->nullable();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('crm_threads', 'rated_at')) {
|
||||
if (! Schema::hasColumn('crm_threads', 'rated_at')) {
|
||||
Schema::table('crm_threads', function (Blueprint $table) {
|
||||
$table->timestamp('rated_at')->nullable();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('crm_threads', 'ai_summary')) {
|
||||
if (! Schema::hasColumn('crm_threads', 'ai_summary')) {
|
||||
Schema::table('crm_threads', function (Blueprint $table) {
|
||||
$table->text('ai_summary')->nullable();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('crm_threads', 'summary_generated_at')) {
|
||||
if (! Schema::hasColumn('crm_threads', 'summary_generated_at')) {
|
||||
Schema::table('crm_threads', function (Blueprint $table) {
|
||||
$table->timestamp('summary_generated_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
// Create chat_attachments table
|
||||
if (!Schema::hasTable('chat_attachments')) {
|
||||
if (! Schema::hasTable('chat_attachments')) {
|
||||
Schema::create('chat_attachments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('message_id')->constrained('crm_channel_messages')->cascadeOnDelete();
|
||||
@@ -56,7 +56,7 @@ return new class extends Migration
|
||||
}
|
||||
|
||||
// Create quick_replies table
|
||||
if (!Schema::hasTable('chat_quick_replies')) {
|
||||
if (! Schema::hasTable('chat_quick_replies')) {
|
||||
Schema::create('chat_quick_replies', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('business_id')->constrained()->cascadeOnDelete();
|
||||
@@ -73,7 +73,7 @@ return new class extends Migration
|
||||
}
|
||||
|
||||
// Create agent_statuses table for tracking availability
|
||||
if (!Schema::hasTable('agent_statuses')) {
|
||||
if (! Schema::hasTable('agent_statuses')) {
|
||||
Schema::create('agent_statuses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||
|
||||
Reference in New Issue
Block a user