278 lines
18 KiB
PHP
278 lines
18 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Client;
|
|
use App\Models\ClientCallNote;
|
|
use App\Models\ClientMeeting;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class ClientCallSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Seed sample client calls and meetings data.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$admin = User::where('role', 'admin')->first();
|
|
$pm = User::where('email', 'user@company.com')->first();
|
|
|
|
if (!$admin || !$pm) {
|
|
return;
|
|
}
|
|
|
|
// 1. Happy Client Sample
|
|
$client1 = Client::firstOrCreate(
|
|
['client_email' => 'client.robert@acmecorp.com'],
|
|
[
|
|
'client_name' => 'Robert Miller',
|
|
'company_name' => 'Acme Corporation',
|
|
'client_phone' => '+1 (555) 234-5678',
|
|
'project_name' => 'Enterprise Cloud Migration & Analytics Portal',
|
|
'project_details' => 'Full-stack cloud infrastructure migration to AWS with real-time analytics dashboard and SingleLogin SSO authentication integration.',
|
|
'responsible_user_id' => $pm->id,
|
|
'created_by' => $admin->id,
|
|
'assigned_team_members' => [$pm->id, $admin->id],
|
|
'status' => 'active',
|
|
'latest_sentiment' => 'happy',
|
|
]
|
|
);
|
|
|
|
// Upcoming meeting
|
|
ClientMeeting::firstOrCreate(
|
|
['meeting_code' => 'cl-acme-kickoff'],
|
|
[
|
|
'client_id' => $client1->id,
|
|
'title' => 'Sprint 2 Milestone Demo & Feedback Review',
|
|
'agenda' => 'Demonstration of cloud infrastructure deployment, database synchronization metrics, and next sprint action items.',
|
|
'meeting_type' => 'scheduled',
|
|
'scheduled_at' => now()->addDays(1)->setTime(15, 0),
|
|
'duration_minutes' => 45,
|
|
'host_user_id' => $pm->id,
|
|
'team_attendees' => [$pm->id, $admin->id],
|
|
'client_emails' => ['client.robert@acmecorp.com'],
|
|
'status' => 'scheduled',
|
|
]
|
|
);
|
|
|
|
// Past meeting with MoM
|
|
$pastMeeting1 = ClientMeeting::firstOrCreate(
|
|
['meeting_code' => 'cl-acme-past-01'],
|
|
[
|
|
'client_id' => $client1->id,
|
|
'title' => 'Initial Project Kickoff & Architecture Alignment',
|
|
'agenda' => 'Scope finalization and requirements review.',
|
|
'meeting_type' => 'scheduled',
|
|
'scheduled_at' => now()->subDays(3)->setTime(14, 0),
|
|
'duration_minutes' => 30,
|
|
'host_user_id' => $pm->id,
|
|
'team_attendees' => [$pm->id],
|
|
'client_emails' => ['client.robert@acmecorp.com'],
|
|
'status' => 'completed',
|
|
'started_at' => now()->subDays(3)->setTime(14, 0),
|
|
'ended_at' => now()->subDays(3)->setTime(14, 30),
|
|
]
|
|
);
|
|
|
|
ClientCallNote::firstOrCreate(
|
|
['client_meeting_id' => $pastMeeting1->id],
|
|
[
|
|
'client_id' => $client1->id,
|
|
'created_by' => $pm->id,
|
|
'raw_transcript' => "[02:00 PM] PM: Welcome Robert, today we will align on cloud architecture milestones.\n[02:05 PM] Client: The architecture diagram looks great, we are very pleased with the proposed SSO integration.\n[02:15 PM] PM: Excellent, we will target Sprint 1 delivery by next Friday.",
|
|
'live_notes' => 'Client approved the architecture blueprints. Confirmed AWS US-East region for deployment.',
|
|
'mom_content' => "### Minutes of Meeting (MoM)\n**Project:** Enterprise Cloud Migration & Analytics Portal\n**Client:** Robert Miller (Acme Corporation)\n\n#### 1. Meeting Objectives\n- Finalize cloud infrastructure deployment blueprint.\n- Validate SingleLogin SSO integration requirements.\n\n#### 2. Key Discussion Points\n- Architecture diagrams and IAM policy structures approved.\n- Confirmed AWS hosting specifications.\n\n#### 3. Agreed Next Steps\n- Engineering team to initialize cloud templates.\n- PM to share weekly status reports.",
|
|
'summary' => 'Productive kickoff meeting where client praised the architectural design and approved deployment timeline.',
|
|
'action_items' => [
|
|
['task' => 'Deploy AWS staging environment templates', 'owner' => 'Engineering Team', 'deadline' => now()->addDays(2)->format('M d, Y'), 'status' => 'In Progress'],
|
|
['task' => 'Provide SSO federation test credentials', 'owner' => 'Tech Lead', 'deadline' => now()->addDays(3)->format('M d, Y'), 'status' => 'Pending']
|
|
],
|
|
'key_decisions' => [
|
|
['decision' => 'Approved AWS as primary cloud infrastructure provider.'],
|
|
['decision' => 'Scheduled recurring bi-weekly progress review calls.']
|
|
],
|
|
'detected_sentiment' => 'happy',
|
|
'sentiment_breakdown' => ['happy_pct' => 85, 'neutral_pct' => 10, 'sad_pct' => 3, 'angry_pct' => 2],
|
|
'angry_analysis' => ['is_angry' => false, 'trigger_words' => [], 'summary_why_angry' => '', 'grievances' => [], 'suggested_remedy' => ''],
|
|
'emotion_details' => [
|
|
'emotion' => 'happy',
|
|
'headline' => 'Client Delighted with Architecture Blueprint & SSO Speed',
|
|
'bullet_points' => [
|
|
'Pleased with clear architecture diagram and SingleLogin SSO integration roadmap.',
|
|
'Praised team responsiveness and transparent sprint breakdown.',
|
|
'Approved AWS cloud hosting specs without friction.'
|
|
],
|
|
'trigger_quotes' => ['looks great', 'very pleased', 'excellent progress'],
|
|
'suggested_action' => 'Maintain current sprint momentum and continue weekly demo cadence.'
|
|
],
|
|
'todo_items' => [
|
|
['id' => 1, 'task' => 'Deploy AWS staging environment templates', 'owner' => 'Engineering Team', 'priority' => 'High', 'deadline' => now()->addDays(2)->format('M d, Y'), 'completed' => true],
|
|
['id' => 2, 'task' => 'Provide SSO federation test credentials', 'owner' => 'Tech Lead', 'priority' => 'Medium', 'deadline' => now()->addDays(3)->format('M d, Y'), 'completed' => false],
|
|
['id' => 3, 'task' => 'Schedule recurring bi-weekly progress review calls', 'owner' => 'Project Manager', 'priority' => 'Low', 'deadline' => now()->addDays(5)->format('M d, Y'), 'completed' => false],
|
|
],
|
|
'emailed_at' => now()->subDays(3)->setTime(14, 35),
|
|
'emailed_to' => ['client.robert@acmecorp.com', 'user@company.com', 'admin@company.com']
|
|
]
|
|
);
|
|
|
|
// 2. Client with Frustrated/Angry Sentiment
|
|
$client2 = Client::firstOrCreate(
|
|
['client_email' => 'sarah.connor@cybertech.io'],
|
|
[
|
|
'client_name' => 'Sarah Connor',
|
|
'company_name' => 'CyberTech Dynamics',
|
|
'client_phone' => '+1 (555) 987-6543',
|
|
'project_name' => 'AI Customer Portal & Billing Gateway',
|
|
'project_details' => 'Customer self-service portal with integrated Stripe & PayPal billing gateway and AI chatbot.',
|
|
'responsible_user_id' => $pm->id,
|
|
'created_by' => $admin->id,
|
|
'assigned_team_members' => [$pm->id],
|
|
'status' => 'active',
|
|
'latest_sentiment' => 'angry',
|
|
]
|
|
);
|
|
|
|
$pastMeeting2 = ClientMeeting::firstOrCreate(
|
|
['meeting_code' => 'cl-cybertech-review'],
|
|
[
|
|
'client_id' => $client2->id,
|
|
'title' => 'Sprint 3 Deliverable Review & Urgent Escalation',
|
|
'agenda' => 'Addressing payment webhook latency and unexpected sprint delays.',
|
|
'meeting_type' => 'scheduled',
|
|
'scheduled_at' => now()->subDay()->setTime(11, 0),
|
|
'duration_minutes' => 35,
|
|
'host_user_id' => $pm->id,
|
|
'team_attendees' => [$pm->id],
|
|
'client_emails' => ['sarah.connor@cybertech.io'],
|
|
'status' => 'completed',
|
|
'started_at' => now()->subDay()->setTime(11, 0),
|
|
'ended_at' => now()->subDay()->setTime(11, 35),
|
|
]
|
|
);
|
|
|
|
ClientCallNote::firstOrCreate(
|
|
['client_meeting_id' => $pastMeeting2->id],
|
|
[
|
|
'client_id' => $client2->id,
|
|
'created_by' => $pm->id,
|
|
'raw_transcript' => "[11:02 AM] Client: We are extremely frustrated with the 2-week delay on the Stripe payment integration.\n[11:05 AM] Client: This delay is completely unacceptable and broken billing webhooks are halting our user onboarding.\n[11:15 AM] PM: We understand your concern Sarah, we will allocate two senior developers immediately to resolve the webhooks by tomorrow.",
|
|
'live_notes' => 'Client expressed strong dissatisfaction over payment gateway delay and API latency.',
|
|
'mom_content' => "### Minutes of Meeting (MoM)\n**Project:** AI Customer Portal & Billing Gateway\n**Client:** Sarah Connor (CyberTech Dynamics)\n\n#### 1. Meeting Objectives\n- Address client concerns regarding Stripe payment webhook delays.\n- Realign on deployment timeline.\n\n#### 2. Key Discussion Points\n- Client raised severe blockers due to webhook latency.\n- Engineering lead committed to delivering hotfix within 24 hours.\n\n#### 3. Escalation Action Items\n- PM & Tech Lead to provide daily progress sync until resolution.",
|
|
'summary' => 'Urgent review call where client voiced strong frustration regarding Stripe payment gateway delays and webhook issues.',
|
|
'action_items' => [
|
|
['task' => 'Deliver Stripe payment webhook hotfix and test end-to-end sandbox', 'owner' => 'Tech Lead', 'deadline' => now()->addDay()->format('M d, Y'), 'status' => 'Urgent'],
|
|
['task' => 'Send formal apology and revised sprint deliverable roadmap to client', 'owner' => 'Project Manager', 'deadline' => now()->format('M d, Y'), 'status' => 'Pending']
|
|
],
|
|
'todo_items' => [
|
|
['id' => 1, 'task' => 'Deliver Stripe payment webhook hotfix to staging server', 'owner' => 'Tech Lead', 'priority' => 'High', 'deadline' => now()->addDay()->format('M d, Y'), 'completed' => false],
|
|
['id' => 2, 'task' => 'Send formal roadmap update and test verification results', 'owner' => 'Project Manager', 'priority' => 'High', 'deadline' => now()->addDays(2)->format('M d, Y'), 'completed' => false],
|
|
],
|
|
'key_decisions' => [
|
|
['decision' => 'Assigned dedicated senior engineer to unblock billing module.']
|
|
],
|
|
'detected_sentiment' => 'angry',
|
|
'sentiment_breakdown' => ['happy_pct' => 5, 'neutral_pct' => 10, 'sad_pct' => 10, 'angry_pct' => 75],
|
|
'angry_analysis' => [
|
|
'is_angry' => true,
|
|
'trigger_words' => ['extremely frustrated', 'unacceptable', 'delay', 'broken billing webhooks', 'halting onboarding'],
|
|
'summary_why_angry' => 'Client Sarah Connor is angry due to a 2-week delay in the Stripe payment gateway delivery and broken webhook notifications that are halting their customer onboarding operations. She emphasized that communication was lacking prior to this meeting.',
|
|
'grievances' => [
|
|
'Two-week milestone delivery delay on core billing module.',
|
|
'Unreliable webhook notifications in staging environment.',
|
|
'Lack of proactive status updates before the sprint deadline.'
|
|
],
|
|
'suggested_remedy' => 'Director and PM should immediately send an executive assurance email, schedule a morning hotfix verification demo, and provide daily transparent milestone updates until billing goes live.'
|
|
],
|
|
'emotion_details' => [
|
|
'emotion' => 'angry',
|
|
'headline' => 'Client Frustrated by 2-Week Payment Gateway Delay',
|
|
'bullet_points' => [
|
|
'Two-week milestone delivery delay on core billing module.',
|
|
'Unreliable webhook notifications in staging environment halting customer onboarding.',
|
|
'Lack of proactive status updates before the sprint deadline.'
|
|
],
|
|
'trigger_quotes' => ['extremely frustrated', 'completely unacceptable', 'halting our user onboarding'],
|
|
'suggested_action' => 'Director & PM must arrange an immediate executive check-in, assign dedicated senior engineers to unblock issues, and deliver hotfix within 24h.'
|
|
],
|
|
'emailed_at' => now()->subDay()->setTime(11, 40),
|
|
'emailed_to' => ['sarah.connor@cybertech.io', 'user@company.com', 'admin@company.com']
|
|
]
|
|
);
|
|
|
|
// 3. Client with Concerned / Sad Sentiment (to test "Why was he sad / concerned?")
|
|
$client3 = Client::firstOrCreate(
|
|
['client_email' => 'david.chen@fintechflow.com'],
|
|
[
|
|
'client_name' => 'David Chen',
|
|
'company_name' => 'FinTech Flow Corp',
|
|
'client_phone' => '+1 (555) 456-7890',
|
|
'project_name' => 'Real-Time Financial Fraud Detection Engine',
|
|
'project_details' => 'Machine learning based transaction fraud scoring engine with Kafka event pipelines.',
|
|
'responsible_user_id' => $pm->id,
|
|
'created_by' => $admin->id,
|
|
'assigned_team_members' => [$pm->id],
|
|
'status' => 'active',
|
|
'latest_sentiment' => 'sad',
|
|
]
|
|
);
|
|
|
|
$pastMeeting3 = ClientMeeting::firstOrCreate(
|
|
['meeting_code' => 'cl-fintech-concern'],
|
|
[
|
|
'client_id' => $client3->id,
|
|
'title' => 'QA Test Coverage & Compliance Risk Sync',
|
|
'agenda' => 'Reviewing end-to-end testing milestones and regulatory compliance dates.',
|
|
'meeting_type' => 'scheduled',
|
|
'scheduled_at' => now()->setTime(10, 0),
|
|
'duration_minutes' => 25,
|
|
'host_user_id' => $pm->id,
|
|
'team_attendees' => [$pm->id],
|
|
'client_emails' => ['david.chen@fintechflow.com'],
|
|
'status' => 'completed',
|
|
'started_at' => now()->setTime(10, 0),
|
|
'ended_at' => now()->setTime(10, 25),
|
|
]
|
|
);
|
|
|
|
ClientCallNote::firstOrCreate(
|
|
['client_meeting_id' => $pastMeeting3->id],
|
|
[
|
|
'client_id' => $client3->id,
|
|
'created_by' => $pm->id,
|
|
'raw_transcript' => "[10:00 AM] David: We are worried that compliance audit deadlines are in 3 weeks and test coverage is currently at 65%.\n[10:10 AM] PM: We understand your concern David, we have queued additional automated test suites.\n[10:15 AM] David: I am feeling uneasy about launching without 90% coverage.",
|
|
'live_notes' => 'Client expressed worry and hesitation regarding regulatory compliance test coverage before launch.',
|
|
'mom_content' => "### Minutes of Meeting (MoM)\n**Project:** Real-Time Financial Fraud Detection Engine\n**Client:** David Chen (FinTech Flow Corp)\n\n#### 1. Meeting Objectives\n- Evaluate test automation progress.\n- Align on compliance audit requirements.\n\n#### 2. Key Discussion Points\n- Client expressed concern over 65% test coverage.\n- Team agreed to prioritize automated integration tests.\n\n#### 3. Next Steps\n- Share daily test coverage metrics.",
|
|
'summary' => 'Client expressed concern and sadness over QA test coverage timeline ahead of an upcoming regulatory compliance audit.',
|
|
'action_items' => [
|
|
['task' => 'Increase unit & integration test coverage to >85%', 'owner' => 'QA Team', 'deadline' => now()->addDays(4)->format('M d, Y'), 'status' => 'In Progress'],
|
|
['task' => 'Provide compliance audit readiness checklist', 'owner' => 'Tech Lead', 'deadline' => now()->addDays(2)->format('M d, Y'), 'status' => 'Pending']
|
|
],
|
|
'todo_items' => [
|
|
['id' => 1, 'task' => 'Increase unit & integration test coverage to >85%', 'owner' => 'QA Team', 'priority' => 'High', 'deadline' => now()->addDays(4)->format('M d, Y'), 'completed' => false],
|
|
['id' => 2, 'task' => 'Provide compliance audit readiness checklist to David', 'owner' => 'Tech Lead', 'priority' => 'Medium', 'deadline' => now()->addDays(2)->format('M d, Y'), 'completed' => false],
|
|
],
|
|
'key_decisions' => [
|
|
['decision' => 'Postponed non-critical UI enhancements to focus exclusively on test coverage.']
|
|
],
|
|
'detected_sentiment' => 'sad',
|
|
'sentiment_breakdown' => ['happy_pct' => 10, 'neutral_pct' => 15, 'sad_pct' => 70, 'angry_pct' => 5],
|
|
'angry_analysis' => ['is_angry' => false, 'trigger_words' => [], 'summary_why_angry' => '', 'grievances' => [], 'suggested_remedy' => ''],
|
|
'emotion_details' => [
|
|
'emotion' => 'sad',
|
|
'headline' => 'Client Expressed Worry & Hesitation on Compliance Deadline',
|
|
'bullet_points' => [
|
|
'Worried that compliance audit deadline is only 3 weeks away while test coverage is at 65%.',
|
|
'Uneasy about potential regulatory penalties if production release has unverified edge cases.',
|
|
'Requested daily test metrics reports and prioritized automated regression tests.'
|
|
],
|
|
'trigger_quotes' => ['worried about deadline', 'feeling uneasy', 'concern about test coverage'],
|
|
'suggested_action' => 'Tech Lead and PM should proactively provide a detailed test coverage roadmap and schedule a reassuring technical walkthrough.'
|
|
],
|
|
'emailed_at' => now()->setTime(10, 30),
|
|
'emailed_to' => ['david.chen@fintechflow.com', 'user@company.com', 'admin@company.com']
|
|
]
|
|
);
|
|
}
|
|
}
|