migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class SupportTicketCategoriesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('support_ticket_categories')->insert([
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'name' => 'Support',
|
||||
'description' => 'Support-related queries',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'name' => 'Tech',
|
||||
'description' => 'Technical assistance',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SupportTicketDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$this->call([
|
||||
SupportTicketFAQSeeder::class,
|
||||
SupportTicketCategoriesTableSeeder::class,
|
||||
TicketTableSeeder::class,
|
||||
TicketConversationsTableSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Modules\SupportTicket\Models\SupportTicketFAQ;
|
||||
|
||||
class SupportTicketFAQSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$faqs = [
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'question' => 'What is the return policy?',
|
||||
'answer' => 'You can return the product within 30 days of purchase.',
|
||||
'created_at' => '2025-01-01T12:00:00Z',
|
||||
'updated_at' => '2025-01-05T14:30:00Z',
|
||||
],
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'question' => 'How can I track my order?',
|
||||
'answer' => 'You can track your order using the tracking link sent to your email after the order is shipped.',
|
||||
'created_at' => '2025-01-02T09:00:00Z',
|
||||
'updated_at' => '2025-01-06T10:00:00Z',
|
||||
],
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'question' => 'Is customer support available 24/7?',
|
||||
'answer' => 'Yes, our customer support is available 24/7 to assist you.',
|
||||
'created_at' => '2025-01-03T15:45:00Z',
|
||||
'updated_at' => '2025-01-07T16:00:00Z',
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($faqs as $faq) {
|
||||
SupportTicketFAQ::create($faq);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class TicketConversationsTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('support_ticket_conversations')->insert([
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'ticket_id' => 1,
|
||||
'message' => 'This is the last message in the conversation 1.',
|
||||
'user_type' => 'user', // Possible values: 'user', 'agent'
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'ticket_id' => 1,
|
||||
'message' => 'Follow-up message from the agent 1.',
|
||||
'user_type' => 'agent',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'ticket_id' => 1,
|
||||
'message' => 'This is the last message in the conversation 2.',
|
||||
'user_type' => 'user', // Possible values: 'user', 'agent'
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'ticket_id' => 1,
|
||||
'message' => 'Follow-up message from the agent 2.',
|
||||
'user_type' => 'agent',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
|
||||
// 2
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'ticket_id' => 2,
|
||||
'message' => 'This is the last message in the conversation.',
|
||||
'user_type' => 'user', // Possible values: 'user', 'agent'
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
[
|
||||
'restaurant_id' => 1,
|
||||
'ticket_id' => 2,
|
||||
'message' => 'Follow-up message from the agent.',
|
||||
'user_type' => 'agent',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class TicketTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('support_tickets')->insert([
|
||||
[
|
||||
'readable_ticket_id' => Str::random(6),
|
||||
'user_id' => 1, // Assuming user_id 1 exists
|
||||
'category_id' => 1, // Assuming category_id 1 exists
|
||||
'restaurant_id' => 1, // Assuming restaurant_id 1 exists
|
||||
'title' => 'Sample Ticket 1',
|
||||
'description' => 'This is a detailed description of the first ticket.',
|
||||
'purchase_code' => 'PUR12345',
|
||||
'status' => 'open',
|
||||
'read' => true,
|
||||
'related_url' => 'https://example.com',
|
||||
'support_plan' => 'Premium',
|
||||
'attachments' => json_encode(['attachment1.png', 'attachment2.pdf']),
|
||||
'last_conversation_time' => now()->subHours(2),
|
||||
'last_respond_by_client_at' => now()->subDay(),
|
||||
'created_at' => now()->subDays(2),
|
||||
'updated_at' => now()->subDay(),
|
||||
],
|
||||
[
|
||||
'readable_ticket_id' => Str::random(6),
|
||||
'user_id' => 2,
|
||||
'category_id' => 2,
|
||||
'restaurant_id' => 1, // No project assigned
|
||||
'title' => 'Sample Ticket 2',
|
||||
'description' => 'This is another detailed description for the second ticket.',
|
||||
'purchase_code' => 'PUR67890',
|
||||
'status' => 'pending',
|
||||
'read' => false,
|
||||
'related_url' => null,
|
||||
'support_plan' => 'Standard',
|
||||
'attachments' => json_encode([]),
|
||||
'last_conversation_time' => null,
|
||||
'last_respond_by_client_at' => null,
|
||||
'created_at' => now()->subDays(5),
|
||||
'updated_at' => now()->subDays(4),
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user