|
75599
|
1886
|
32
|
2026-04-24T06:40:35.720692+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-24/1777 /Users/lukas/.screenpipe/data/data/2026-04-24/1777012835720_m2.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsServiceReportGeneratio faVsco.js – AutomatedReportsServiceReportGenerationTest.php...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-20157-AJ-report-not-s Pushed 1 commit to origin/JY-20157-AJ-report-not-send-notification
text/html
text/html
text/html
View pull request
2 files committed
JY-20157 fix failing tests
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#12011 on JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
AutomatedReportsServiceReportGen…tionTest
Run 'AutomatedReportsServiceReportGenerationTest'
Debug 'AutomatedReportsServiceReportGenerationTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
46
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Kiosk\AutomatedReports;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Support\Carbon;
use InvalidArgumentException;
use Jiminny\Component\UrlGenerator\Webhook;
use Jiminny\Contracts\Repositories\PlaybookCategoryRepository;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Repositories\GroupRepository;
use Jiminny\Repositories\StageRepository;
use Jiminny\Repositories\TeamRepository;
use Jiminny\Repositories\UserRepository;
use Jiminny\Services\Kiosk\AutomatedReports\ActivityTypeService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\Kiosk\AutomatedReports\DealStagesService;
use Jiminny\Services\Kiosk\AutomatedReports\RecipientsService;
use Jiminny\Component\AskAnything\AskAnythingPromptService;
use Jiminny\Repositories\SearchRepository;
use Jiminny\Repositories\AskAnythingRepository;
use Tests\TestCase;
use Tests\Unit\Traits\TestPrivateMethod;
class AutomatedReportsServiceReportGenerationTest extends TestCase
{
use TestPrivateMethod;
private AutomatedReportsService $service;
private Webhook $webhookService;
private AutomatedReportsRepository $automatedReportsRepository;
private TeamRepository $teamRepository;
protected function setUp(): void
{
parent::setUp();
// Create mocks for dependencies
$this->teamRepository = $this->createMock(TeamRepository::class);
$teamRepository = $this->teamRepository;
$groupRepository = $this->createMock(GroupRepository::class);
$userRepository = $this->createMock(UserRepository::class);
$stageRepository = $this->createMock(StageRepository::class);
$dealStagesService = $this->createMock(DealStagesService::class);
$recipientsService = $this->createMock(RecipientsService::class);
$this->automatedReportsRepository = $this->createMock(AutomatedReportsRepository::class);
$this->webhookService = $this->createMock(Webhook::class);
$dispatcher = $this->createMock(BusDispatcher::class);
$activityTypeService = $this->createMock(ActivityTypeService::class);
$playbookCategoryRepository = $this->createMock(PlaybookCategoryRepository::class);
// Create service instance with mocked dependencies
$this->service = new AutomatedReportsService(
$teamRepository,
$groupRepository,
$userRepository,
$stageRepository,
$dealStagesService,
$recipientsService,
$this->automatedReportsRepository,
$this->webhookService,
$dispatcher,
$activityTypeService,
$playbookCategoryRepository,
$this->createMock(AskAnythingPromptService::class),
$this->createMock(SearchRepository::class),
$this->createMock(AskAnythingRepository::class),
);
}
/**
* Test getGenerateReportPayload method with one-off frequency
*/
public function testGetGenerateReportPayloadWithOneOffFrequency(): void
{
$reportUuid = 'report-uuid';
$resultUuid = 'result-uuid';
$callbackUrl = '[URL_WITH_CREDENTIALS] @@
-'2025-08-05T00:00:00+00:00'
+'2025-08-03T00:00:00+00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php:194
2) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceActivitiesCountTest::testGetActivitiesCountPayloadWithMonthlyFrequency
Failed asserting that '2025-07-31T23:59:59+00:00' starts with "2025-08-11".
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php:226
3) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithWeeklyFrequency
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2023-02-08 00:00:00'
+'2023-02-05 00:00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:180
4) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithMonthlyFrequency
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2023-01-15 00:00:00'
+'2023-01-01 00:00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:205
5) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithQuarterlyFrequency
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2022-11-15 00:00:00'
+'2022-10-01 00:00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:230
6) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithWeeklyFrequencyUsesFullDays
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2026-01-13T00:00:00+00:00'
+'2026-01-11T00:00:00+00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:778
7) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithMonthlyFrequencyUsesFullDays
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2025-12-20T00:00:00+00:00'
+'2025-12-01T00:00:00+00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:816
8) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithQuarterlyFrequencyUsesFullDays
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2025-10-20T00:00:00+00:00'
+'2025-10-01T00:00:00+00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:854
FAILURES!
Tests: 10847, Assertions: 46370, Failures: 8, Warnings: 24, Deprecations: 80, PHPUnit Deprecations: 434, Skipped: 51, Incomplete: 65.
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-20157-AJ-report-not-send-notification","depth":3,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.11037234,"height":0.027134877},"value":"Pushed 1 commit to origin/JY-20157-AJ-report-not-send-notification","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.103390954,"height":0.027134877},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8753325,"top":0.87150836,"width":0.03523936,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2 files committed","depth":2,"bounds":{"left":0.8753325,"top":0.91300875,"width":0.100398935,"height":0.013567438},"role_description":"text"},{"role":"AXTextField","text":"JY-20157 fix failing tests","depth":3,"bounds":{"left":0.8753325,"top":0.92897046,"width":0.11037234,"height":0.013567438},"value":"JY-20157 fix failing tests","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.92897046,"width":0.050531916,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"bounds":{"left":0.8753325,"top":0.9481245,"width":0.048204787,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.25731382,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12011 on JY-20157-AJ-report-not-send-notification, menu","depth":5,"bounds":{"left":0.29587767,"top":0.019952115,"width":0.12134308,"height":0.025538707},"help_text":"Pull request #12011 exists for current branch JY-20157-AJ-report-not-send-notification","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.7915558,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsServiceReportGen…tionTest","depth":6,"bounds":{"left":0.8068484,"top":0.019952115,"width":0.1087101,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsServiceReportGenerationTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsServiceReportGenerationTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"46","depth":4,"bounds":{"left":0.5930851,"top":0.34796488,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.6050532,"top":0.3463687,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.61236703,"top":0.3463687,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Kiosk\\AutomatedReports;\n\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Support\\Carbon;\nuse InvalidArgumentException;\nuse Jiminny\\Component\\UrlGenerator\\Webhook;\nuse Jiminny\\Contracts\\Repositories\\PlaybookCategoryRepository;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Repositories\\GroupRepository;\nuse Jiminny\\Repositories\\StageRepository;\nuse Jiminny\\Repositories\\TeamRepository;\nuse Jiminny\\Repositories\\UserRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\ActivityTypeService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\DealStagesService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\RecipientsService;\nuse Jiminny\\Component\\AskAnything\\AskAnythingPromptService;\nuse Jiminny\\Repositories\\SearchRepository;\nuse Jiminny\\Repositories\\AskAnythingRepository;\nuse Tests\\TestCase;\nuse Tests\\Unit\\Traits\\TestPrivateMethod;\n\nclass AutomatedReportsServiceReportGenerationTest extends TestCase\n{\n use TestPrivateMethod;\n\n private AutomatedReportsService $service;\n private Webhook $webhookService;\n private AutomatedReportsRepository $automatedReportsRepository;\n private TeamRepository $teamRepository;\n\n protected function setUp(): void\n {\n parent::setUp();\n\n // Create mocks for dependencies\n $this->teamRepository = $this->createMock(TeamRepository::class);\n $teamRepository = $this->teamRepository;\n $groupRepository = $this->createMock(GroupRepository::class);\n $userRepository = $this->createMock(UserRepository::class);\n $stageRepository = $this->createMock(StageRepository::class);\n $dealStagesService = $this->createMock(DealStagesService::class);\n $recipientsService = $this->createMock(RecipientsService::class);\n $this->automatedReportsRepository = $this->createMock(AutomatedReportsRepository::class);\n $this->webhookService = $this->createMock(Webhook::class);\n $dispatcher = $this->createMock(BusDispatcher::class);\n $activityTypeService = $this->createMock(ActivityTypeService::class);\n $playbookCategoryRepository = $this->createMock(PlaybookCategoryRepository::class);\n\n // Create service instance with mocked dependencies\n $this->service = new AutomatedReportsService(\n $teamRepository,\n $groupRepository,\n $userRepository,\n $stageRepository,\n $dealStagesService,\n $recipientsService,\n $this->automatedReportsRepository,\n $this->webhookService,\n $dispatcher,\n $activityTypeService,\n $playbookCategoryRepository,\n $this->createMock(AskAnythingPromptService::class),\n $this->createMock(SearchRepository::class),\n $this->createMock(AskAnythingRepository::class),\n );\n }\n\n /**\n * Test getGenerateReportPayload method with one-off frequency\n */\n public function testGetGenerateReportPayloadWithOneOffFrequency(): void\n {\n $reportUuid = 'report-uuid';\n $resultUuid = 'result-uuid';\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getTeamId')->willReturn(1);\n $report->method('getGroups')->willReturn([101, 102]);\n $report->method('getType')->willReturn('exec_summary');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n $report->method('getFrom')->willReturn(Carbon::parse('2023-01-01'));\n $report->method('getTo')->willReturn(Carbon::parse('2023-01-31'));\n $report->method('getDealAtCallStages')->willReturn([201, 202]);\n $report->method('getCurrentDealStages')->willReturn([301, 302]);\n $report->method('getDealValueMin')->willReturn(1000);\n $report->method('getDealValueMax')->willReturn(5000);\n $report->method('getCallTypes')->willReturn(['conference', 'dialer']);\n $report->method('getCallDurationMin')->willReturn(600);\n $report->method('getCallDurationMax')->willReturn(1800);\n $report->method('getAdditionalPromptInput')->willReturn('Focus on sales performance');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n $report->method('getPlaybookCategories')->willReturn(['category1', 'category2']);\n $report->method('getCustomName')->willReturn('My Custom Report');\n\n $result = $this->createMock(AutomatedReportResult::class);\n $result->method('getFromDate')->willReturn(Carbon::parse('2023-01-01'));\n $result->method('getToDate')->willReturn(Carbon::parse('2023-01-31'));\n $result->method('getReport')->willReturn($report);\n\n $this->automatedReportsRepository->method('findResultByUuid')->willReturn($result);\n\n // Set up webhook service to return callback URL\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n // Call the method\n $result = $this->service->getGenerateReportPayload($report, $resultUuid);\n\n // Verify result\n $this->assertEquals(1, $result['team_id']);\n $this->assertEquals([101, 102], $result['group_ids']);\n $this->assertEquals('exec_summary', $result['report_type']);\n $this->assertEquals('2023-01-01T00:00:00+00:00', $result['from_date']);\n $this->assertEquals('2023-01-31T23:59:59+00:00', $result['to_date']);\n $this->assertEquals([201, 202], $result['call_deal_stage']);\n $this->assertEquals([301, 302], $result['current_deal_stage']);\n $this->assertEquals(1000, $result['deal_min_value']);\n $this->assertEquals(5000, $result['deal_max_value']);\n $this->assertEquals(['conference', 'dialer'], $result['call_types']);\n $this->assertEquals(600, $result['call_duration_min_seconds']);\n $this->assertEquals(1800, $result['call_duration_max_seconds']);\n $this->assertEquals('Focus on sales performance', $result['special_requirements']);\n $this->assertEquals($resultUuid, $result['request_id']);\n $this->assertEquals($callbackUrl, $result['callback_url']);\n $this->assertEquals('1 - 31 Jan 2023', $result['report_period']);\n $this->assertEquals(['category1', 'category2'], $result['playbook_categories']);\n $this->assertEquals('My Custom Report', $result['custom_name']);\n }\n\n /**\n * Test calculateFromAndToDate method with one-off frequency\n */\n public function testCalculateFromAndToDateWithOneOffFrequency(): void\n {\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n $report->method('getFrom')->willReturn(Carbon::parse('2023-01-01'));\n $report->method('getTo')->willReturn(Carbon::parse('2023-01-31'));\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('calculateFromAndToDate', $this->service, [$report]);\n\n // Verify result\n $this->assertInstanceOf(Carbon::class, $result['fromDate']);\n $this->assertInstanceOf(Carbon::class, $result['toDate']);\n $this->assertEquals('2023-01-01', $result['fromDate']->format('Y-m-d'));\n $this->assertEquals('2023-01-31', $result['toDate']->format('Y-m-d'));\n }\n\n /**\n * Test calculateFromAndToDate method with weekly frequency\n */\n public function testCalculateFromAndToDateWithWeeklyFrequency(): void\n {\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_WEEKLY);\n\n // Freeze time for testing\n Carbon::setTestNow(Carbon::parse('2023-02-15 14:30:00'));\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('calculateFromAndToDate', $this->service, [$report]);\n\n // Verify result\n $this->assertInstanceOf(Carbon::class, $result['fromDate']);\n $this->assertInstanceOf(Carbon::class, $result['toDate']);\n $this->assertEquals('2023-02-05 00:00:00', $result['fromDate']->format('Y-m-d H:i:s'));\n $this->assertEquals('2023-02-11 23:59:59', $result['toDate']->format('Y-m-d H:i:s'));\n\n // Reset frozen time\n Carbon::setTestNow();\n }\n\n /**\n * Test calculateFromAndToDate method with monthly frequency\n */\n public function testCalculateFromAndToDateWithMonthlyFrequency(): void\n {\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n\n // Freeze time for testing\n Carbon::setTestNow(Carbon::parse('2023-02-15 14:30:00'));\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('calculateFromAndToDate', $this->service, [$report]);\n\n // Verify result\n $this->assertInstanceOf(Carbon::class, $result['fromDate']);\n $this->assertInstanceOf(Carbon::class, $result['toDate']);\n $this->assertEquals('2023-01-01 00:00:00', $result['fromDate']->format('Y-m-d H:i:s'));\n $this->assertEquals('2023-01-31 23:59:59', $result['toDate']->format('Y-m-d H:i:s'));\n\n // Reset frozen time\n Carbon::setTestNow();\n }\n\n /**\n * Test calculateFromAndToDate method with quarterly frequency\n */\n public function testCalculateFromAndToDateWithQuarterlyFrequency(): void\n {\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_QUARTERLY);\n\n // Freeze time for testing\n Carbon::setTestNow(Carbon::parse('2023-02-15 14:30:00'));\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('calculateFromAndToDate', $this->service, [$report]);\n\n // Verify result\n $this->assertInstanceOf(Carbon::class, $result['fromDate']);\n $this->assertInstanceOf(Carbon::class, $result['toDate']);\n $this->assertEquals('2022-10-01 00:00:00', $result['fromDate']->format('Y-m-d H:i:s'));\n $this->assertEquals('2022-12-31 23:59:59', $result['toDate']->format('Y-m-d H:i:s'));\n\n // Reset frozen time\n Carbon::setTestNow();\n }\n\n /**\n * Test calculateFromAndToDate method with invalid frequency\n */\n public function testCalculateFromAndToDateWithInvalidFrequency(): void\n {\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getFrequency')->willReturn('invalid_frequency');\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Unsupported frequency: invalid_frequency');\n\n // Access private method using reflection\n self::invokePrivateMethod('calculateFromAndToDate', $this->service, [$report]);\n }\n\n /**\n * Test getCallbackUrl method\n */\n public function testGetCallbackUrl(): void\n {\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n // Set up webhook service to return callback URL\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('getCallbackUrl', $this->service, []);\n\n // Verify result\n $this->assertEquals($callbackUrl, $result);\n }\n\n /**\n * Test validateDealValues method\n */\n public function testValidateDealValues(): void\n {\n $data = [\n 'min_deal_value' => 1000,\n 'max_deal_value' => 5000,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(1000, $result['deal_value_min']);\n $this->assertEquals(5000, $result['deal_value_max']);\n }\n\n /**\n * Test validateDealValues method with min value only\n */\n public function testValidateDealValuesWithMinValueOnly(): void\n {\n $data = [\n 'min_deal_value' => 1000,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(1000, $result['deal_value_min']);\n $this->assertArrayNotHasKey('deal_value_max', $result);\n }\n\n /**\n * Test validateDealValues method with max value only\n */\n public function testValidateDealValuesWithMaxValueOnly(): void\n {\n $data = [\n 'max_deal_value' => 5000,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(5000, $result['deal_value_max']);\n $this->assertArrayNotHasKey('deal_value_min', $result);\n }\n\n /**\n * Test validateDealValues method with min value too large\n */\n public function testValidateDealValuesWithMinValueTooLarge(): void\n {\n $data = [\n 'min_deal_value' => 5000000000, // Larger than 4294967295 (max uint)\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Min deal value should be between 0 and 4294967295');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n }\n\n /**\n * Test validateDealValues method with max value too large\n */\n public function testValidateDealValuesWithMaxValueTooLarge(): void\n {\n $data = [\n 'max_deal_value' => 5000000000, // Larger than 4294967295 (max uint)\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Max deal value should be between 0 and 4294967295');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n }\n\n /**\n * Test validateDealValues method with min value negative\n */\n public function testValidateDealValuesWithMinValueNegative(): void\n {\n $data = [\n 'min_deal_value' => -1000,\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Min deal value should be between 0 and 4294967295');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n }\n\n /**\n * Test validateDealValues method with min value greater than max value\n */\n public function testValidateDealValuesWithMinValueGreaterThanMaxValue(): void\n {\n $data = [\n 'min_deal_value' => 5000,\n 'max_deal_value' => 1000,\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Min deal value cannot be greater than max deal value');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n }\n\n /**\n * Test validateDateRange method with one-off frequency\n */\n public function testValidateDateRangeWithOneOffFrequency(): void\n {\n // Create a stub for the parseDate method using the TestPrivateMethod trait\n $parseDateStub = static function ($dateString) {\n if ($dateString === '2023-01-01') {\n return '2023-01-01 00:00:00';\n }\n\n if ($dateString === '2023-01-31') {\n return '2023-01-31 00:00:00';\n }\n\n return null;\n };\n\n // Set up test data\n $data = [\n 'start_date_period' => '2023-01-01',\n 'end_date_period' => '2023-01-31',\n ];\n\n // Manually perform the operations that validateDateRange would do\n // This avoids the need to mock private methods\n $result = [\n 'from' => $parseDateStub($data['start_date_period']),\n 'to' => $parseDateStub($data['end_date_period']),\n ];\n\n // Verify result\n $this->assertEquals('2023-01-01 00:00:00', $result['from']);\n $this->assertEquals('2023-01-31 00:00:00', $result['to']);\n }\n\n /**\n * Test validateDateRange method with one-off frequency and missing dates\n */\n public function testValidateDateRangeWithOneOffFrequencyAndMissingDates(): void\n {\n $data = [];\n $reportData = [];\n $frequency = 'one_off';\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Start date and end date are required for one_off frequency');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateDateRange', $this->service, [$data, $reportData, $frequency]);\n }\n\n /**\n * Test validateDateRange method with non-one-off frequency\n */\n public function testValidateDateRangeWithNonOneOffFrequency(): void\n {\n $data = [\n 'start_date_period' => '2023-01-01',\n 'end_date_period' => '2023-01-31',\n ];\n\n $reportData = [];\n $frequency = 'weekly';\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateDateRange', $this->service, [$data, $reportData, $frequency]);\n\n // Verify result\n $this->assertNull($result['from']);\n $this->assertNull($result['to']);\n }\n\n /**\n * Test validateCallDurations method\n */\n public function testValidateCallDurations(): void\n {\n $data = [\n 'min_call_duration' => 10,\n 'max_call_duration' => 30,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateCallDurations', $this->service, [$data, $reportData]);\n\n // Verify result (minutes converted to seconds)\n $this->assertEquals(600, $result['call_duration_min']);\n $this->assertEquals(1800, $result['call_duration_max']);\n }\n\n /**\n * Test validateCallDurations method with min duration only\n */\n public function testValidateCallDurationsWithMinDurationOnly(): void\n {\n $data = [\n 'min_call_duration' => 10,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateCallDurations', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(600, $result['call_duration_min']);\n $this->assertArrayNotHasKey('call_duration_max', $result);\n }\n\n /**\n * Test validateCallDurations method with max duration only\n */\n public function testValidateCallDurationsWithMaxDurationOnly(): void\n {\n $data = [\n 'max_call_duration' => 30,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateCallDurations', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(1800, $result['call_duration_max']);\n $this->assertArrayNotHasKey('call_duration_min', $result);\n }\n\n /**\n * Test validateCallDurations method with min duration too large\n */\n public function testValidateCallDurationsWithMinDurationTooLarge(): void\n {\n $data = [\n 'min_call_duration' => 100000000, // Too large when converted to seconds\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Min call duration should be between 0 and 4294967295');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateCallDurations', $this->service, [$data, $reportData]);\n }\n\n /**\n * Test validateCallTypes method\n */\n public function testValidateCallTypes(): void\n {\n $data = [\n 'call_type' => ['conference'],\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateCallTypes', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(['conference'], $result['call_types']);\n }\n\n /**\n * Test validateCallTypes method with empty call types\n */\n public function testValidateCallTypesWithEmptyCallTypes(): void\n {\n $data = [];\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateCallTypes', $this->service, [$data, $reportData]);\n\n // Verify the result (should default to all call types)\n $this->assertEquals(['conference', 'dialer'], $result['call_types']);\n }\n\n /**\n * Test validateCallTypes method with an invalid call type\n */\n public function testValidateCallTypesWithInvalidCallType(): void\n {\n $data = [\n 'call_type' => ['invalid_call_type'],\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Call type invalid_call_type is invalid');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateCallTypes', $this->service, [$data, $reportData]);\n }\n\n private function getService($dispatcher): AutomatedReportsService\n {\n return new AutomatedReportsService(\n $this->createMock(TeamRepository::class),\n $this->createMock(GroupRepository::class),\n $this->createMock(UserRepository::class),\n $this->createMock(StageRepository::class),\n $this->createMock(DealStagesService::class),\n $this->createMock(RecipientsService::class),\n $this->createMock(AutomatedReportsRepository::class),\n $this->createMock(Webhook::class),\n $dispatcher,\n $this->createMock(ActivityTypeService::class),\n $this->createMock(PlaybookCategoryRepository::class),\n $this->createMock(AskAnythingPromptService::class),\n $this->createMock(SearchRepository::class),\n $this->createMock(AskAnythingRepository::class),\n );\n }\n\n /**\n * Test generateOneOffReport method when status is false\n */\n public function testGenerateOneOffReportWithInactiveStatus(): void\n {\n // Create mock for BusDispatcher\n $dispatcher = $this->createMock(BusDispatcher::class);\n\n // Create service instance with mocked dependencies\n $service = $this->getService($dispatcher);\n\n // Mock report with inactive status\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getStatus')->willReturn(false);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n\n // Dispatcher should not be called\n $dispatcher->expects($this->never())\n ->method('dispatch');\n\n // Call the private method\n self::invokePrivateMethod('generateOneOffReport', $service, [$report]);\n }\n\n /**\n * Test generateOneOffReport method when frequency is not one-off\n */\n public function testGenerateOneOffReportWithNonOneOffFrequency(): void\n {\n // Create mock for BusDispatcher\n $dispatcher = $this->createMock(BusDispatcher::class);\n\n // Create service instance with mocked dependencies\n $service = $this->getService($dispatcher);\n\n // Mock report with active status but non-one-off frequency\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getStatus')->willReturn(true);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_WEEKLY);\n\n // Dispatcher should not be called\n $dispatcher->expects($this->never())\n ->method('dispatch');\n\n // Call the private method\n self::invokePrivateMethod('generateOneOffReport', $service, [$report]);\n }\n\n /**\n * Test generateOneOffReport method when conditions are met\n */\n public function testGenerateOneOffReportWithValidConditions(): void\n {\n // Create mock for BusDispatcher\n $dispatcher = $this->createMock(BusDispatcher::class);\n\n // Create service instance with mocked dependencies\n $service = $this->getService($dispatcher);\n\n // Mock report with active status and one-off frequency\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getStatus')->willReturn(true);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n $report->method('getUuid')->willReturn('test-uuid');\n\n // Dispatcher should be called once with RequestGenerateReportJob\n $dispatcher->expects($this->once())\n ->method('dispatch')\n ->with($this->callback(function ($job) {\n return $job instanceof \\Jiminny\\Jobs\\AutomatedReports\\RequestGenerateReportJob\n && $job->uniqueId() === 'test-uuid';\n }));\n\n // Call the private method\n self::invokePrivateMethod('generateOneOffReport', $service, [$report]);\n }\n\n public function testCreateReportResult(): void\n {\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getId')->willReturn(1);\n\n $expectedResult = $this->createMock(AutomatedReportResult::class);\n\n $this->automatedReportsRepository->expects($this->once())\n ->method('createResult')\n ->with([\n 'report_id' => 1,\n 'status' => AutomatedReportResult::STATUS_DEFAULT,\n 'media_type' => 'pdf',\n ])\n ->willReturn($expectedResult);\n\n $result = $this->service->createReportResult($report, ['media_type' => 'pdf']);\n\n $this->assertSame($expectedResult, $result);\n }\n\n public function testFindChildResult(): void\n {\n $parentResult = $this->createMock(AutomatedReportResult::class);\n $childResult = $this->createMock(AutomatedReportResult::class);\n $type = AutomatedReportsService::MEDIA_TYPE_PODCAST;\n\n $this->automatedReportsRepository->expects($this->once())\n ->method('findChildResult')\n ->with($parentResult, $type)\n ->willReturn($childResult);\n\n $result = $this->service->findChildResult($parentResult, $type);\n\n $this->assertSame($childResult, $result);\n }\n\n public function testGetGenerateReportPayloadWithWeeklyFrequencyUsesFullDays(): void\n {\n $resultUuid = 'result-uuid';\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n Carbon::setTestNow(Carbon::parse('2026-01-20 14:30:00'));\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getTeamId')->willReturn(1);\n $report->method('getGroups')->willReturn([]);\n $report->method('getType')->willReturn('exec_summary');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_WEEKLY);\n $report->method('getFrom')->willReturn(null);\n $report->method('getTo')->willReturn(null);\n $report->method('getDealAtCallStages')->willReturn([]);\n $report->method('getCurrentDealStages')->willReturn([]);\n $report->method('getDealValueMin')->willReturn(null);\n $report->method('getDealValueMax')->willReturn(null);\n $report->method('getCallTypes')->willReturn(['conference']);\n $report->method('getCallDurationMin')->willReturn(null);\n $report->method('getCallDurationMax')->willReturn(null);\n $report->method('getAdditionalPromptInput')->willReturn(null);\n $report->method('getPlaybookCategories')->willReturn([]);\n $report->method('getMediaTypes')->willReturn(['pdf']);\n\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n $result = $this->service->getGenerateReportPayload($report, $resultUuid);\n\n $this->assertEquals('2026-01-11T00:00:00+00:00', $result['from_date']);\n $this->assertEquals('2026-01-17T23:59:59+00:00', $result['to_date']);\n\n Carbon::setTestNow();\n }\n\n public function testGetGenerateReportPayloadWithMonthlyFrequencyUsesFullDays(): void\n {\n $resultUuid = 'result-uuid';\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n Carbon::setTestNow(Carbon::parse('2026-01-20 05:00:00'));\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getTeamId')->willReturn(1);\n $report->method('getGroups')->willReturn([]);\n $report->method('getType')->willReturn('exec_summary');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n $report->method('getFrom')->willReturn(null);\n $report->method('getTo')->willReturn(null);\n $report->method('getDealAtCallStages')->willReturn([]);\n $report->method('getCurrentDealStages')->willReturn([]);\n $report->method('getDealValueMin')->willReturn(null);\n $report->method('getDealValueMax')->willReturn(null);\n $report->method('getCallTypes')->willReturn(['conference']);\n $report->method('getCallDurationMin')->willReturn(null);\n $report->method('getCallDurationMax')->willReturn(null);\n $report->method('getAdditionalPromptInput')->willReturn(null);\n $report->method('getPlaybookCategories')->willReturn([]);\n $report->method('getMediaTypes')->willReturn(['pdf']);\n\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n $result = $this->service->getGenerateReportPayload($report, $resultUuid);\n\n $this->assertEquals('2025-12-01T00:00:00+00:00', $result['from_date']);\n $this->assertEquals('2025-12-31T23:59:59+00:00', $result['to_date']);\n\n Carbon::setTestNow();\n }\n\n public function testGetGenerateReportPayloadWithQuarterlyFrequencyUsesFullDays(): void\n {\n $resultUuid = 'result-uuid';\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n Carbon::setTestNow(Carbon::parse('2026-01-20 05:00:00'));\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getTeamId')->willReturn(1);\n $report->method('getGroups')->willReturn([]);\n $report->method('getType')->willReturn('exec_summary');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_QUARTERLY);\n $report->method('getFrom')->willReturn(null);\n $report->method('getTo')->willReturn(null);\n $report->method('getDealAtCallStages')->willReturn([]);\n $report->method('getCurrentDealStages')->willReturn([]);\n $report->method('getDealValueMin')->willReturn(null);\n $report->method('getDealValueMax')->willReturn(null);\n $report->method('getCallTypes')->willReturn(['conference']);\n $report->method('getCallDurationMin')->willReturn(null);\n $report->method('getCallDurationMax')->willReturn(null);\n $report->method('getAdditionalPromptInput')->willReturn(null);\n $report->method('getPlaybookCategories')->willReturn([]);\n $report->method('getMediaTypes')->willReturn(['pdf']);\n\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n $result = $this->service->getGenerateReportPayload($report, $resultUuid);\n\n $this->assertEquals('2025-10-01T00:00:00+00:00', $result['from_date']);\n $this->assertEquals('2025-12-31T23:59:59+00:00', $result['to_date']);\n\n Carbon::setTestNow();\n }\n\n public function testGetGenerateReportPayloadOneOffIncludesCallsOnFinalDay(): void\n {\n $resultUuid = 'result-uuid';\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getTeamId')->willReturn(1);\n $report->method('getGroups')->willReturn([]);\n $report->method('getType')->willReturn('exec_summary');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n $report->method('getFrom')->willReturn(Carbon::parse('2026-01-01 00:00:00'));\n $report->method('getTo')->willReturn(Carbon::parse('2026-01-20 00:00:00'));\n $report->method('getDealAtCallStages')->willReturn([]);\n $report->method('getCurrentDealStages')->willReturn([]);\n $report->method('getDealValueMin')->willReturn(null);\n $report->method('getDealValueMax')->willReturn(null);\n $report->method('getCallTypes')->willReturn(['conference']);\n $report->method('getCallDurationMin')->willReturn(null);\n $report->method('getCallDurationMax')->willReturn(null);\n $report->method('getAdditionalPromptInput')->willReturn(null);\n $report->method('getPlaybookCategories')->willReturn([]);\n $report->method('getMediaTypes')->willReturn(['pdf']);\n\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n $result = $this->service->getGenerateReportPayload($report, $resultUuid);\n\n $this->assertEquals('2026-01-01T00:00:00+00:00', $result['from_date']);\n $this->assertEquals('2026-01-20T23:59:59+00:00', $result['to_date']);\n }\n\n public function testUpdateResultNamesIsCalledWhenCustomNameChanges(): void\n {\n $reportUuid = 'report-uuid';\n\n $team = $this->createMock(\\Jiminny\\Models\\Team::class);\n $team->method('getId')->willReturn(1);\n $team->method('hasFeature')->willReturn(true);\n $this->teamRepository->method('idOrUuid')->willReturn($team);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getCustomName')->willReturn('Old Name');\n $report->method('getUuid')->willReturn($reportUuid);\n $report->method('getStatus')->willReturn(false);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n\n $updatedReportTeam = $this->createMock(\\Jiminny\\Models\\Team::class);\n\n $updatedReport = $this->createMock(AutomatedReport::class);\n $updatedReport->method('getCustomName')->willReturn('New Name');\n $updatedReport->method('getStatus')->willReturn(false);\n $updatedReport->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n $updatedReport->method('getType')->willReturn('exec_summary');\n $updatedReport->method('getTeam')->willReturn($updatedReportTeam);\n $updatedReport->method('getUuid')->willReturn('report-uuid');\n $updatedReport->method('getFrom')->willReturn(null);\n $updatedReport->method('getTo')->willReturn(null);\n $updatedReport->method('getDealValueMin')->willReturn(null);\n $updatedReport->method('getDealValueMax')->willReturn(null);\n $updatedReport->method('getCallTypes')->willReturn([]);\n $updatedReport->method('getMediaTypes')->willReturn([AutomatedReportsService::MEDIA_TYPE_PDF]);\n $updatedReport->method('getCallDurationMin')->willReturn(null);\n $updatedReport->method('getCallDurationMax')->willReturn(null);\n $updatedReport->method('getGroups')->willReturn([]);\n $updatedReport->method('getDealAtCallStages')->willReturn([]);\n $updatedReport->method('getCurrentDealStages')->willReturn([]);\n $updatedReport->method('getRecipients')->willReturn(['users' => []]);\n $updatedReport->method('getCreator')->willReturn(null);\n $updatedReport->method('getAdditionalPromptInput')->willReturn(null);\n $updatedReport->method('getCreatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getUpdatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getDeletedAt')->willReturn(null);\n\n $result1 = $this->createMock(AutomatedReportResult::class);\n $result1->method('getReport')->willReturn($updatedReport);\n $result1->method('getFromDate')->willReturn(Carbon::parse('2025-05-01'));\n $result1->method('getToDate')->willReturn(Carbon::parse('2025-05-31'));\n $result1->method('getGroups')->willReturn([]);\n $result1->method('getMediaType')->willReturn(AutomatedReportsService::MEDIA_TYPE_PDF);\n $result1->expects($this->once())\n ->method('update')\n ->with(['name' => 'New Name - May 2025']);\n\n $results = new \\Illuminate\\Database\\Eloquent\\Collection([$result1]);\n\n $this->automatedReportsRepository->method('findByUuid')->willReturn($report);\n $this->automatedReportsRepository->method('update')->willReturn($updatedReport);\n $this->automatedReportsRepository->expects($this->once())\n ->method('getResultsByReport')\n ->with($updatedReport)\n ->willReturn($results);\n\n $this->service->update($reportUuid, $this->buildMinimalUpdatePayload());\n }\n\n public function testUpdateResultNamesIsNotCalledWhenCustomNameUnchanged(): void\n {\n $reportUuid = 'report-uuid';\n\n $team = $this->createMock(\\Jiminny\\Models\\Team::class);\n $team->method('getId')->willReturn(1);\n $team->method('hasFeature')->willReturn(true);\n $this->teamRepository->method('idOrUuid')->willReturn($team);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getCustomName')->willReturn('Same Name');\n $report->method('getUuid')->willReturn($reportUuid);\n $report->method('getStatus')->willReturn(false);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n\n $updatedReportTeam = $this->createMock(\\Jiminny\\Models\\Team::class);\n\n $updatedReport = $this->createMock(AutomatedReport::class);\n $updatedReport->method('getCustomName')->willReturn('Same Name');\n $updatedReport->method('getStatus')->willReturn(false);\n $updatedReport->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n $updatedReport->method('getType')->willReturn('exec_summary');\n $updatedReport->method('getTeam')->willReturn($updatedReportTeam);\n $updatedReport->method('getUuid')->willReturn('report-uuid');\n $updatedReport->method('getFrom')->willReturn(null);\n $updatedReport->method('getTo')->willReturn(null);\n $updatedReport->method('getDealValueMin')->willReturn(null);\n $updatedReport->method('getDealValueMax')->willReturn(null);\n $updatedReport->method('getCallTypes')->willReturn([]);\n $updatedReport->method('getMediaTypes')->willReturn([AutomatedReportsService::MEDIA_TYPE_PDF]);\n $updatedReport->method('getCallDurationMin')->willReturn(null);\n $updatedReport->method('getCallDurationMax')->willReturn(null);\n $updatedReport->method('getGroups')->willReturn([]);\n $updatedReport->method('getDealAtCallStages')->willReturn([]);\n $updatedReport->method('getCurrentDealStages')->willReturn([]);\n $updatedReport->method('getRecipients')->willReturn(['users' => []]);\n $updatedReport->method('getCreator')->willReturn(null);\n $updatedReport->method('getAdditionalPromptInput')->willReturn(null);\n $updatedReport->method('getCreatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getUpdatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getDeletedAt')->willReturn(null);\n\n $this->automatedReportsRepository->method('findByUuid')->willReturn($report);\n $this->automatedReportsRepository->method('update')->willReturn($updatedReport);\n $this->automatedReportsRepository->expects($this->never())\n ->method('getResultsByReport');\n\n $this->service->update($reportUuid, $this->buildMinimalUpdatePayload());\n }\n\n public function testUpdateResultNamesRollbackToNoCustomNameIncludesTeams(): void\n {\n $reportUuid = 'report-uuid';\n\n $team = $this->createMock(\\Jiminny\\Models\\Team::class);\n $team->method('getId')->willReturn(1);\n $team->method('hasFeature')->willReturn(true);\n $this->teamRepository->method('idOrUuid')->willReturn($team);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getCustomName')->willReturn('Old Custom Name');\n $report->method('getUuid')->willReturn($reportUuid);\n $report->method('getStatus')->willReturn(false);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n\n $updatedReportTeam = $this->createMock(\\Jiminny\\Models\\Team::class);\n\n $updatedReport = $this->createMock(AutomatedReport::class);\n $updatedReport->method('getCustomName')->willReturn(null);\n $updatedReport->method('getStatus')->willReturn(false);\n $updatedReport->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n $updatedReport->method('getType')->willReturn('exec_summary');\n $updatedReport->method('getTeam')->willReturn($updatedReportTeam);\n $updatedReport->method('getUuid')->willReturn('report-uuid');\n $updatedReport->method('getFrom')->willReturn(null);\n $updatedReport->method('getTo')->willReturn(null);\n $updatedReport->method('getDealValueMin')->willReturn(null);\n $updatedReport->method('getDealValueMax')->willReturn(null);\n $updatedReport->method('getCallTypes')->willReturn([]);\n $updatedReport->method('getMediaTypes')->willReturn([AutomatedReportsService::MEDIA_TYPE_PDF]);\n $updatedReport->method('getCallDurationMin')->willReturn(null);\n $updatedReport->method('getCallDurationMax')->willReturn(null);\n $updatedReport->method('getGroups')->willReturn([]);\n $updatedReport->method('getDealAtCallStages')->willReturn([]);\n $updatedReport->method('getCurrentDealStages')->willReturn([]);\n $updatedReport->method('getRecipients')->willReturn(['users' => []]);\n $updatedReport->method('getCreator')->willReturn(null);\n $updatedReport->method('getAdditionalPromptInput')->willReturn(null);\n $updatedReport->method('getCreatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getUpdatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getDeletedAt')->willReturn(null);\n\n $result1 = $this->createMock(AutomatedReportResult::class);\n $result1->method('getReport')->willReturn($updatedReport);\n $result1->method('getFromDate')->willReturn(Carbon::parse('2025-05-01'));\n $result1->method('getToDate')->willReturn(Carbon::parse('2025-05-31'));\n $result1->method('getGroups')->willReturn([]);\n $result1->method('getMediaType')->willReturn(AutomatedReportsService::MEDIA_TYPE_PDF);\n $result1->expects($this->once())\n ->method('update')\n ->with(['name' => 'Exec Summary - May 2025 - All']);\n\n $results = new \\Illuminate\\Database\\Eloquent\\Collection([$result1]);\n\n $this->automatedReportsRepository->method('findByUuid')->willReturn($report);\n $this->automatedReportsRepository->method('update')->willReturn($updatedReport);\n $this->automatedReportsRepository->expects($this->once())\n ->method('getResultsByReport')\n ->with($updatedReport)\n ->willReturn($results);\n\n $this->service->update($reportUuid, $this->buildMinimalUpdatePayload());\n }\n\n private function buildMinimalUpdatePayload(): array\n {\n return [\n 'organization' => 'team-uuid',\n 'report_type' => 'exec_summary',\n 'report_enabled' => false,\n 'frequency' => AutomatedReportsService::FREQUENCY_MONTHLY,\n 'media_types' => [AutomatedReportsService::MEDIA_TYPE_PDF],\n ];\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Kiosk\\AutomatedReports;\n\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Support\\Carbon;\nuse InvalidArgumentException;\nuse Jiminny\\Component\\UrlGenerator\\Webhook;\nuse Jiminny\\Contracts\\Repositories\\PlaybookCategoryRepository;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Repositories\\GroupRepository;\nuse Jiminny\\Repositories\\StageRepository;\nuse Jiminny\\Repositories\\TeamRepository;\nuse Jiminny\\Repositories\\UserRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\ActivityTypeService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\DealStagesService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\RecipientsService;\nuse Jiminny\\Component\\AskAnything\\AskAnythingPromptService;\nuse Jiminny\\Repositories\\SearchRepository;\nuse Jiminny\\Repositories\\AskAnythingRepository;\nuse Tests\\TestCase;\nuse Tests\\Unit\\Traits\\TestPrivateMethod;\n\nclass AutomatedReportsServiceReportGenerationTest extends TestCase\n{\n use TestPrivateMethod;\n\n private AutomatedReportsService $service;\n private Webhook $webhookService;\n private AutomatedReportsRepository $automatedReportsRepository;\n private TeamRepository $teamRepository;\n\n protected function setUp(): void\n {\n parent::setUp();\n\n // Create mocks for dependencies\n $this->teamRepository = $this->createMock(TeamRepository::class);\n $teamRepository = $this->teamRepository;\n $groupRepository = $this->createMock(GroupRepository::class);\n $userRepository = $this->createMock(UserRepository::class);\n $stageRepository = $this->createMock(StageRepository::class);\n $dealStagesService = $this->createMock(DealStagesService::class);\n $recipientsService = $this->createMock(RecipientsService::class);\n $this->automatedReportsRepository = $this->createMock(AutomatedReportsRepository::class);\n $this->webhookService = $this->createMock(Webhook::class);\n $dispatcher = $this->createMock(BusDispatcher::class);\n $activityTypeService = $this->createMock(ActivityTypeService::class);\n $playbookCategoryRepository = $this->createMock(PlaybookCategoryRepository::class);\n\n // Create service instance with mocked dependencies\n $this->service = new AutomatedReportsService(\n $teamRepository,\n $groupRepository,\n $userRepository,\n $stageRepository,\n $dealStagesService,\n $recipientsService,\n $this->automatedReportsRepository,\n $this->webhookService,\n $dispatcher,\n $activityTypeService,\n $playbookCategoryRepository,\n $this->createMock(AskAnythingPromptService::class),\n $this->createMock(SearchRepository::class),\n $this->createMock(AskAnythingRepository::class),\n );\n }\n\n /**\n * Test getGenerateReportPayload method with one-off frequency\n */\n public function testGetGenerateReportPayloadWithOneOffFrequency(): void\n {\n $reportUuid = 'report-uuid';\n $resultUuid = 'result-uuid';\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getTeamId')->willReturn(1);\n $report->method('getGroups')->willReturn([101, 102]);\n $report->method('getType')->willReturn('exec_summary');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n $report->method('getFrom')->willReturn(Carbon::parse('2023-01-01'));\n $report->method('getTo')->willReturn(Carbon::parse('2023-01-31'));\n $report->method('getDealAtCallStages')->willReturn([201, 202]);\n $report->method('getCurrentDealStages')->willReturn([301, 302]);\n $report->method('getDealValueMin')->willReturn(1000);\n $report->method('getDealValueMax')->willReturn(5000);\n $report->method('getCallTypes')->willReturn(['conference', 'dialer']);\n $report->method('getCallDurationMin')->willReturn(600);\n $report->method('getCallDurationMax')->willReturn(1800);\n $report->method('getAdditionalPromptInput')->willReturn('Focus on sales performance');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n $report->method('getPlaybookCategories')->willReturn(['category1', 'category2']);\n $report->method('getCustomName')->willReturn('My Custom Report');\n\n $result = $this->createMock(AutomatedReportResult::class);\n $result->method('getFromDate')->willReturn(Carbon::parse('2023-01-01'));\n $result->method('getToDate')->willReturn(Carbon::parse('2023-01-31'));\n $result->method('getReport')->willReturn($report);\n\n $this->automatedReportsRepository->method('findResultByUuid')->willReturn($result);\n\n // Set up webhook service to return callback URL\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n // Call the method\n $result = $this->service->getGenerateReportPayload($report, $resultUuid);\n\n // Verify result\n $this->assertEquals(1, $result['team_id']);\n $this->assertEquals([101, 102], $result['group_ids']);\n $this->assertEquals('exec_summary', $result['report_type']);\n $this->assertEquals('2023-01-01T00:00:00+00:00', $result['from_date']);\n $this->assertEquals('2023-01-31T23:59:59+00:00', $result['to_date']);\n $this->assertEquals([201, 202], $result['call_deal_stage']);\n $this->assertEquals([301, 302], $result['current_deal_stage']);\n $this->assertEquals(1000, $result['deal_min_value']);\n $this->assertEquals(5000, $result['deal_max_value']);\n $this->assertEquals(['conference', 'dialer'], $result['call_types']);\n $this->assertEquals(600, $result['call_duration_min_seconds']);\n $this->assertEquals(1800, $result['call_duration_max_seconds']);\n $this->assertEquals('Focus on sales performance', $result['special_requirements']);\n $this->assertEquals($resultUuid, $result['request_id']);\n $this->assertEquals($callbackUrl, $result['callback_url']);\n $this->assertEquals('1 - 31 Jan 2023', $result['report_period']);\n $this->assertEquals(['category1', 'category2'], $result['playbook_categories']);\n $this->assertEquals('My Custom Report', $result['custom_name']);\n }\n\n /**\n * Test calculateFromAndToDate method with one-off frequency\n */\n public function testCalculateFromAndToDateWithOneOffFrequency(): void\n {\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n $report->method('getFrom')->willReturn(Carbon::parse('2023-01-01'));\n $report->method('getTo')->willReturn(Carbon::parse('2023-01-31'));\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('calculateFromAndToDate', $this->service, [$report]);\n\n // Verify result\n $this->assertInstanceOf(Carbon::class, $result['fromDate']);\n $this->assertInstanceOf(Carbon::class, $result['toDate']);\n $this->assertEquals('2023-01-01', $result['fromDate']->format('Y-m-d'));\n $this->assertEquals('2023-01-31', $result['toDate']->format('Y-m-d'));\n }\n\n /**\n * Test calculateFromAndToDate method with weekly frequency\n */\n public function testCalculateFromAndToDateWithWeeklyFrequency(): void\n {\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_WEEKLY);\n\n // Freeze time for testing\n Carbon::setTestNow(Carbon::parse('2023-02-15 14:30:00'));\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('calculateFromAndToDate', $this->service, [$report]);\n\n // Verify result\n $this->assertInstanceOf(Carbon::class, $result['fromDate']);\n $this->assertInstanceOf(Carbon::class, $result['toDate']);\n $this->assertEquals('2023-02-05 00:00:00', $result['fromDate']->format('Y-m-d H:i:s'));\n $this->assertEquals('2023-02-11 23:59:59', $result['toDate']->format('Y-m-d H:i:s'));\n\n // Reset frozen time\n Carbon::setTestNow();\n }\n\n /**\n * Test calculateFromAndToDate method with monthly frequency\n */\n public function testCalculateFromAndToDateWithMonthlyFrequency(): void\n {\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n\n // Freeze time for testing\n Carbon::setTestNow(Carbon::parse('2023-02-15 14:30:00'));\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('calculateFromAndToDate', $this->service, [$report]);\n\n // Verify result\n $this->assertInstanceOf(Carbon::class, $result['fromDate']);\n $this->assertInstanceOf(Carbon::class, $result['toDate']);\n $this->assertEquals('2023-01-01 00:00:00', $result['fromDate']->format('Y-m-d H:i:s'));\n $this->assertEquals('2023-01-31 23:59:59', $result['toDate']->format('Y-m-d H:i:s'));\n\n // Reset frozen time\n Carbon::setTestNow();\n }\n\n /**\n * Test calculateFromAndToDate method with quarterly frequency\n */\n public function testCalculateFromAndToDateWithQuarterlyFrequency(): void\n {\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_QUARTERLY);\n\n // Freeze time for testing\n Carbon::setTestNow(Carbon::parse('2023-02-15 14:30:00'));\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('calculateFromAndToDate', $this->service, [$report]);\n\n // Verify result\n $this->assertInstanceOf(Carbon::class, $result['fromDate']);\n $this->assertInstanceOf(Carbon::class, $result['toDate']);\n $this->assertEquals('2022-10-01 00:00:00', $result['fromDate']->format('Y-m-d H:i:s'));\n $this->assertEquals('2022-12-31 23:59:59', $result['toDate']->format('Y-m-d H:i:s'));\n\n // Reset frozen time\n Carbon::setTestNow();\n }\n\n /**\n * Test calculateFromAndToDate method with invalid frequency\n */\n public function testCalculateFromAndToDateWithInvalidFrequency(): void\n {\n // Mock report\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getFrequency')->willReturn('invalid_frequency');\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Unsupported frequency: invalid_frequency');\n\n // Access private method using reflection\n self::invokePrivateMethod('calculateFromAndToDate', $this->service, [$report]);\n }\n\n /**\n * Test getCallbackUrl method\n */\n public function testGetCallbackUrl(): void\n {\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n // Set up webhook service to return callback URL\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('getCallbackUrl', $this->service, []);\n\n // Verify result\n $this->assertEquals($callbackUrl, $result);\n }\n\n /**\n * Test validateDealValues method\n */\n public function testValidateDealValues(): void\n {\n $data = [\n 'min_deal_value' => 1000,\n 'max_deal_value' => 5000,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(1000, $result['deal_value_min']);\n $this->assertEquals(5000, $result['deal_value_max']);\n }\n\n /**\n * Test validateDealValues method with min value only\n */\n public function testValidateDealValuesWithMinValueOnly(): void\n {\n $data = [\n 'min_deal_value' => 1000,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(1000, $result['deal_value_min']);\n $this->assertArrayNotHasKey('deal_value_max', $result);\n }\n\n /**\n * Test validateDealValues method with max value only\n */\n public function testValidateDealValuesWithMaxValueOnly(): void\n {\n $data = [\n 'max_deal_value' => 5000,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(5000, $result['deal_value_max']);\n $this->assertArrayNotHasKey('deal_value_min', $result);\n }\n\n /**\n * Test validateDealValues method with min value too large\n */\n public function testValidateDealValuesWithMinValueTooLarge(): void\n {\n $data = [\n 'min_deal_value' => 5000000000, // Larger than 4294967295 (max uint)\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Min deal value should be between 0 and 4294967295');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n }\n\n /**\n * Test validateDealValues method with max value too large\n */\n public function testValidateDealValuesWithMaxValueTooLarge(): void\n {\n $data = [\n 'max_deal_value' => 5000000000, // Larger than 4294967295 (max uint)\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Max deal value should be between 0 and 4294967295');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n }\n\n /**\n * Test validateDealValues method with min value negative\n */\n public function testValidateDealValuesWithMinValueNegative(): void\n {\n $data = [\n 'min_deal_value' => -1000,\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Min deal value should be between 0 and 4294967295');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n }\n\n /**\n * Test validateDealValues method with min value greater than max value\n */\n public function testValidateDealValuesWithMinValueGreaterThanMaxValue(): void\n {\n $data = [\n 'min_deal_value' => 5000,\n 'max_deal_value' => 1000,\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Min deal value cannot be greater than max deal value');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateDealValues', $this->service, [$data, $reportData]);\n }\n\n /**\n * Test validateDateRange method with one-off frequency\n */\n public function testValidateDateRangeWithOneOffFrequency(): void\n {\n // Create a stub for the parseDate method using the TestPrivateMethod trait\n $parseDateStub = static function ($dateString) {\n if ($dateString === '2023-01-01') {\n return '2023-01-01 00:00:00';\n }\n\n if ($dateString === '2023-01-31') {\n return '2023-01-31 00:00:00';\n }\n\n return null;\n };\n\n // Set up test data\n $data = [\n 'start_date_period' => '2023-01-01',\n 'end_date_period' => '2023-01-31',\n ];\n\n // Manually perform the operations that validateDateRange would do\n // This avoids the need to mock private methods\n $result = [\n 'from' => $parseDateStub($data['start_date_period']),\n 'to' => $parseDateStub($data['end_date_period']),\n ];\n\n // Verify result\n $this->assertEquals('2023-01-01 00:00:00', $result['from']);\n $this->assertEquals('2023-01-31 00:00:00', $result['to']);\n }\n\n /**\n * Test validateDateRange method with one-off frequency and missing dates\n */\n public function testValidateDateRangeWithOneOffFrequencyAndMissingDates(): void\n {\n $data = [];\n $reportData = [];\n $frequency = 'one_off';\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Start date and end date are required for one_off frequency');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateDateRange', $this->service, [$data, $reportData, $frequency]);\n }\n\n /**\n * Test validateDateRange method with non-one-off frequency\n */\n public function testValidateDateRangeWithNonOneOffFrequency(): void\n {\n $data = [\n 'start_date_period' => '2023-01-01',\n 'end_date_period' => '2023-01-31',\n ];\n\n $reportData = [];\n $frequency = 'weekly';\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateDateRange', $this->service, [$data, $reportData, $frequency]);\n\n // Verify result\n $this->assertNull($result['from']);\n $this->assertNull($result['to']);\n }\n\n /**\n * Test validateCallDurations method\n */\n public function testValidateCallDurations(): void\n {\n $data = [\n 'min_call_duration' => 10,\n 'max_call_duration' => 30,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateCallDurations', $this->service, [$data, $reportData]);\n\n // Verify result (minutes converted to seconds)\n $this->assertEquals(600, $result['call_duration_min']);\n $this->assertEquals(1800, $result['call_duration_max']);\n }\n\n /**\n * Test validateCallDurations method with min duration only\n */\n public function testValidateCallDurationsWithMinDurationOnly(): void\n {\n $data = [\n 'min_call_duration' => 10,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateCallDurations', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(600, $result['call_duration_min']);\n $this->assertArrayNotHasKey('call_duration_max', $result);\n }\n\n /**\n * Test validateCallDurations method with max duration only\n */\n public function testValidateCallDurationsWithMaxDurationOnly(): void\n {\n $data = [\n 'max_call_duration' => 30,\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateCallDurations', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(1800, $result['call_duration_max']);\n $this->assertArrayNotHasKey('call_duration_min', $result);\n }\n\n /**\n * Test validateCallDurations method with min duration too large\n */\n public function testValidateCallDurationsWithMinDurationTooLarge(): void\n {\n $data = [\n 'min_call_duration' => 100000000, // Too large when converted to seconds\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Min call duration should be between 0 and 4294967295');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateCallDurations', $this->service, [$data, $reportData]);\n }\n\n /**\n * Test validateCallTypes method\n */\n public function testValidateCallTypes(): void\n {\n $data = [\n 'call_type' => ['conference'],\n ];\n\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateCallTypes', $this->service, [$data, $reportData]);\n\n // Verify result\n $this->assertEquals(['conference'], $result['call_types']);\n }\n\n /**\n * Test validateCallTypes method with empty call types\n */\n public function testValidateCallTypesWithEmptyCallTypes(): void\n {\n $data = [];\n $reportData = [];\n\n // Access private method using reflection\n $result = self::invokePrivateMethod('validateCallTypes', $this->service, [$data, $reportData]);\n\n // Verify the result (should default to all call types)\n $this->assertEquals(['conference', 'dialer'], $result['call_types']);\n }\n\n /**\n * Test validateCallTypes method with an invalid call type\n */\n public function testValidateCallTypesWithInvalidCallType(): void\n {\n $data = [\n 'call_type' => ['invalid_call_type'],\n ];\n\n $reportData = [];\n\n // Expect exception\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Call type invalid_call_type is invalid');\n\n // Access private method using reflection\n self::invokePrivateMethod('validateCallTypes', $this->service, [$data, $reportData]);\n }\n\n private function getService($dispatcher): AutomatedReportsService\n {\n return new AutomatedReportsService(\n $this->createMock(TeamRepository::class),\n $this->createMock(GroupRepository::class),\n $this->createMock(UserRepository::class),\n $this->createMock(StageRepository::class),\n $this->createMock(DealStagesService::class),\n $this->createMock(RecipientsService::class),\n $this->createMock(AutomatedReportsRepository::class),\n $this->createMock(Webhook::class),\n $dispatcher,\n $this->createMock(ActivityTypeService::class),\n $this->createMock(PlaybookCategoryRepository::class),\n $this->createMock(AskAnythingPromptService::class),\n $this->createMock(SearchRepository::class),\n $this->createMock(AskAnythingRepository::class),\n );\n }\n\n /**\n * Test generateOneOffReport method when status is false\n */\n public function testGenerateOneOffReportWithInactiveStatus(): void\n {\n // Create mock for BusDispatcher\n $dispatcher = $this->createMock(BusDispatcher::class);\n\n // Create service instance with mocked dependencies\n $service = $this->getService($dispatcher);\n\n // Mock report with inactive status\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getStatus')->willReturn(false);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n\n // Dispatcher should not be called\n $dispatcher->expects($this->never())\n ->method('dispatch');\n\n // Call the private method\n self::invokePrivateMethod('generateOneOffReport', $service, [$report]);\n }\n\n /**\n * Test generateOneOffReport method when frequency is not one-off\n */\n public function testGenerateOneOffReportWithNonOneOffFrequency(): void\n {\n // Create mock for BusDispatcher\n $dispatcher = $this->createMock(BusDispatcher::class);\n\n // Create service instance with mocked dependencies\n $service = $this->getService($dispatcher);\n\n // Mock report with active status but non-one-off frequency\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getStatus')->willReturn(true);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_WEEKLY);\n\n // Dispatcher should not be called\n $dispatcher->expects($this->never())\n ->method('dispatch');\n\n // Call the private method\n self::invokePrivateMethod('generateOneOffReport', $service, [$report]);\n }\n\n /**\n * Test generateOneOffReport method when conditions are met\n */\n public function testGenerateOneOffReportWithValidConditions(): void\n {\n // Create mock for BusDispatcher\n $dispatcher = $this->createMock(BusDispatcher::class);\n\n // Create service instance with mocked dependencies\n $service = $this->getService($dispatcher);\n\n // Mock report with active status and one-off frequency\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getStatus')->willReturn(true);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n $report->method('getUuid')->willReturn('test-uuid');\n\n // Dispatcher should be called once with RequestGenerateReportJob\n $dispatcher->expects($this->once())\n ->method('dispatch')\n ->with($this->callback(function ($job) {\n return $job instanceof \\Jiminny\\Jobs\\AutomatedReports\\RequestGenerateReportJob\n && $job->uniqueId() === 'test-uuid';\n }));\n\n // Call the private method\n self::invokePrivateMethod('generateOneOffReport', $service, [$report]);\n }\n\n public function testCreateReportResult(): void\n {\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getId')->willReturn(1);\n\n $expectedResult = $this->createMock(AutomatedReportResult::class);\n\n $this->automatedReportsRepository->expects($this->once())\n ->method('createResult')\n ->with([\n 'report_id' => 1,\n 'status' => AutomatedReportResult::STATUS_DEFAULT,\n 'media_type' => 'pdf',\n ])\n ->willReturn($expectedResult);\n\n $result = $this->service->createReportResult($report, ['media_type' => 'pdf']);\n\n $this->assertSame($expectedResult, $result);\n }\n\n public function testFindChildResult(): void\n {\n $parentResult = $this->createMock(AutomatedReportResult::class);\n $childResult = $this->createMock(AutomatedReportResult::class);\n $type = AutomatedReportsService::MEDIA_TYPE_PODCAST;\n\n $this->automatedReportsRepository->expects($this->once())\n ->method('findChildResult')\n ->with($parentResult, $type)\n ->willReturn($childResult);\n\n $result = $this->service->findChildResult($parentResult, $type);\n\n $this->assertSame($childResult, $result);\n }\n\n public function testGetGenerateReportPayloadWithWeeklyFrequencyUsesFullDays(): void\n {\n $resultUuid = 'result-uuid';\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n Carbon::setTestNow(Carbon::parse('2026-01-20 14:30:00'));\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getTeamId')->willReturn(1);\n $report->method('getGroups')->willReturn([]);\n $report->method('getType')->willReturn('exec_summary');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_WEEKLY);\n $report->method('getFrom')->willReturn(null);\n $report->method('getTo')->willReturn(null);\n $report->method('getDealAtCallStages')->willReturn([]);\n $report->method('getCurrentDealStages')->willReturn([]);\n $report->method('getDealValueMin')->willReturn(null);\n $report->method('getDealValueMax')->willReturn(null);\n $report->method('getCallTypes')->willReturn(['conference']);\n $report->method('getCallDurationMin')->willReturn(null);\n $report->method('getCallDurationMax')->willReturn(null);\n $report->method('getAdditionalPromptInput')->willReturn(null);\n $report->method('getPlaybookCategories')->willReturn([]);\n $report->method('getMediaTypes')->willReturn(['pdf']);\n\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n $result = $this->service->getGenerateReportPayload($report, $resultUuid);\n\n $this->assertEquals('2026-01-11T00:00:00+00:00', $result['from_date']);\n $this->assertEquals('2026-01-17T23:59:59+00:00', $result['to_date']);\n\n Carbon::setTestNow();\n }\n\n public function testGetGenerateReportPayloadWithMonthlyFrequencyUsesFullDays(): void\n {\n $resultUuid = 'result-uuid';\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n Carbon::setTestNow(Carbon::parse('2026-01-20 05:00:00'));\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getTeamId')->willReturn(1);\n $report->method('getGroups')->willReturn([]);\n $report->method('getType')->willReturn('exec_summary');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n $report->method('getFrom')->willReturn(null);\n $report->method('getTo')->willReturn(null);\n $report->method('getDealAtCallStages')->willReturn([]);\n $report->method('getCurrentDealStages')->willReturn([]);\n $report->method('getDealValueMin')->willReturn(null);\n $report->method('getDealValueMax')->willReturn(null);\n $report->method('getCallTypes')->willReturn(['conference']);\n $report->method('getCallDurationMin')->willReturn(null);\n $report->method('getCallDurationMax')->willReturn(null);\n $report->method('getAdditionalPromptInput')->willReturn(null);\n $report->method('getPlaybookCategories')->willReturn([]);\n $report->method('getMediaTypes')->willReturn(['pdf']);\n\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n $result = $this->service->getGenerateReportPayload($report, $resultUuid);\n\n $this->assertEquals('2025-12-01T00:00:00+00:00', $result['from_date']);\n $this->assertEquals('2025-12-31T23:59:59+00:00', $result['to_date']);\n\n Carbon::setTestNow();\n }\n\n public function testGetGenerateReportPayloadWithQuarterlyFrequencyUsesFullDays(): void\n {\n $resultUuid = 'result-uuid';\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n Carbon::setTestNow(Carbon::parse('2026-01-20 05:00:00'));\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getTeamId')->willReturn(1);\n $report->method('getGroups')->willReturn([]);\n $report->method('getType')->willReturn('exec_summary');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_QUARTERLY);\n $report->method('getFrom')->willReturn(null);\n $report->method('getTo')->willReturn(null);\n $report->method('getDealAtCallStages')->willReturn([]);\n $report->method('getCurrentDealStages')->willReturn([]);\n $report->method('getDealValueMin')->willReturn(null);\n $report->method('getDealValueMax')->willReturn(null);\n $report->method('getCallTypes')->willReturn(['conference']);\n $report->method('getCallDurationMin')->willReturn(null);\n $report->method('getCallDurationMax')->willReturn(null);\n $report->method('getAdditionalPromptInput')->willReturn(null);\n $report->method('getPlaybookCategories')->willReturn([]);\n $report->method('getMediaTypes')->willReturn(['pdf']);\n\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n $result = $this->service->getGenerateReportPayload($report, $resultUuid);\n\n $this->assertEquals('2025-10-01T00:00:00+00:00', $result['from_date']);\n $this->assertEquals('2025-12-31T23:59:59+00:00', $result['to_date']);\n\n Carbon::setTestNow();\n }\n\n public function testGetGenerateReportPayloadOneOffIncludesCallsOnFinalDay(): void\n {\n $resultUuid = 'result-uuid';\n $callbackUrl = 'https://example.com/webhook/reports/ready';\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getTeamId')->willReturn(1);\n $report->method('getGroups')->willReturn([]);\n $report->method('getType')->willReturn('exec_summary');\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_ONE_OFF);\n $report->method('getFrom')->willReturn(Carbon::parse('2026-01-01 00:00:00'));\n $report->method('getTo')->willReturn(Carbon::parse('2026-01-20 00:00:00'));\n $report->method('getDealAtCallStages')->willReturn([]);\n $report->method('getCurrentDealStages')->willReturn([]);\n $report->method('getDealValueMin')->willReturn(null);\n $report->method('getDealValueMax')->willReturn(null);\n $report->method('getCallTypes')->willReturn(['conference']);\n $report->method('getCallDurationMin')->willReturn(null);\n $report->method('getCallDurationMax')->willReturn(null);\n $report->method('getAdditionalPromptInput')->willReturn(null);\n $report->method('getPlaybookCategories')->willReturn([]);\n $report->method('getMediaTypes')->willReturn(['pdf']);\n\n $this->webhookService->expects($this->once())\n ->method('route')\n ->with('jiminny.webhook.reports.ready')\n ->willReturn($callbackUrl);\n\n $result = $this->service->getGenerateReportPayload($report, $resultUuid);\n\n $this->assertEquals('2026-01-01T00:00:00+00:00', $result['from_date']);\n $this->assertEquals('2026-01-20T23:59:59+00:00', $result['to_date']);\n }\n\n public function testUpdateResultNamesIsCalledWhenCustomNameChanges(): void\n {\n $reportUuid = 'report-uuid';\n\n $team = $this->createMock(\\Jiminny\\Models\\Team::class);\n $team->method('getId')->willReturn(1);\n $team->method('hasFeature')->willReturn(true);\n $this->teamRepository->method('idOrUuid')->willReturn($team);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getCustomName')->willReturn('Old Name');\n $report->method('getUuid')->willReturn($reportUuid);\n $report->method('getStatus')->willReturn(false);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n\n $updatedReportTeam = $this->createMock(\\Jiminny\\Models\\Team::class);\n\n $updatedReport = $this->createMock(AutomatedReport::class);\n $updatedReport->method('getCustomName')->willReturn('New Name');\n $updatedReport->method('getStatus')->willReturn(false);\n $updatedReport->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n $updatedReport->method('getType')->willReturn('exec_summary');\n $updatedReport->method('getTeam')->willReturn($updatedReportTeam);\n $updatedReport->method('getUuid')->willReturn('report-uuid');\n $updatedReport->method('getFrom')->willReturn(null);\n $updatedReport->method('getTo')->willReturn(null);\n $updatedReport->method('getDealValueMin')->willReturn(null);\n $updatedReport->method('getDealValueMax')->willReturn(null);\n $updatedReport->method('getCallTypes')->willReturn([]);\n $updatedReport->method('getMediaTypes')->willReturn([AutomatedReportsService::MEDIA_TYPE_PDF]);\n $updatedReport->method('getCallDurationMin')->willReturn(null);\n $updatedReport->method('getCallDurationMax')->willReturn(null);\n $updatedReport->method('getGroups')->willReturn([]);\n $updatedReport->method('getDealAtCallStages')->willReturn([]);\n $updatedReport->method('getCurrentDealStages')->willReturn([]);\n $updatedReport->method('getRecipients')->willReturn(['users' => []]);\n $updatedReport->method('getCreator')->willReturn(null);\n $updatedReport->method('getAdditionalPromptInput')->willReturn(null);\n $updatedReport->method('getCreatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getUpdatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getDeletedAt')->willReturn(null);\n\n $result1 = $this->createMock(AutomatedReportResult::class);\n $result1->method('getReport')->willReturn($updatedReport);\n $result1->method('getFromDate')->willReturn(Carbon::parse('2025-05-01'));\n $result1->method('getToDate')->willReturn(Carbon::parse('2025-05-31'));\n $result1->method('getGroups')->willReturn([]);\n $result1->method('getMediaType')->willReturn(AutomatedReportsService::MEDIA_TYPE_PDF);\n $result1->expects($this->once())\n ->method('update')\n ->with(['name' => 'New Name - May 2025']);\n\n $results = new \\Illuminate\\Database\\Eloquent\\Collection([$result1]);\n\n $this->automatedReportsRepository->method('findByUuid')->willReturn($report);\n $this->automatedReportsRepository->method('update')->willReturn($updatedReport);\n $this->automatedReportsRepository->expects($this->once())\n ->method('getResultsByReport')\n ->with($updatedReport)\n ->willReturn($results);\n\n $this->service->update($reportUuid, $this->buildMinimalUpdatePayload());\n }\n\n public function testUpdateResultNamesIsNotCalledWhenCustomNameUnchanged(): void\n {\n $reportUuid = 'report-uuid';\n\n $team = $this->createMock(\\Jiminny\\Models\\Team::class);\n $team->method('getId')->willReturn(1);\n $team->method('hasFeature')->willReturn(true);\n $this->teamRepository->method('idOrUuid')->willReturn($team);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getCustomName')->willReturn('Same Name');\n $report->method('getUuid')->willReturn($reportUuid);\n $report->method('getStatus')->willReturn(false);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n\n $updatedReportTeam = $this->createMock(\\Jiminny\\Models\\Team::class);\n\n $updatedReport = $this->createMock(AutomatedReport::class);\n $updatedReport->method('getCustomName')->willReturn('Same Name');\n $updatedReport->method('getStatus')->willReturn(false);\n $updatedReport->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n $updatedReport->method('getType')->willReturn('exec_summary');\n $updatedReport->method('getTeam')->willReturn($updatedReportTeam);\n $updatedReport->method('getUuid')->willReturn('report-uuid');\n $updatedReport->method('getFrom')->willReturn(null);\n $updatedReport->method('getTo')->willReturn(null);\n $updatedReport->method('getDealValueMin')->willReturn(null);\n $updatedReport->method('getDealValueMax')->willReturn(null);\n $updatedReport->method('getCallTypes')->willReturn([]);\n $updatedReport->method('getMediaTypes')->willReturn([AutomatedReportsService::MEDIA_TYPE_PDF]);\n $updatedReport->method('getCallDurationMin')->willReturn(null);\n $updatedReport->method('getCallDurationMax')->willReturn(null);\n $updatedReport->method('getGroups')->willReturn([]);\n $updatedReport->method('getDealAtCallStages')->willReturn([]);\n $updatedReport->method('getCurrentDealStages')->willReturn([]);\n $updatedReport->method('getRecipients')->willReturn(['users' => []]);\n $updatedReport->method('getCreator')->willReturn(null);\n $updatedReport->method('getAdditionalPromptInput')->willReturn(null);\n $updatedReport->method('getCreatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getUpdatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getDeletedAt')->willReturn(null);\n\n $this->automatedReportsRepository->method('findByUuid')->willReturn($report);\n $this->automatedReportsRepository->method('update')->willReturn($updatedReport);\n $this->automatedReportsRepository->expects($this->never())\n ->method('getResultsByReport');\n\n $this->service->update($reportUuid, $this->buildMinimalUpdatePayload());\n }\n\n public function testUpdateResultNamesRollbackToNoCustomNameIncludesTeams(): void\n {\n $reportUuid = 'report-uuid';\n\n $team = $this->createMock(\\Jiminny\\Models\\Team::class);\n $team->method('getId')->willReturn(1);\n $team->method('hasFeature')->willReturn(true);\n $this->teamRepository->method('idOrUuid')->willReturn($team);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('getCustomName')->willReturn('Old Custom Name');\n $report->method('getUuid')->willReturn($reportUuid);\n $report->method('getStatus')->willReturn(false);\n $report->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n\n $updatedReportTeam = $this->createMock(\\Jiminny\\Models\\Team::class);\n\n $updatedReport = $this->createMock(AutomatedReport::class);\n $updatedReport->method('getCustomName')->willReturn(null);\n $updatedReport->method('getStatus')->willReturn(false);\n $updatedReport->method('getFrequency')->willReturn(AutomatedReportsService::FREQUENCY_MONTHLY);\n $updatedReport->method('getType')->willReturn('exec_summary');\n $updatedReport->method('getTeam')->willReturn($updatedReportTeam);\n $updatedReport->method('getUuid')->willReturn('report-uuid');\n $updatedReport->method('getFrom')->willReturn(null);\n $updatedReport->method('getTo')->willReturn(null);\n $updatedReport->method('getDealValueMin')->willReturn(null);\n $updatedReport->method('getDealValueMax')->willReturn(null);\n $updatedReport->method('getCallTypes')->willReturn([]);\n $updatedReport->method('getMediaTypes')->willReturn([AutomatedReportsService::MEDIA_TYPE_PDF]);\n $updatedReport->method('getCallDurationMin')->willReturn(null);\n $updatedReport->method('getCallDurationMax')->willReturn(null);\n $updatedReport->method('getGroups')->willReturn([]);\n $updatedReport->method('getDealAtCallStages')->willReturn([]);\n $updatedReport->method('getCurrentDealStages')->willReturn([]);\n $updatedReport->method('getRecipients')->willReturn(['users' => []]);\n $updatedReport->method('getCreator')->willReturn(null);\n $updatedReport->method('getAdditionalPromptInput')->willReturn(null);\n $updatedReport->method('getCreatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getUpdatedAt')->willReturn(\\Illuminate\\Support\\Carbon::now());\n $updatedReport->method('getDeletedAt')->willReturn(null);\n\n $result1 = $this->createMock(AutomatedReportResult::class);\n $result1->method('getReport')->willReturn($updatedReport);\n $result1->method('getFromDate')->willReturn(Carbon::parse('2025-05-01'));\n $result1->method('getToDate')->willReturn(Carbon::parse('2025-05-31'));\n $result1->method('getGroups')->willReturn([]);\n $result1->method('getMediaType')->willReturn(AutomatedReportsService::MEDIA_TYPE_PDF);\n $result1->expects($this->once())\n ->method('update')\n ->with(['name' => 'Exec Summary - May 2025 - All']);\n\n $results = new \\Illuminate\\Database\\Eloquent\\Collection([$result1]);\n\n $this->automatedReportsRepository->method('findByUuid')->willReturn($report);\n $this->automatedReportsRepository->method('update')->willReturn($updatedReport);\n $this->automatedReportsRepository->expects($this->once())\n ->method('getResultsByReport')\n ->with($updatedReport)\n ->willReturn($results);\n\n $this->service->update($reportUuid, $this->buildMinimalUpdatePayload());\n }\n\n private function buildMinimalUpdatePayload(): array\n {\n return [\n 'organization' => 'team-uuid',\n 'report_type' => 'exec_summary',\n 'report_enabled' => false,\n 'frequency' => AutomatedReportsService::FREQUENCY_MONTHLY,\n 'media_types' => [AutomatedReportsService::MEDIA_TYPE_PDF],\n ];\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"There were 8 failures:\n\n1) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceActivitiesCountTest::testGetActivitiesCountPayloadWithWeeklyFrequency\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2025-08-05T00:00:00+00:00'\n+'2025-08-03T00:00:00+00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php:194\n\n2) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceActivitiesCountTest::testGetActivitiesCountPayloadWithMonthlyFrequency\nFailed asserting that '2025-07-31T23:59:59+00:00' starts with \"2025-08-11\".\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php:226\n\n3) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithWeeklyFrequency\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2023-02-08 00:00:00'\n+'2023-02-05 00:00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:180\n\n4) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithMonthlyFrequency\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2023-01-15 00:00:00'\n+'2023-01-01 00:00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:205\n\n5) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithQuarterlyFrequency\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2022-11-15 00:00:00'\n+'2022-10-01 00:00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:230\n\n6) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithWeeklyFrequencyUsesFullDays\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2026-01-13T00:00:00+00:00'\n+'2026-01-11T00:00:00+00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:778\n\n7) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithMonthlyFrequencyUsesFullDays\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2025-12-20T00:00:00+00:00'\n+'2025-12-01T00:00:00+00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:816\n\n8) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithQuarterlyFrequencyUsesFullDays\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2025-10-20T00:00:00+00:00'\n+'2025-10-01T00:00:00+00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:854\n\nFAILURES!\nTests: 10847, Assertions: 46370, Failures: 8, Warnings: 24, Deprecations: 80, PHPUnit Deprecations: 434, Skipped: 51, Incomplete: 65.","depth":4,"value":"There were 8 failures:\n\n1) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceActivitiesCountTest::testGetActivitiesCountPayloadWithWeeklyFrequency\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2025-08-05T00:00:00+00:00'\n+'2025-08-03T00:00:00+00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php:194\n\n2) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceActivitiesCountTest::testGetActivitiesCountPayloadWithMonthlyFrequency\nFailed asserting that '2025-07-31T23:59:59+00:00' starts with \"2025-08-11\".\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php:226\n\n3) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithWeeklyFrequency\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2023-02-08 00:00:00'\n+'2023-02-05 00:00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:180\n\n4) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithMonthlyFrequency\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2023-01-15 00:00:00'\n+'2023-01-01 00:00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:205\n\n5) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithQuarterlyFrequency\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2022-11-15 00:00:00'\n+'2022-10-01 00:00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:230\n\n6) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithWeeklyFrequencyUsesFullDays\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2026-01-13T00:00:00+00:00'\n+'2026-01-11T00:00:00+00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:778\n\n7) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithMonthlyFrequencyUsesFullDays\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2025-12-20T00:00:00+00:00'\n+'2025-12-01T00:00:00+00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:816\n\n8) Tests\\Unit\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithQuarterlyFrequencyUsesFullDays\nFailed asserting that two strings are equal.\n--- Expected\n+++ Actual\n@@ @@\n-'2025-10-20T00:00:00+00:00'\n+'2025-10-01T00:00:00+00:00'\n\n/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:854\n\nFAILURES!\nTests: 10847, Assertions: 46370, Failures: 8, Warnings: 24, Deprecations: 80, PHPUnit Deprecations: 434, Skipped: 51, Incomplete: 65.","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.24335106,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5392523170449844423
|
-3989964381583373596
|
idle
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-20157-AJ-report-not-s Pushed 1 commit to origin/JY-20157-AJ-report-not-send-notification
text/html
text/html
text/html
View pull request
2 files committed
JY-20157 fix failing tests
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#12011 on JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
AutomatedReportsServiceReportGen…tionTest
Run 'AutomatedReportsServiceReportGenerationTest'
Debug 'AutomatedReportsServiceReportGenerationTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
46
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Kiosk\AutomatedReports;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Support\Carbon;
use InvalidArgumentException;
use Jiminny\Component\UrlGenerator\Webhook;
use Jiminny\Contracts\Repositories\PlaybookCategoryRepository;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Repositories\GroupRepository;
use Jiminny\Repositories\StageRepository;
use Jiminny\Repositories\TeamRepository;
use Jiminny\Repositories\UserRepository;
use Jiminny\Services\Kiosk\AutomatedReports\ActivityTypeService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\Kiosk\AutomatedReports\DealStagesService;
use Jiminny\Services\Kiosk\AutomatedReports\RecipientsService;
use Jiminny\Component\AskAnything\AskAnythingPromptService;
use Jiminny\Repositories\SearchRepository;
use Jiminny\Repositories\AskAnythingRepository;
use Tests\TestCase;
use Tests\Unit\Traits\TestPrivateMethod;
class AutomatedReportsServiceReportGenerationTest extends TestCase
{
use TestPrivateMethod;
private AutomatedReportsService $service;
private Webhook $webhookService;
private AutomatedReportsRepository $automatedReportsRepository;
private TeamRepository $teamRepository;
protected function setUp(): void
{
parent::setUp();
// Create mocks for dependencies
$this->teamRepository = $this->createMock(TeamRepository::class);
$teamRepository = $this->teamRepository;
$groupRepository = $this->createMock(GroupRepository::class);
$userRepository = $this->createMock(UserRepository::class);
$stageRepository = $this->createMock(StageRepository::class);
$dealStagesService = $this->createMock(DealStagesService::class);
$recipientsService = $this->createMock(RecipientsService::class);
$this->automatedReportsRepository = $this->createMock(AutomatedReportsRepository::class);
$this->webhookService = $this->createMock(Webhook::class);
$dispatcher = $this->createMock(BusDispatcher::class);
$activityTypeService = $this->createMock(ActivityTypeService::class);
$playbookCategoryRepository = $this->createMock(PlaybookCategoryRepository::class);
// Create service instance with mocked dependencies
$this->service = new AutomatedReportsService(
$teamRepository,
$groupRepository,
$userRepository,
$stageRepository,
$dealStagesService,
$recipientsService,
$this->automatedReportsRepository,
$this->webhookService,
$dispatcher,
$activityTypeService,
$playbookCategoryRepository,
$this->createMock(AskAnythingPromptService::class),
$this->createMock(SearchRepository::class),
$this->createMock(AskAnythingRepository::class),
);
}
/**
* Test getGenerateReportPayload method with one-off frequency
*/
public function testGetGenerateReportPayloadWithOneOffFrequency(): void
{
$reportUuid = 'report-uuid';
$resultUuid = 'result-uuid';
$callbackUrl = '[URL_WITH_CREDENTIALS] @@
-'2025-08-05T00:00:00+00:00'
+'2025-08-03T00:00:00+00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php:194
2) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceActivitiesCountTest::testGetActivitiesCountPayloadWithMonthlyFrequency
Failed asserting that '2025-07-31T23:59:59+00:00' starts with "2025-08-11".
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php:226
3) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithWeeklyFrequency
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2023-02-08 00:00:00'
+'2023-02-05 00:00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:180
4) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithMonthlyFrequency
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2023-01-15 00:00:00'
+'2023-01-01 00:00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:205
5) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testCalculateFromAndToDateWithQuarterlyFrequency
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2022-11-15 00:00:00'
+'2022-10-01 00:00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:230
6) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithWeeklyFrequencyUsesFullDays
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2026-01-13T00:00:00+00:00'
+'2026-01-11T00:00:00+00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:778
7) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithMonthlyFrequencyUsesFullDays
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2025-12-20T00:00:00+00:00'
+'2025-12-01T00:00:00+00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:816
8) Tests\Unit\Services\Kiosk\AutomatedReports\AutomatedReportsServiceReportGenerationTest::testGetGenerateReportPayloadWithQuarterlyFrequencyUsesFullDays
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2025-10-20T00:00:00+00:00'
+'2025-10-01T00:00:00+00:00'
/home/circleci/project/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php:854
FAILURES!
Tests: 10847, Assertions: 46370, Failures: 8, Warnings: 24, Deprecations: 80, PHPUnit Deprecations: 434, Skipped: 51, Incomplete: 65.
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
|
76239
|
1908
|
42
|
2026-04-24T07:38:01.133389+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-24/1777 /Users/lukas/.screenpipe/data/data/2026-04-24/1777016281133_m2.jpg...
|
PhpStorm
|
faVsco.js – TrackAutomatedReportGeneratedEventTest faVsco.js – TrackAutomatedReportGeneratedEventTest.php...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-20157-AJ-report-not-s Pushed 1 commit to origin/JY-20157-AJ-report-not-send-notification
text/html
text/html
text/html
View pull request
2 files committed
JY-20157 move user pilot tracking changes to separated PR
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#12011 on JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
TrackAutomatedReportGeneratedEventTest
Run 'TrackAutomatedReportGeneratedEventTest'
Debug 'TrackAutomatedReportGeneratedEventTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Code changed:
Hide
Sync Changes
Hide This Notification
43
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\Contracts\UserContract;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use Illuminate\Support\Facades\Log;
class TrackAutomatedReportGeneratedEvent implements ShouldQueue
{
use InteractsWithQueue;
private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';
private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';
public string $queue = Constants::QUEUE_DELAYABLE;
public function __construct(
private readonly UserPilotClient $userPilotClient,
private readonly AutomatedReportsService $automatedReportsService,
) {
}
public function handle(AutomatedReportGenerated $event): void
{
if (config('services.userpilot.token') === null) {
return;
}
$automatedReport = $event->automatedReport;
$payload = $this->buildPayload($automatedReport);
$eventName = $this->resolveEventName($automatedReport);
$users = $this->resolveUsers($automatedReport);
if (empty($users)) {
Log::warning('[UserPilot] No recipients found for automated report', [
'report_id' => $automatedReport->getId(),
'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),
]);
return;
}
Log::info('[UserPilot] Sending automated report event', [
'report_id' => $automatedReport->getId(),
'event_name' => $eventName,
'recipient_count' => count($users),
]);
try {
foreach ($users as $user) {
$this->userPilotClient->track($user, $eventName, $payload);
}
} catch (GuzzleException $e) {
Log::error('[UserPilot] Failed to send automated report event', [
'report_id' => $automatedReport->getId(),
'error' => $e->getMessage(),
]);
$this->release(3600);
}
}
/**
* @return array<UserContract>
*/
private function resolveUsers(AutomatedReport $automatedReport): array
{
if ($automatedReport->isAskJiminnyReport()) {
$creator = $automatedReport->getCreator();
return $creator !== null ? [$creator] : [];
}
return $this->automatedReportsService->getRecipientUserObjects($automatedReport);
}
private function buildPayload(AutomatedReport $automatedReport): array
{
return [
'report_type' => $automatedReport->getType(),
'frequency' => $automatedReport->getFrequency(),
];
}
private function resolveEventName(AutomatedReport $automatedReport): string
{
if ($automatedReport->isAskJiminnyReport()) {
return self::EVENT_NAME_ASK_JIMINNY_REPORT;
}
return self::EVENT_NAME_AUTOMATED_REPORT;
}
}
+++
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(123);
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(456);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(789);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(101);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$report->method('getId')->willReturn(202);
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$report->expects($this->once())->method('getId')->willReturn(303);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-20157-AJ-report-not-send-notification","depth":3,"bounds":{"left":0.8753325,"top":0.82521945,"width":0.11037234,"height":0.027134877},"value":"Pushed 1 commit to origin/JY-20157-AJ-report-not-send-notification","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.82521945,"width":0.103390954,"height":0.027134877},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8753325,"top":0.8579409,"width":0.03523936,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2 files committed","depth":2,"bounds":{"left":0.8753325,"top":0.89944136,"width":0.100398935,"height":0.013567438},"role_description":"text"},{"role":"AXTextField","text":"JY-20157 move user pilot tracking changes to separated PR","depth":3,"bounds":{"left":0.8753325,"top":0.915403,"width":0.11037234,"height":0.027134877},"value":"JY-20157 move user pilot tracking changes to separated PR","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.915403,"width":0.09507979,"height":0.027134877},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"bounds":{"left":0.8753325,"top":0.9481245,"width":0.048204787,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.25731382,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12011 on JY-20157-AJ-report-not-send-notification, menu","depth":5,"bounds":{"left":0.29587767,"top":0.019952115,"width":0.12134308,"height":0.025538707},"help_text":"Pull request #12011 exists for current branch JY-20157-AJ-report-not-send-notification","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.796875,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TrackAutomatedReportGeneratedEventTest","depth":6,"bounds":{"left":0.8121675,"top":0.019952115,"width":0.103390954,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TrackAutomatedReportGeneratedEventTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TrackAutomatedReportGeneratedEventTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"9","depth":4,"bounds":{"left":0.59574467,"top":0.32322428,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.60538566,"top":0.3216281,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.61269945,"top":0.3216281,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","depth":4,"bounds":{"left":0.3799867,"top":0.0,"width":0.34375,"height":1.0},"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"43","depth":4,"bounds":{"left":0.96210104,"top":0.10055866,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9740692,"top":0.09896249,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.98138297,"top":0.09896249,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\Contracts\\UserContract;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse Illuminate\\Support\\Facades\\Log;\n\nclass TrackAutomatedReportGeneratedEvent implements ShouldQueue\n{\n use InteractsWithQueue;\n\n private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';\n private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';\n\n public string $queue = Constants::QUEUE_DELAYABLE;\n\n public function __construct(\n private readonly UserPilotClient $userPilotClient,\n private readonly AutomatedReportsService $automatedReportsService,\n ) {\n }\n\n public function handle(AutomatedReportGenerated $event): void\n {\n if (config('services.userpilot.token') === null) {\n return;\n }\n\n $automatedReport = $event->automatedReport;\n $payload = $this->buildPayload($automatedReport);\n\n $eventName = $this->resolveEventName($automatedReport);\n\n $users = $this->resolveUsers($automatedReport);\n\n if (empty($users)) {\n Log::warning('[UserPilot] No recipients found for automated report', [\n 'report_id' => $automatedReport->getId(),\n 'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),\n ]);\n\n return;\n }\n\n Log::info('[UserPilot] Sending automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'event_name' => $eventName,\n 'recipient_count' => count($users),\n ]);\n\n try {\n foreach ($users as $user) {\n $this->userPilotClient->track($user, $eventName, $payload);\n }\n } catch (GuzzleException $e) {\n Log::error('[UserPilot] Failed to send automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'error' => $e->getMessage(),\n ]);\n $this->release(3600);\n }\n }\n\n /**\n * @return array<UserContract>\n */\n private function resolveUsers(AutomatedReport $automatedReport): array\n {\n if ($automatedReport->isAskJiminnyReport()) {\n $creator = $automatedReport->getCreator();\n\n return $creator !== null ? [$creator] : [];\n }\n\n return $this->automatedReportsService->getRecipientUserObjects($automatedReport);\n }\n\n private function buildPayload(AutomatedReport $automatedReport): array\n {\n return [\n 'report_type' => $automatedReport->getType(),\n 'frequency' => $automatedReport->getFrequency(),\n ];\n }\n\n private function resolveEventName(AutomatedReport $automatedReport): string\n {\n if ($automatedReport->isAskJiminnyReport()) {\n return self::EVENT_NAME_ASK_JIMINNY_REPORT;\n }\n\n return self::EVENT_NAME_AUTOMATED_REPORT;\n }\n}\n\n+++\n\n<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(123);\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(456);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(789);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(101);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n $report->method('getId')->willReturn(202);\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n $report->expects($this->once())->method('getId')->willReturn(303);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\Contracts\\UserContract;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse Illuminate\\Support\\Facades\\Log;\n\nclass TrackAutomatedReportGeneratedEvent implements ShouldQueue\n{\n use InteractsWithQueue;\n\n private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';\n private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';\n\n public string $queue = Constants::QUEUE_DELAYABLE;\n\n public function __construct(\n private readonly UserPilotClient $userPilotClient,\n private readonly AutomatedReportsService $automatedReportsService,\n ) {\n }\n\n public function handle(AutomatedReportGenerated $event): void\n {\n if (config('services.userpilot.token') === null) {\n return;\n }\n\n $automatedReport = $event->automatedReport;\n $payload = $this->buildPayload($automatedReport);\n\n $eventName = $this->resolveEventName($automatedReport);\n\n $users = $this->resolveUsers($automatedReport);\n\n if (empty($users)) {\n Log::warning('[UserPilot] No recipients found for automated report', [\n 'report_id' => $automatedReport->getId(),\n 'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),\n ]);\n\n return;\n }\n\n Log::info('[UserPilot] Sending automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'event_name' => $eventName,\n 'recipient_count' => count($users),\n ]);\n\n try {\n foreach ($users as $user) {\n $this->userPilotClient->track($user, $eventName, $payload);\n }\n } catch (GuzzleException $e) {\n Log::error('[UserPilot] Failed to send automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'error' => $e->getMessage(),\n ]);\n $this->release(3600);\n }\n }\n\n /**\n * @return array<UserContract>\n */\n private function resolveUsers(AutomatedReport $automatedReport): array\n {\n if ($automatedReport->isAskJiminnyReport()) {\n $creator = $automatedReport->getCreator();\n\n return $creator !== null ? [$creator] : [];\n }\n\n return $this->automatedReportsService->getRecipientUserObjects($automatedReport);\n }\n\n private function buildPayload(AutomatedReport $automatedReport): array\n {\n return [\n 'report_type' => $automatedReport->getType(),\n 'frequency' => $automatedReport->getFrequency(),\n ];\n }\n\n private function resolveEventName(AutomatedReport $automatedReport): string\n {\n if ($automatedReport->isAskJiminnyReport()) {\n return self::EVENT_NAME_ASK_JIMINNY_REPORT;\n }\n\n return self::EVENT_NAME_AUTOMATED_REPORT;\n }\n}\n\n+++\n\n<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(123);\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(456);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(789);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(101);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n $report->method('getId')->willReturn(202);\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n $report->expects($this->once())->method('getId')->willReturn(303);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.24335106,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.30851063,"top":0.05027933,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.31948137,"top":0.05027933,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.328125,"top":0.05027933,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.33676863,"top":0.05027933,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.34541222,"top":0.05027933,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-2823365913049337602
|
8408970457747008282
|
app_switch
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-20157-AJ-report-not-s Pushed 1 commit to origin/JY-20157-AJ-report-not-send-notification
text/html
text/html
text/html
View pull request
2 files committed
JY-20157 move user pilot tracking changes to separated PR
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#12011 on JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
TrackAutomatedReportGeneratedEventTest
Run 'TrackAutomatedReportGeneratedEventTest'
Debug 'TrackAutomatedReportGeneratedEventTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Code changed:
Hide
Sync Changes
Hide This Notification
43
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\Contracts\UserContract;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use Illuminate\Support\Facades\Log;
class TrackAutomatedReportGeneratedEvent implements ShouldQueue
{
use InteractsWithQueue;
private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';
private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';
public string $queue = Constants::QUEUE_DELAYABLE;
public function __construct(
private readonly UserPilotClient $userPilotClient,
private readonly AutomatedReportsService $automatedReportsService,
) {
}
public function handle(AutomatedReportGenerated $event): void
{
if (config('services.userpilot.token') === null) {
return;
}
$automatedReport = $event->automatedReport;
$payload = $this->buildPayload($automatedReport);
$eventName = $this->resolveEventName($automatedReport);
$users = $this->resolveUsers($automatedReport);
if (empty($users)) {
Log::warning('[UserPilot] No recipients found for automated report', [
'report_id' => $automatedReport->getId(),
'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),
]);
return;
}
Log::info('[UserPilot] Sending automated report event', [
'report_id' => $automatedReport->getId(),
'event_name' => $eventName,
'recipient_count' => count($users),
]);
try {
foreach ($users as $user) {
$this->userPilotClient->track($user, $eventName, $payload);
}
} catch (GuzzleException $e) {
Log::error('[UserPilot] Failed to send automated report event', [
'report_id' => $automatedReport->getId(),
'error' => $e->getMessage(),
]);
$this->release(3600);
}
}
/**
* @return array<UserContract>
*/
private function resolveUsers(AutomatedReport $automatedReport): array
{
if ($automatedReport->isAskJiminnyReport()) {
$creator = $automatedReport->getCreator();
return $creator !== null ? [$creator] : [];
}
return $this->automatedReportsService->getRecipientUserObjects($automatedReport);
}
private function buildPayload(AutomatedReport $automatedReport): array
{
return [
'report_type' => $automatedReport->getType(),
'frequency' => $automatedReport->getFrequency(),
];
}
private function resolveEventName(AutomatedReport $automatedReport): string
{
if ($automatedReport->isAskJiminnyReport()) {
return self::EVENT_NAME_ASK_JIMINNY_REPORT;
}
return self::EVENT_NAME_AUTOMATED_REPORT;
}
}
+++
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(123);
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(456);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(789);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(101);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$report->method('getId')->willReturn(202);
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$report->expects($this->once())->method('getId')->willReturn(303);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
|
13028
|
282
|
11
|
2026-04-14T11:58:02.988719+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-14/1776 /Users/lukas/.screenpipe/data/data/2026-04-14/1776167882988_m1.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsSendCommand.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-6170589969278255569
|
-7204539450056857458
|
click
|
hybrid
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
iTerm2ShellEditViewSessionScriptsProfilesWindowHelp(all= Support Daily • in 2 mAPP (-zsh)DOCKER₴81DEV (docker)882APP (-zsh)83ec2-user@ip-10-30-... 284-zshdocker exec-itdocker_lamp_1•/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diffPHP CS Fixer3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.PHPruntime:8.3.30Runninganalysison 7 cores with 10 files per process.Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!Loadedconfigdefault from-php-cs-fixer.dist.php".5589/558980 100%-zsh86-zsh100% <47O &7Tue 14 Apr 14:58:02181* Unable to acce...APPFixed 0 of 5589 files in 39.991 seconds, 67.00 MB memory usedWhat's next:Try DockerDebug forseamless,persistentdebugging tools in any container or image → docker debug docker_lamp_1Learn moreat [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-18909-automated-reports-ask-jiminny) $ csfixdocker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diffPHPCS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.PHP runtime: 8.3.30Running analysis on 7 cores with 10 files per process.Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!Loadedconfig default from".php-cs-fixer.dist.php".5589/5589100%Fixed 0 of 5589 files in 52.171 seconds, 67.00 MB memory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image » docker debug docker_1amp_1Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-18909-automated-reports-ask-jiminny) $ ||...
|
NULL
|
|
15518
|
348
|
13
|
2026-04-14T14:49:48.090795+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-14/1776 /Users/lukas/.screenpipe/data/data/2026-04-14/1776178188090_m1.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsCommand.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
3 files committed
JY-18909 modify send automated report command to support immediate send for specific result
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsCommandTest
Run 'AutomatedReportsCommandTest'
Debug 'AutomatedReportsCommandTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"3 files committed","depth":2,"role_description":"text"},{"role":"AXTextField","text":"JY-18909 modify send automated report command to support immediate send for specific result","depth":3,"value":"JY-18909 modify send automated report command to support immediate send for specific result","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsCommandTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsCommandTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsCommandTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4031748333917085902
|
-7717946503268202466
|
visual_change
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
3 files committed
JY-18909 modify send automated report command to support immediate send for specific result
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsCommandTest
Run 'AutomatedReportsCommandTest'
Debug 'AutomatedReportsCommandTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification...
|
15514
|
|
55774
|
1201
|
18
|
2026-04-20T10:07:39.291640+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-20/1776 /Users/lukas/.screenpipe/data/data/2026-04-20/1776679659291_m1.jpg...
|
PhpStorm
|
faVsco.js – AskJiminnyReportActivityServiceTest.ph faVsco.js – AskJiminnyReportActivityServiceTest.php...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 fix flanky test
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Kiosk\AutomatedReports;
use Carbon\CarbonImmutable;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityActualDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityUpdatedDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\DealInsights\ClosingPeriodFilter;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Component\ActivitySearch\Service\ActivitySearch;
use Jiminny\Models\Activity\Search;
use Jiminny\Models\Activity\SearchFilter;
use Jiminny\Models\User;
use Jiminny\Repositories\ElasticActivityRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AskJiminnyReportActivityService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
class AskJiminnyReportActivityServiceTest extends TestCase
{
private ActivitySearch&MockObject $activitySearch;
private ElasticActivityRepository&MockObject $elasticRepository;
private LoggerInterface&MockObject $logger;
private AskJiminnyReportActivityService $service;
protected function setUp(): void
{
$this->activitySearch = $this->createMock(ActivitySearch::class);
$this->elasticRepository = $this->createMock(ElasticActivityRepository::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->service = new AskJiminnyReportActivityService(
$this->activitySearch,
$this->elasticRepository,
$this->logger,
);
}
private function makeFilter(string $key, ?string $value): SearchFilter&MockObject
{
$filter = $this->createMock(SearchFilter::class);
$filter->method('getFilterProperty')->willReturn($key);
$filter->method('getFilterValue')->willReturn($value);
return $filter;
}
private function makeUser(): User&MockObject
{
$tz = new \DateTimeZone('UTC');
$user = $this->createMock(User::class);
$user->method('getTimezone')->willReturn($tz);
$user->method('getId')->willReturn(1);
$user->method('getUuid')->willReturn('user-uuid');
return $user;
}
private function makeSavedSearch(array $filters): Search&MockObject
{
$savedSearch = $this->createMock(Search::class);
$savedSearch->method('getId')->willReturn(42);
$savedSearch->method('getFilters')->willReturn(new \Illuminate\Support\LazyCollection($filters));
return $savedSearch;
}
public function testGetActivityIdsForSavedSearchReturnsIds(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->expects($this->once())
->method('getArrayFilterKeys')
->with($user)
->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->expects($this->once())
->method('onDemandSearchIdsOnly')
->willReturn(['id-1', 'id-2', 'id-3']);
$this->logger->expects($this->once())
->method('info')
->with('[AskJiminnyReport] Fetched activity IDs for saved search');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1', 'id-2', 'id-3'], $result);
}
public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->expects($this->once())->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEmpty($result);
}
public function testGetActivityIdsFiltersOutDateFilters(): void
{
$user = $this->makeUser();
$nonDateFilter = $this->makeFilter('owner_id', '123');
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');
$updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');
$updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');
$savedSearch = $this->makeSavedSearch([
$nonDateFilter,
$startDateFilter,
$endDateFilter,
$updatedFromFilter,
$updatedToFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
}
public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void
{
$user = $this->makeUser();
$closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');
$closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');
$regularFilter = $this->makeFilter('rep_id', '99');
$savedSearch = $this->makeSavedSearch([
$closingStartFilter,
$closingEndFilter,
$regularFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesArrayFilters(): void
{
$user = $this->makeUser();
$filter1 = $this->makeFilter('outcome', 'positive');
$filter2 = $this->makeFilter('outcome', 'negative');
$savedSearch = $this->makeSavedSearch([$filter1, $filter2]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesScalarFilters(): void
{
$user = $this->makeUser();
$filter = $this->makeFilter('direction', 'inbound');
$savedSearch = $this->makeSavedSearch([$filter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-5'], $result);
}
public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
$this->assertFalse($capturedCriteria->isFirstRequest());
}
public function testGetActivityIdsLogsWithCorrectContext(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);
$this->logger->expects($this->once())
->method('info')
->with(
'[AskJiminnyReport] Fetched activity IDs for saved search',
$this->callback(fn ($context) => $context['saved_search_id'] === 42
&& $context['user_id'] === 1
&& $context['activity_count'] === 2)
);
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
}
public static function frequencyDateRangeProvider(): array
{
$now = CarbonImmutable::parse('2025-06-16 12:00:00');
return [
'daily' => [
AutomatedReportsService::FREQUENCY_DAILY,
$now->subDay()->startOfDay()->format('Y-m-d H:i:s'),
$now->subDay()->endOfDay()->format('Y-m-d H:i:s'),
],
'weekly' => [
AutomatedReportsService::FREQUENCY_WEEKLY,
$now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),
$now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),
],
'monthly' => [
AutomatedReportsService::FREQUENCY_MONTHLY,
$now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),
$now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),
],
'quarterly' => [
AutomatedReportsService::FREQUENCY_QUARTERLY,
$now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),
$now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),
],
];
}
/**
* @dataProvider frequencyDateRangeProvider
*/
public function testGetActivityIdsInjectsDateRangeForFrequency(
string $frequency,
string $expectedStartDate,
string $expectedEndDate,
): void {
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);
$this->assertNotNull($capturedCriteria);
$this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void
{
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');
$savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);
$this->assertNotNull($capturedCriteria);
$this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1 file committed","depth":2,"role_description":"text"},{"role":"AXTextField","text":"JY-18909 fix flanky test","depth":3,"value":"JY-18909 fix flanky test","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"3","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Kiosk\\AutomatedReports;\n\nuse Carbon\\CarbonImmutable;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityActualDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityUpdatedDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\DealInsights\\ClosingPeriodFilter;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Component\\ActivitySearch\\Service\\ActivitySearch;\nuse Jiminny\\Models\\Activity\\Search;\nuse Jiminny\\Models\\Activity\\SearchFilter;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ElasticActivityRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AskJiminnyReportActivityService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse PHPUnit\\Framework\\TestCase;\nuse Psr\\Log\\LoggerInterface;\n\nclass AskJiminnyReportActivityServiceTest extends TestCase\n{\n private ActivitySearch&MockObject $activitySearch;\n private ElasticActivityRepository&MockObject $elasticRepository;\n private LoggerInterface&MockObject $logger;\n private AskJiminnyReportActivityService $service;\n\n protected function setUp(): void\n {\n $this->activitySearch = $this->createMock(ActivitySearch::class);\n $this->elasticRepository = $this->createMock(ElasticActivityRepository::class);\n $this->logger = $this->createMock(LoggerInterface::class);\n\n $this->service = new AskJiminnyReportActivityService(\n $this->activitySearch,\n $this->elasticRepository,\n $this->logger,\n );\n }\n\n private function makeFilter(string $key, ?string $value): SearchFilter&MockObject\n {\n $filter = $this->createMock(SearchFilter::class);\n $filter->method('getFilterProperty')->willReturn($key);\n $filter->method('getFilterValue')->willReturn($value);\n\n return $filter;\n }\n\n private function makeUser(): User&MockObject\n {\n $tz = new \\DateTimeZone('UTC');\n $user = $this->createMock(User::class);\n $user->method('getTimezone')->willReturn($tz);\n $user->method('getId')->willReturn(1);\n $user->method('getUuid')->willReturn('user-uuid');\n\n return $user;\n }\n\n private function makeSavedSearch(array $filters): Search&MockObject\n {\n $savedSearch = $this->createMock(Search::class);\n $savedSearch->method('getId')->willReturn(42);\n $savedSearch->method('getFilters')->willReturn(new \\Illuminate\\Support\\LazyCollection($filters));\n\n return $savedSearch;\n }\n\n public function testGetActivityIdsForSavedSearchReturnsIds(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->expects($this->once())\n ->method('getArrayFilterKeys')\n ->with($user)\n ->willReturn([]);\n\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n\n $this->elasticRepository->expects($this->once())\n ->method('onDemandSearchIdsOnly')\n ->willReturn(['id-1', 'id-2', 'id-3']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with('[AskJiminnyReport] Fetched activity IDs for saved search');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1', 'id-2', 'id-3'], $result);\n }\n\n public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $this->logger->expects($this->once())->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEmpty($result);\n }\n\n public function testGetActivityIdsFiltersOutDateFilters(): void\n {\n $user = $this->makeUser();\n\n $nonDateFilter = $this->makeFilter('owner_id', '123');\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');\n $updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');\n $updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');\n\n $savedSearch = $this->makeSavedSearch([\n $nonDateFilter,\n $startDateFilter,\n $endDateFilter,\n $updatedFromFilter,\n $updatedToFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n }\n\n public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void\n {\n $user = $this->makeUser();\n\n $closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');\n $closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');\n $regularFilter = $this->makeFilter('rep_id', '99');\n\n $savedSearch = $this->makeSavedSearch([\n $closingStartFilter,\n $closingEndFilter,\n $regularFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesArrayFilters(): void\n {\n $user = $this->makeUser();\n\n $filter1 = $this->makeFilter('outcome', 'positive');\n $filter2 = $this->makeFilter('outcome', 'negative');\n\n $savedSearch = $this->makeSavedSearch([$filter1, $filter2]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesScalarFilters(): void\n {\n $user = $this->makeUser();\n\n $filter = $this->makeFilter('direction', 'inbound');\n $savedSearch = $this->makeSavedSearch([$filter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-5'], $result);\n }\n\n public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertFalse($capturedCriteria->isFirstRequest());\n }\n\n public function testGetActivityIdsLogsWithCorrectContext(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with(\n '[AskJiminnyReport] Fetched activity IDs for saved search',\n $this->callback(fn ($context) => $context['saved_search_id'] === 42\n && $context['user_id'] === 1\n && $context['activity_count'] === 2)\n );\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n }\n\n public static function frequencyDateRangeProvider(): array\n {\n $now = CarbonImmutable::parse('2025-06-16 12:00:00');\n\n return [\n 'daily' => [\n AutomatedReportsService::FREQUENCY_DAILY,\n $now->subDay()->startOfDay()->format('Y-m-d H:i:s'),\n $now->subDay()->endOfDay()->format('Y-m-d H:i:s'),\n ],\n 'weekly' => [\n AutomatedReportsService::FREQUENCY_WEEKLY,\n $now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),\n $now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),\n ],\n 'monthly' => [\n AutomatedReportsService::FREQUENCY_MONTHLY,\n $now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),\n $now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),\n ],\n 'quarterly' => [\n AutomatedReportsService::FREQUENCY_QUARTERLY,\n $now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),\n $now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),\n ],\n ];\n }\n\n /**\n * @dataProvider frequencyDateRangeProvider\n */\n public function testGetActivityIdsInjectsDateRangeForFrequency(\n string $frequency,\n string $expectedStartDate,\n string $expectedEndDate,\n ): void {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n\n public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void\n {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');\n $savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Kiosk\\AutomatedReports;\n\nuse Carbon\\CarbonImmutable;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityActualDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityUpdatedDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\DealInsights\\ClosingPeriodFilter;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Component\\ActivitySearch\\Service\\ActivitySearch;\nuse Jiminny\\Models\\Activity\\Search;\nuse Jiminny\\Models\\Activity\\SearchFilter;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ElasticActivityRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AskJiminnyReportActivityService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse PHPUnit\\Framework\\TestCase;\nuse Psr\\Log\\LoggerInterface;\n\nclass AskJiminnyReportActivityServiceTest extends TestCase\n{\n private ActivitySearch&MockObject $activitySearch;\n private ElasticActivityRepository&MockObject $elasticRepository;\n private LoggerInterface&MockObject $logger;\n private AskJiminnyReportActivityService $service;\n\n protected function setUp(): void\n {\n $this->activitySearch = $this->createMock(ActivitySearch::class);\n $this->elasticRepository = $this->createMock(ElasticActivityRepository::class);\n $this->logger = $this->createMock(LoggerInterface::class);\n\n $this->service = new AskJiminnyReportActivityService(\n $this->activitySearch,\n $this->elasticRepository,\n $this->logger,\n );\n }\n\n private function makeFilter(string $key, ?string $value): SearchFilter&MockObject\n {\n $filter = $this->createMock(SearchFilter::class);\n $filter->method('getFilterProperty')->willReturn($key);\n $filter->method('getFilterValue')->willReturn($value);\n\n return $filter;\n }\n\n private function makeUser(): User&MockObject\n {\n $tz = new \\DateTimeZone('UTC');\n $user = $this->createMock(User::class);\n $user->method('getTimezone')->willReturn($tz);\n $user->method('getId')->willReturn(1);\n $user->method('getUuid')->willReturn('user-uuid');\n\n return $user;\n }\n\n private function makeSavedSearch(array $filters): Search&MockObject\n {\n $savedSearch = $this->createMock(Search::class);\n $savedSearch->method('getId')->willReturn(42);\n $savedSearch->method('getFilters')->willReturn(new \\Illuminate\\Support\\LazyCollection($filters));\n\n return $savedSearch;\n }\n\n public function testGetActivityIdsForSavedSearchReturnsIds(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->expects($this->once())\n ->method('getArrayFilterKeys')\n ->with($user)\n ->willReturn([]);\n\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n\n $this->elasticRepository->expects($this->once())\n ->method('onDemandSearchIdsOnly')\n ->willReturn(['id-1', 'id-2', 'id-3']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with('[AskJiminnyReport] Fetched activity IDs for saved search');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1', 'id-2', 'id-3'], $result);\n }\n\n public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $this->logger->expects($this->once())->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEmpty($result);\n }\n\n public function testGetActivityIdsFiltersOutDateFilters(): void\n {\n $user = $this->makeUser();\n\n $nonDateFilter = $this->makeFilter('owner_id', '123');\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');\n $updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');\n $updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');\n\n $savedSearch = $this->makeSavedSearch([\n $nonDateFilter,\n $startDateFilter,\n $endDateFilter,\n $updatedFromFilter,\n $updatedToFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n }\n\n public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void\n {\n $user = $this->makeUser();\n\n $closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');\n $closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');\n $regularFilter = $this->makeFilter('rep_id', '99');\n\n $savedSearch = $this->makeSavedSearch([\n $closingStartFilter,\n $closingEndFilter,\n $regularFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesArrayFilters(): void\n {\n $user = $this->makeUser();\n\n $filter1 = $this->makeFilter('outcome', 'positive');\n $filter2 = $this->makeFilter('outcome', 'negative');\n\n $savedSearch = $this->makeSavedSearch([$filter1, $filter2]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesScalarFilters(): void\n {\n $user = $this->makeUser();\n\n $filter = $this->makeFilter('direction', 'inbound');\n $savedSearch = $this->makeSavedSearch([$filter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-5'], $result);\n }\n\n public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertFalse($capturedCriteria->isFirstRequest());\n }\n\n public function testGetActivityIdsLogsWithCorrectContext(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with(\n '[AskJiminnyReport] Fetched activity IDs for saved search',\n $this->callback(fn ($context) => $context['saved_search_id'] === 42\n && $context['user_id'] === 1\n && $context['activity_count'] === 2)\n );\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n }\n\n public static function frequencyDateRangeProvider(): array\n {\n $now = CarbonImmutable::parse('2025-06-16 12:00:00');\n\n return [\n 'daily' => [\n AutomatedReportsService::FREQUENCY_DAILY,\n $now->subDay()->startOfDay()->format('Y-m-d H:i:s'),\n $now->subDay()->endOfDay()->format('Y-m-d H:i:s'),\n ],\n 'weekly' => [\n AutomatedReportsService::FREQUENCY_WEEKLY,\n $now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),\n $now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),\n ],\n 'monthly' => [\n AutomatedReportsService::FREQUENCY_MONTHLY,\n $now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),\n $now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),\n ],\n 'quarterly' => [\n AutomatedReportsService::FREQUENCY_QUARTERLY,\n $now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),\n $now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),\n ],\n ];\n }\n\n /**\n * @dataProvider frequencyDateRangeProvider\n */\n public function testGetActivityIdsInjectsDateRangeForFrequency(\n string $frequency,\n string $expectedStartDate,\n string $expectedEndDate,\n ): void {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n\n public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void\n {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');\n $savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"27","depth":4,"role_description":"text"}]...
|
8286111171890129842
|
938146701527684502
|
click
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 fix flanky test
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Kiosk\AutomatedReports;
use Carbon\CarbonImmutable;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityActualDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityUpdatedDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\DealInsights\ClosingPeriodFilter;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Component\ActivitySearch\Service\ActivitySearch;
use Jiminny\Models\Activity\Search;
use Jiminny\Models\Activity\SearchFilter;
use Jiminny\Models\User;
use Jiminny\Repositories\ElasticActivityRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AskJiminnyReportActivityService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
class AskJiminnyReportActivityServiceTest extends TestCase
{
private ActivitySearch&MockObject $activitySearch;
private ElasticActivityRepository&MockObject $elasticRepository;
private LoggerInterface&MockObject $logger;
private AskJiminnyReportActivityService $service;
protected function setUp(): void
{
$this->activitySearch = $this->createMock(ActivitySearch::class);
$this->elasticRepository = $this->createMock(ElasticActivityRepository::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->service = new AskJiminnyReportActivityService(
$this->activitySearch,
$this->elasticRepository,
$this->logger,
);
}
private function makeFilter(string $key, ?string $value): SearchFilter&MockObject
{
$filter = $this->createMock(SearchFilter::class);
$filter->method('getFilterProperty')->willReturn($key);
$filter->method('getFilterValue')->willReturn($value);
return $filter;
}
private function makeUser(): User&MockObject
{
$tz = new \DateTimeZone('UTC');
$user = $this->createMock(User::class);
$user->method('getTimezone')->willReturn($tz);
$user->method('getId')->willReturn(1);
$user->method('getUuid')->willReturn('user-uuid');
return $user;
}
private function makeSavedSearch(array $filters): Search&MockObject
{
$savedSearch = $this->createMock(Search::class);
$savedSearch->method('getId')->willReturn(42);
$savedSearch->method('getFilters')->willReturn(new \Illuminate\Support\LazyCollection($filters));
return $savedSearch;
}
public function testGetActivityIdsForSavedSearchReturnsIds(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->expects($this->once())
->method('getArrayFilterKeys')
->with($user)
->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->expects($this->once())
->method('onDemandSearchIdsOnly')
->willReturn(['id-1', 'id-2', 'id-3']);
$this->logger->expects($this->once())
->method('info')
->with('[AskJiminnyReport] Fetched activity IDs for saved search');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1', 'id-2', 'id-3'], $result);
}
public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->expects($this->once())->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEmpty($result);
}
public function testGetActivityIdsFiltersOutDateFilters(): void
{
$user = $this->makeUser();
$nonDateFilter = $this->makeFilter('owner_id', '123');
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');
$updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');
$updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');
$savedSearch = $this->makeSavedSearch([
$nonDateFilter,
$startDateFilter,
$endDateFilter,
$updatedFromFilter,
$updatedToFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
}
public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void
{
$user = $this->makeUser();
$closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');
$closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');
$regularFilter = $this->makeFilter('rep_id', '99');
$savedSearch = $this->makeSavedSearch([
$closingStartFilter,
$closingEndFilter,
$regularFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesArrayFilters(): void
{
$user = $this->makeUser();
$filter1 = $this->makeFilter('outcome', 'positive');
$filter2 = $this->makeFilter('outcome', 'negative');
$savedSearch = $this->makeSavedSearch([$filter1, $filter2]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesScalarFilters(): void
{
$user = $this->makeUser();
$filter = $this->makeFilter('direction', 'inbound');
$savedSearch = $this->makeSavedSearch([$filter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-5'], $result);
}
public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
$this->assertFalse($capturedCriteria->isFirstRequest());
}
public function testGetActivityIdsLogsWithCorrectContext(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);
$this->logger->expects($this->once())
->method('info')
->with(
'[AskJiminnyReport] Fetched activity IDs for saved search',
$this->callback(fn ($context) => $context['saved_search_id'] === 42
&& $context['user_id'] === 1
&& $context['activity_count'] === 2)
);
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
}
public static function frequencyDateRangeProvider(): array
{
$now = CarbonImmutable::parse('2025-06-16 12:00:00');
return [
'daily' => [
AutomatedReportsService::FREQUENCY_DAILY,
$now->subDay()->startOfDay()->format('Y-m-d H:i:s'),
$now->subDay()->endOfDay()->format('Y-m-d H:i:s'),
],
'weekly' => [
AutomatedReportsService::FREQUENCY_WEEKLY,
$now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),
$now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),
],
'monthly' => [
AutomatedReportsService::FREQUENCY_MONTHLY,
$now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),
$now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),
],
'quarterly' => [
AutomatedReportsService::FREQUENCY_QUARTERLY,
$now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),
$now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),
],
];
}
/**
* @dataProvider frequencyDateRangeProvider
*/
public function testGetActivityIdsInjectsDateRangeForFrequency(
string $frequency,
string $expectedStartDate,
string $expectedEndDate,
): void {
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);
$this->assertNotNull($capturedCriteria);
$this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void
{
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');
$savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);
$this->assertNotNull($capturedCriteria);
$this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27...
|
NULL
|
|
66105
|
1481
|
16
|
2026-04-21T13:39:30.106961+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776778770106_m1.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsRepositoryTest.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 68;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE `automated_report_results`.`generated_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$."users"')
;
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsRepositoryTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsRepositoryTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsRepositoryTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"5","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"18","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"14","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 68;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE `automated_report_results`.`generated_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$.\"users\"')\n;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;","depth":4,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 68;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE `automated_report_results`.`generated_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$.\"users\"')\n;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4079194444055345358
|
-6932414698814794163
|
click
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 68;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE `automated_report_results`.`generated_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$."users"')
;
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
66102
|
|
66106
|
1481
|
17
|
2026-04-21T13:39:34.250363+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776778774250_m1.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsRepositoryTest.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsRepositoryTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsRepositoryTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsRepositoryTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"5","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"18","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"14","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-1603951934818216845
|
-8366731684414775732
|
click
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error...
|
NULL
|
|
66109
|
1481
|
19
|
2026-04-21T13:39:37.383314+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776778777383_m1.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsRepositoryTest.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 68;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE `automated_report_results`.`generated_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$."users"')
;
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsRepositoryTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsRepositoryTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsRepositoryTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"5","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"18","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"14","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 68;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE `automated_report_results`.`generated_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$.\"users\"')\n;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;","depth":4,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 68;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE `automated_report_results`.`generated_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$.\"users\"')\n;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4079194444055345358
|
-6932414698814794163
|
click
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 68;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE `automated_report_results`.`generated_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$."users"')
;
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
|
66108
|
1481
|
18
|
2026-04-21T13:39:36.450825+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776778776450_m1.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsRepositoryTest.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 68;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE `automated_report_results`.`generated_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$."users"')
;
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide
Cascade
Options
Hide
Project
Structure
Bookmarks
Welcome to SonarQube for IDE
Pull Requests
More
Problems
Terminal
TODO
Windsurf Console
SonarQube for IDE
Services
Git
Notifications...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsRepositoryTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsRepositoryTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsRepositoryTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"5","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"18","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"14","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 68;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE `automated_report_results`.`generated_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$.\"users\"')\n;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;","depth":4,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 68;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE `automated_report_results`.`generated_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$.\"users\"')\n;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Cascade","depth":3,"role_description":"text"},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Structure","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Bookmarks","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Welcome to SonarQube for IDE","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Pull Requests","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Problems","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Terminal","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TODO","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Windsurf Console","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"SonarQube for IDE","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Services","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Git","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Notifications","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-2058770335596591847
|
-6932414703109761459
|
click
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 68;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE `automated_report_results`.`generated_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$."users"')
;
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide
Cascade
Options
Hide
Project
Structure
Bookmarks
Welcome to SonarQube for IDE
Pull Requests
More
Problems
Terminal
TODO
Windsurf Console
SonarQube for IDE
Services
Git
Notifications...
|
66106
|
|
66107
|
1482
|
20
|
2026-04-21T13:39:34.467196+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776778774467_m2.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsRepositoryTest.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8753325,"top":0.915403,"width":0.11037234,"height":0.027134877},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-1893602885290163199
|
-111362220099133254
|
click
|
hybrid
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
PhostormVIewINavigarecodeLaravelFV faVsco.js( #11894 on JY-18909-automated-reports-askProledeyc) RematchActivityonermootc) RemoteCrmRecoraDeleted,© ResolveOwnerTest.phpM DealRISKSW clasticsearch> D GroupsL ImportC Mailbox442_OoponuniuiesC7 Plavlists>D Teamsl TranscriptionwUsersWebhookTaMaiI ModelKN NotilicationsM Policies• Providers• RepositoriesM Crmlch ActivitvRenositorvTect nhnich AutomatedRenortcRenositorv]© TeaminsightsRepositoryTest.pei TeamRenositorviest.onpLocal ChangesConsoleLoa X• Up trackino controller 1 file. Yesterdav 9:22Don't send it no sz nath (tix undate to tailed) 1 file. 17.04.26. 12.56)> ESATURS CHANGES 3 files. 6.04.26. 13:401web.oho fix router 1 file. 1.04.26. 9:231> SF Tvoe error fix 2 files. 31.03.26. 12:26• neyt automated renort task 1 file. 31.03.26. 10:551• who knows 2 files. 24.03.26. 14:451• tomn fiy 22 filec 2402 26 10-51.env local not sure why it was changed 1 file, 24.03.26, 10:04• Al Penorte 21 filoc 10 02 26 19•07• OBJECT WEBHOOK PROCESSING 5 files, 5.03.26, 15:22> OBJECT BATCH SYNC 13 files, 5.03.26, 15:21›> sync objects changes 1 file, 4.03.26, 12:45› pipedrive fix 2 files, 27.02.26, 11:55› import batch co 13 files, 25.02.26, 21:03> old analyze commented 1 file, 25.02.26, 11:39> new aona command commented 1 file. 24.02.26, 18:06> old aona command commented 1 file. 24.02.26. 16:47> commands to test 2 files. 24.02.26. 16:26> temo 17 files. 20.02.26. 14:32> Keep changes 5 files. 18.02.26. 12:18© AutomatedReportsRepositoryTest.php(c) Service.onp© TrackProviderInstalledEvent.phpclass AutomatedReportsRepos1torvlest extends Testcasepublic function testApplyUserAccessscopew1thout6roup0m1ts6roupBranchl: voidautomated revorts. recioientsSsabsSthis->assertStringNotContainsStrinane• automated_reports. groups', $squ);automated reports' 'tvne', Ssal):Sthis->assertNotContains@needAutomatedRenortsService::TYPE ASK JIMINNY. Sbindinas)Sthis-sassentContains. needle: 100. Shandinas)Lusagesprivate function invokeApplyUserAccessScope(object $query, User $user): voidSrepository = new AutomatedReportsRepositoryO;Smethod = new ReflectionMethod(Srepository,method:'applyUserAccessScope')Snechod->setaccesstolel acce:dle. truesnSmethod->invoke(Srepository, Squery, Suser):Do notignore Highlight words - 1A S 2A Base version routeclani nhaSrouter->post('/deal/{opportunity}/discard', [AiCrmNotesController::class, 'discardBy0pportunity']):// Automated ReportsSrouter->group(prerix = 'aucomaced-reporcsmidoleware →can:canaccessalkeporcs, , user..class100% S2Tue 21 Apr 16:39:34AutomatedReportsRepositorylestv=custom.log4 SF jiminny@localhost] XCascadef ho_local Uiminny@localnostA console [PROD]createAcuvityLoggedevent.pnp© SendReportMailJob.phpA2 45 X1 X9 ^v15:165166=172#:176A console (EU]Review Planhat IntearAutomated Report ElAutomated Reports RCalendar Multi-Domalreport-not-generated.blade.phgNow aopend the new tests before the closina brace:A console (STAGING]AutomatedReportsRepositorvTest.phpe jiminnyclcel * rkon accivity searches where 10018 A14 V2 V4 A VELECT * FROM activity_search_filters WHERE activity_search_ELECT * FROM automated reports where id = 68;PuAlt aucomaced reporus set playbook cacegories = NULL where 10 = 0ELECT * FROM automated_report_results where id = 275:o decker nxe dpoktorses7A ponarenteports/eposttr Testeppr a9e 1i =op yUserAcCessScopePHPUnit 11.5.55 by Sebastian Bergmann and contributors.Cuntiguration: Phone/jiminy/phpunit.xml2 / 2 (100%)ELECT * FROM automated_reports order by id desc;ELECT * FROM automated report results order by 1d desc:Time: 00:01.303. Memory: 64.00 METhought for 1sPond AutomatedDeorv nhn #l 200-21ELEC * FROM GrOUOS WHERE 10 = 14591ELECT * FROM users WHERE aroun id = 1439:The user's tinal code removed created by . Updating tests to match actual behavior® Autorelect * from permissions: # 158elect * from roles:elect * from permission roleelect * from teams where id = 1;elect * from groups g JOIN playbooks p 1..n<->1: on g.playbook_id =Claude Onuc 17 MediumnShelved version+0 ..O0 1.dltterenceWWWWWWWWWWWWWWWWWWWWASrouter->post('/deal/{opportunity}/discard', [AiCrmNotesController::class, 'discardBy0pportunity']):282280281282// Automated ReportsSrouter->post('/automated-reports/track-interest', [UserAutomatedReportsController::class, 'trackInterest'])Srouter->group(286'middleware' => 'can:canAccessA1Reports.' , User::class@ Pushed 1 commit toorigin/Jy-18909-automated-reports-ask-liminnyView oull reauesA62-1UTE.8ih 4 spaces...
|
66104
|
|
66104
|
1482
|
19
|
2026-04-21T13:39:29.706761+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776778769706_m2.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsRepositoryTest.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 68;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE `automated_report_results`.`generated_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$."users"')
;
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8753325,"top":0.915403,"width":0.11037234,"height":0.027134877},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.915403,"width":0.102726065,"height":0.027134877},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8753325,"top":0.9481245,"width":0.03523936,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.12134308,"height":0.025538707},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8161569,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsRepositoryTest","depth":6,"bounds":{"left":0.83144945,"top":0.019952115,"width":0.084109046,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsRepositoryTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsRepositoryTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.44115692,"top":0.17478053,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"5","depth":4,"bounds":{"left":0.45113033,"top":0.17478053,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.46110374,"top":0.17478053,"width":0.00731383,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"bounds":{"left":0.47041222,"top":0.17478053,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.4800532,"top":0.17318435,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.48736703,"top":0.17318435,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.4956782,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.5043218,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.5152925,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.52393615,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.5325798,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.54355055,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.55452126,"top":0.14844373,"width":0.024268618,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.58111703,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.59208775,"top":0.14844373,"width":0.029587766,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.6599069,"top":0.14844373,"width":0.02825798,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.63231385,"top":0.17318435,"width":0.009640957,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"14","depth":4,"bounds":{"left":0.64394945,"top":0.17318435,"width":0.009640957,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.6555851,"top":0.17318435,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.6655585,"top":0.17318435,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.67519945,"top":0.17158818,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.6825133,"top":0.17158818,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 68;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE `automated_report_results`.`generated_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$.\"users\"')\n;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;","depth":4,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 68;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE `automated_report_results`.`generated_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$.\"users\"')\n;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4079194444055345358
|
-6932414698814794163
|
click
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 68;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE `automated_report_results`.`generated_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$."users"')
;
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
|
66110
|
1482
|
21
|
2026-04-21T13:39:37.569195+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776778777569_m2.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsRepositoryTest.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 68;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE `automated_report_results`.`generated_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$."users"')
;
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8753325,"top":0.915403,"width":0.11037234,"height":0.027134877},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.915403,"width":0.102726065,"height":0.027134877},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8753325,"top":0.9481245,"width":0.03523936,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.12134308,"height":0.025538707},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8161569,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsRepositoryTest","depth":6,"bounds":{"left":0.83144945,"top":0.019952115,"width":0.084109046,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsRepositoryTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsRepositoryTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.44115692,"top":0.17478053,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"5","depth":4,"bounds":{"left":0.45113033,"top":0.17478053,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.46110374,"top":0.17478053,"width":0.00731383,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"bounds":{"left":0.47041222,"top":0.17478053,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.4800532,"top":0.17318435,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.48736703,"top":0.17318435,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Repositories;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Collection as SupportCollection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse ReflectionMethod;\nuse Tests\\TestCase;\n\nclass AutomatedReportsRepositoryTest extends TestCase\n{\n protected function setUp(): void\n {\n parent::setUp();\n $this->withoutMockingConsoleOutput();\n }\n\n /**\n * Test the update method.\n */\n public function testUpdate(): void\n {\n // Create a mock of AutomatedReport\n $reportMock = $this->createMock(AutomatedReport::class);\n\n // Set up the update method to return true\n $reportMock->expects($this->once())\n ->method('update')\n ->with(['type' => 'updated_type'])\n ->willReturn(true);\n\n // Create the repository and call the update method\n $repository = new AutomatedReportsRepository();\n $result = $repository->update($reportMock, ['type' => 'updated_type']);\n\n // Assert that the result is the report mock\n $this->assertSame($reportMock, $result);\n }\n\n /**\n * Test the create method by mocking the static create method.\n */\n public function testCreate(): void\n {\n $data = ['team_id' => 1, 'type' => 'test_type'];\n $report = $this->createMock(AutomatedReport::class);\n\n // Use reflection to replace the create method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['create'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('create')\n ->with($data)\n ->willReturn($report);\n\n $result = $repository->create($data);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when a report is found.\n */\n public function testFindByUuidWithExistingReport(): void\n {\n $uuid = 'test-uuid';\n $report = $this->createMock(AutomatedReport::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn($report);\n\n $result = $repository->findByUuid($uuid);\n $this->assertSame($report, $result);\n }\n\n /**\n * Test the findByUuid method when no report is found.\n */\n public function testFindByUuidWithNonExistingReport(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findByUuid($uuid);\n $this->assertNull($result);\n }\n\n public function testGetAllStandardReports(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n $this->assertSame($collection, $result);\n }\n\n /**\n * Test the createResult method.\n */\n public function testCreateResult(): void\n {\n $data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['createResult'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('createResult')\n ->with($data)\n ->willReturn($reportResult);\n\n $result = $repository->createResult($data);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when a result is found.\n */\n public function testFindResultByUuidWithExistingResult(): void\n {\n $uuid = 'test-uuid';\n $reportResult = $this->createMock(AutomatedReportResult::class);\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn($reportResult);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertSame($reportResult, $result);\n }\n\n /**\n * Test the findResultByUuid method when no result is found.\n */\n public function testFindResultByUuidWithNonExistingResult(): void\n {\n $uuid = 'non-existing-uuid';\n\n // Use a partial mock of the repository to test the method\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['findResultByUuid'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('findResultByUuid')\n ->with($uuid)\n ->willReturn(null);\n\n $result = $repository->findResultByUuid($uuid);\n $this->assertNull($result);\n }\n\n /**\n * Test the getReportIdsByTeam method.\n */\n public function testGetReportIdsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportsByTeam method.\n */\n public function testGetReportsByTeam(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getResultsByReport method.\n */\n public function testGetResultsByReport(): void\n {\n // Skip this test since it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');\n }\n\n /**\n * Test the getReportResultsQueryForRetention method.\n */\n public function testGetReportResultsQueryForRetention(): void\n {\n // Skip this test for now - it requires more complex mocking\n $this->markTestSkipped('This test requires more complex mocking of query builder');\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method without team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithoutFilter(): void\n {\n // Setup\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // No 'where' call expected\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults();\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n /**\n * Test the getTeamIdsWithReportsResults method with team ID filter.\n */\n public function testGetTeamIdsWithReportsResultsWithFilter(): void\n {\n // Setup\n $teamId = 123;\n $expectedCollection = Mockery::mock(SupportCollection::class);\n\n // Mock DB facade\n $queryBuilder = Mockery::mock('Illuminate\\Database\\Query\\Builder');\n\n DB::shouldReceive('table')\n ->once()\n ->with('automated_reports')\n ->andReturn($queryBuilder);\n\n $queryBuilder->shouldReceive('join')\n ->once()\n ->with('teams', 'automated_reports.team_id', '=', 'teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('select')\n ->once()\n ->with('teams.id')\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('distinct')\n ->once()\n ->andReturnSelf();\n\n // 'where' call expected with team ID\n $queryBuilder->shouldReceive('where')\n ->once()\n ->with('teams.id', $teamId)\n ->andReturnSelf();\n\n $queryBuilder->shouldReceive('pluck')\n ->once()\n ->with('teams.id')\n ->andReturn($expectedCollection);\n\n // Execute\n $repository = new AutomatedReportsRepository();\n $result = $repository->getTeamIdsWithReportsResults($teamId);\n\n // Verify\n $this->assertSame($expectedCollection, $result);\n }\n\n public function testGetAllStandardReportsReturnsDelegatedCollection(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->with('created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports('created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAllStandardReportsDefaultParameters(): void\n {\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAllStandardReports'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAllStandardReports')\n ->willReturn($collection);\n\n $result = $repository->getAllStandardReports();\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_at', 'desc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserDefaultParameters(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user)\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user);\n\n $this->assertSame($collection, $result);\n }\n\n public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void\n {\n $user = $this->createMock(User::class);\n $collection = $this->createMock(Collection::class);\n\n $repository = $this->getMockBuilder(AutomatedReportsRepository::class)\n ->onlyMethods(['getAskJiminnyReportsByUser'])\n ->getMock();\n\n $repository->expects($this->once())\n ->method('getAskJiminnyReportsByUser')\n ->with($user, 'created_by', 'asc')\n ->willReturn($collection);\n\n $result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');\n\n $this->assertSame($collection, $result);\n }\n\n public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(7);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`groups`', $sql);\n\n $this->assertContains(100, $bindings);\n $this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n }\n\n public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void\n {\n $user = $this->createMock(User::class);\n $user->method('getId')->willReturn(42);\n $user->method('getTeamId')->willReturn(100);\n $user->method('getGroupId')->willReturn(null);\n\n $query = AutomatedReport::query();\n\n $this->invokeApplyUserAccessScope($query, $user);\n\n $sql = $query->toSql();\n $bindings = $query->getBindings();\n\n $this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);\n $this->assertStringContainsString('`automated_reports`.`recipients`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);\n $this->assertStringNotContainsString('`automated_reports`.`type`', $sql);\n $this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);\n $this->assertContains(100, $bindings);\n }\n\n private function invokeApplyUserAccessScope(object $query, User $user): void\n {\n $repository = new AutomatedReportsRepository();\n $method = new ReflectionMethod($repository, 'applyUserAccessScope');\n $method->setAccessible(true);\n $method->invoke($repository, $query, $user);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.4956782,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.5043218,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.5152925,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.52393615,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.5325798,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.54355055,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.55452126,"top":0.14844373,"width":0.024268618,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.58111703,"top":0.14844373,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.59208775,"top":0.14844373,"width":0.029587766,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.6599069,"top":0.14844373,"width":0.02825798,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.63231385,"top":0.17318435,"width":0.009640957,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"14","depth":4,"bounds":{"left":0.64394945,"top":0.17318435,"width":0.009640957,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.6555851,"top":0.17318435,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.6655585,"top":0.17318435,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.67519945,"top":0.17158818,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.6825133,"top":0.17158818,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 68;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE `automated_report_results`.`generated_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$.\"users\"')\n;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;","depth":4,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 68;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE `automated_report_results`.`generated_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$.\"users\"')\n;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4079194444055345358
|
-6932414698814794163
|
click
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsRepositoryTest
Run 'AutomatedReportsRepositoryTest'
Debug 'AutomatedReportsRepositoryTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
5
1
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Collection as SupportCollection;
use Illuminate\Support\Facades\DB;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Mockery;
use ReflectionMethod;
use Tests\TestCase;
class AutomatedReportsRepositoryTest extends TestCase
{
protected function setUp(): void
{
parent::setUp();
$this->withoutMockingConsoleOutput();
}
/**
* Test the update method.
*/
public function testUpdate(): void
{
// Create a mock of AutomatedReport
$reportMock = $this->createMock(AutomatedReport::class);
// Set up the update method to return true
$reportMock->expects($this->once())
->method('update')
->with(['type' => 'updated_type'])
->willReturn(true);
// Create the repository and call the update method
$repository = new AutomatedReportsRepository();
$result = $repository->update($reportMock, ['type' => 'updated_type']);
// Assert that the result is the report mock
$this->assertSame($reportMock, $result);
}
/**
* Test the create method by mocking the static create method.
*/
public function testCreate(): void
{
$data = ['team_id' => 1, 'type' => 'test_type'];
$report = $this->createMock(AutomatedReport::class);
// Use reflection to replace the create method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['create'])
->getMock();
$repository->expects($this->once())
->method('create')
->with($data)
->willReturn($report);
$result = $repository->create($data);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when a report is found.
*/
public function testFindByUuidWithExistingReport(): void
{
$uuid = 'test-uuid';
$report = $this->createMock(AutomatedReport::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn($report);
$result = $repository->findByUuid($uuid);
$this->assertSame($report, $result);
}
/**
* Test the findByUuid method when no report is found.
*/
public function testFindByUuidWithNonExistingReport(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findByUuid'])
->getMock();
$repository->expects($this->once())
->method('findByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findByUuid($uuid);
$this->assertNull($result);
}
public function testGetAllStandardReports(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
/**
* Test the createResult method.
*/
public function testCreateResult(): void
{
$data = ['report_id' => 1, 'status' => AutomatedReportResult::STATUS_REQUESTED];
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['createResult'])
->getMock();
$repository->expects($this->once())
->method('createResult')
->with($data)
->willReturn($reportResult);
$result = $repository->createResult($data);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when a result is found.
*/
public function testFindResultByUuidWithExistingResult(): void
{
$uuid = 'test-uuid';
$reportResult = $this->createMock(AutomatedReportResult::class);
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn($reportResult);
$result = $repository->findResultByUuid($uuid);
$this->assertSame($reportResult, $result);
}
/**
* Test the findResultByUuid method when no result is found.
*/
public function testFindResultByUuidWithNonExistingResult(): void
{
$uuid = 'non-existing-uuid';
// Use a partial mock of the repository to test the method
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['findResultByUuid'])
->getMock();
$repository->expects($this->once())
->method('findResultByUuid')
->with($uuid)
->willReturn(null);
$result = $repository->findResultByUuid($uuid);
$this->assertNull($result);
}
/**
* Test the getReportIdsByTeam method.
*/
public function testGetReportIdsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportsByTeam method.
*/
public function testGetReportsByTeam(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getResultsByReport method.
*/
public function testGetResultsByReport(): void
{
// Skip this test since it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of Eloquent static calls');
}
/**
* Test the getReportResultsQueryForRetention method.
*/
public function testGetReportResultsQueryForRetention(): void
{
// Skip this test for now - it requires more complex mocking
$this->markTestSkipped('This test requires more complex mocking of query builder');
}
/**
* Test the getTeamIdsWithReportsResults method without team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithoutFilter(): void
{
// Setup
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// No 'where' call expected
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults();
// Verify
$this->assertSame($expectedCollection, $result);
}
/**
* Test the getTeamIdsWithReportsResults method with team ID filter.
*/
public function testGetTeamIdsWithReportsResultsWithFilter(): void
{
// Setup
$teamId = 123;
$expectedCollection = Mockery::mock(SupportCollection::class);
// Mock DB facade
$queryBuilder = Mockery::mock('Illuminate\Database\Query\Builder');
DB::shouldReceive('table')
->once()
->with('automated_reports')
->andReturn($queryBuilder);
$queryBuilder->shouldReceive('join')
->once()
->with('teams', 'automated_reports.team_id', '=', 'teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('select')
->once()
->with('teams.id')
->andReturnSelf();
$queryBuilder->shouldReceive('distinct')
->once()
->andReturnSelf();
// 'where' call expected with team ID
$queryBuilder->shouldReceive('where')
->once()
->with('teams.id', $teamId)
->andReturnSelf();
$queryBuilder->shouldReceive('pluck')
->once()
->with('teams.id')
->andReturn($expectedCollection);
// Execute
$repository = new AutomatedReportsRepository();
$result = $repository->getTeamIdsWithReportsResults($teamId);
// Verify
$this->assertSame($expectedCollection, $result);
}
public function testGetAllStandardReportsReturnsDelegatedCollection(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->with('created_at', 'desc')
->willReturn($collection);
$result = $repository->getAllStandardReports('created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAllStandardReportsDefaultParameters(): void
{
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAllStandardReports'])
->getMock();
$repository->expects($this->once())
->method('getAllStandardReports')
->willReturn($collection);
$result = $repository->getAllStandardReports();
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserReturnsDelegatedCollection(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_at', 'desc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_at', 'desc');
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserDefaultParameters(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user)
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user);
$this->assertSame($collection, $result);
}
public function testGetAskJiminnyReportsByUserAcceptsCustomSort(): void
{
$user = $this->createMock(User::class);
$collection = $this->createMock(Collection::class);
$repository = $this->getMockBuilder(AutomatedReportsRepository::class)
->onlyMethods(['getAskJiminnyReportsByUser'])
->getMock();
$repository->expects($this->once())
->method('getAskJiminnyReportsByUser')
->with($user, 'created_by', 'asc')
->willReturn($collection);
$result = $repository->getAskJiminnyReportsByUser($user, 'created_by', 'asc');
$this->assertSame($collection, $result);
}
public function testApplyUserAccessScopeWithGroupIncludesAllBranches(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(7);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringContainsString('`automated_reports`.`type` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`groups`', $sql);
$this->assertContains(100, $bindings);
$this->assertContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
}
public function testApplyUserAccessScopeWithoutGroupOmitsGroupBranch(): void
{
$user = $this->createMock(User::class);
$user->method('getId')->willReturn(42);
$user->method('getTeamId')->willReturn(100);
$user->method('getGroupId')->willReturn(null);
$query = AutomatedReport::query();
$this->invokeApplyUserAccessScope($query, $user);
$sql = $query->toSql();
$bindings = $query->getBindings();
$this->assertStringContainsString('`automated_reports`.`team_id` = ?', $sql);
$this->assertStringContainsString('`automated_reports`.`recipients`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`groups`', $sql);
$this->assertStringNotContainsString('`automated_reports`.`type`', $sql);
$this->assertNotContains(AutomatedReportsService::TYPE_ASK_JIMINNY, $bindings);
$this->assertContains(100, $bindings);
}
private function invokeApplyUserAccessScope(object $query, User $user): void
{
$repository = new AutomatedReportsRepository();
$method = new ReflectionMethod($repository, 'applyUserAccessScope');
$method->setAccessible(true);
$method->invoke($repository, $query, $user);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
18
14
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 68;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE `automated_report_results`.`generated_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 1635, '$."users"')
;
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
|
66919
|
1508
|
4
|
2026-04-21T15:16:21.397611+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776784581397_m2.jpg...
|
PhpStorm
|
faVsco.js – UserAutomatedReportsController.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.11037234,"height":0.027134877},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-1893602885290163199
|
-111362220099133254
|
idle
|
hybrid
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
PhostormVIewINavigarecodeFV faVsco.js( #11894 on JY-18909-automated-reports-aslProledey› D Themesv D UserAutomatedReportsC userAutomateakeporist> Dv2Actionitemscontroller.pnpActivityController.php© AiCrmNotesController.phpc) Basecontroller.phrc) clientlokenController.phgc) crmeontroller.phpC) DealLevelPromotscontrolleC) DealRiskController.phoC)InstantMeetinacontrolller.oc) Lanquadecontrolller.onoC) LavoutManagementControlli© LiveFeedController.phpC) MeetinasController.oho© MessageController.phpC) MetadataController nhn(c) MobileSottinasController.ni© MomentController.php© NudgeController.phpC) NumberAllocatorControllerCC) Oraanization| icensesContr© OrganizationMembersConti© OrganizationRetentionPolice urganizatlonkolescontrollec) Orcanizationsynecontrollece DartnerController.onpc) PhoneNumberController.oh€ PlaybackController.php€ PlaylistController.php€ ScimController.phg4) CidekickController.phpSoftohoneController.phnC) SsoController.onoC)SubscriotionController.ono€ TeamAiAutomationControllC)TeamAiContextController.o@ TeamController.ohpC)Teaminsiahtscontrolier.ohrC)TranscrintionController.ohnC) TranslationController.nhnl© UserController.phpYC) VocabularvController.nhn>M AuthM CustomerAniM intornal)mKiock>C SettingsAskJIminnykeportAcuvilyservice.orpC) Service.php© Field.phpC) AutomatedReportsSendcommand.ongCreatemeldAcuivityevent.ongC) AutomatedReportResult.phoC) AutomatedReport.phpclass UserAutomatedReportsController extends Controllenpublic function list(Request Srequest): JsonResponsesortDirection: ssortDirection.resultsPerPage: self::RESULTS_PER_PAGE,page: $page,frombate: $frombate,tolate• Stolate.teamIds: array_map( callback:'intval', $teamIds)nenon+Tvnes: SrenontTvnes.name: SnameSreportResults = $this->automatedReportsService->transformReportResults(SpaginatedUserReports->getCollectionSteam = Suser->qetTeam®:SreportTypeFilter = Sthis->automatedReportsService->qetReportTypeFieldData(shortversion: true,team: steamsoata = sthis-›apzresponseservzce->tromPaqnatoroArravunaqinator: paqunateduserrevortsself::SORT COLUMN => Ssort->value.self::SORT DIRECTION => SsortDirection->value.1,Filtens:SreportTypeFilter['id'] = SreportTypeFilter,neturn Sthis->nesnonse->withAnnav(Sdatal•public function delete(Request Srequest, string $uuid): JsonResponse{...}— A13X1 ^ v Q 161171173174175176177178• 19d—181-,.-185=custom.log4 SF [jiminny@localhost] XA HS_local [iminny@localhost)# concole [pponlA console (EU]report-not-generated.blade.phgC) sendreportNotGenerateamallJob.phpA console [STAGING]Ty: Auto ye jiminnyFELECT * FROM activity_searches whereELECT * FROM activity search filtens MAEKE M1EA14 X2018 A14 22 X4 1E"ELECT * FROM automated_reports where 1d = 68)IPDATE automated_reports set playbook categories = NULL where id¡ELECT * FROM automated_report_results where id = 275;¡ELECT * FROM automated_reports order by id desc;ELECT * FROM automated_report_results order by id desc;¡elect * from activity_searches where user_id = 143;elect * From ask anvthina nromnts.¡ELECT * FROM groups WHERE id = 1439)ELECT * FROM users WHERE group_id = 1439;ielect * from permissions; # 158elect x tron roleselect * from permission_roleielect * from teams where id = 1:ielect * from groups q JOIN playbooks p 1..n<->1: on g.playbook idielect * from groups where id = 28:ielect * from playbooks where team id = 1:elect * trom playbooks where 10 = 179ielect * from playbook categories where id = 1391:elect * trom users where 10 = 1451ielect * from crm profiles where user 1d = 145%elect * from activities where erm confiquration id = 39 and tvoend crm orovider id IS NOT NULL ORDER by id desc:elect * from activities where id = 422003: # 00U04000000B6foMACELECT ar.id, ar.uuid, ar.media type, ar.status, a.typeROM automated renont results anOIN automated_reports a ON a.id = ar.report.idTHERE a.type ='ask_jiminnyTMTT 10•HELECTautomated_report_results.* FROMNNEP IOTM 'automatod nonontel'automated nenont pesultiJHEpS "automatod nonont noculte' 'aononatod atiautonated_ report_results', report.id'= automated_reportsTC MOT MuLIANDautomated reports'.'team_id' = 1AND JSON CONTAINS('automated_ reports'.'recipients'. 1635, '$."u100% SzTue 21 Apr 18:16:22AutomatedReportsServiceTest ~CascadeReview Planhat IntearAutomated Reports RCalendar Multi-Domal+0 ..run tests and fix if not passingdeste/umt/Reposcor/es/Au tona tedheportsReposttoryTest.php lest5/unst/Pol1ctes/CanACCeS5A.Reportstest: php/tects/linit/Policies/GanAcceccAiRenortsTect.ohn 2>61PHPUnit 11.5.55 by Sebastian Beramann and contrilbutors.FhP 0.3.30Configuration: /home/jaminny/phpunit.xml9 / 453 ( 41A| 453 tests pass (6 ore-existina skiooed. 5 unrelated PHPUnit deprecation notices). No fixes needed.Teal ae— 202Ask anvthina (84-D+ @ Code Claude Qnus 17 Medium@ Pushed 1 commit toorigin/Jy-18909-automated-reporis-ask-liminnyView null reaues# 1 file committedJY-18909 change recipientsEdit Commit Messaae.WN Windsurf Teams02-24 LITC.8io 4 spaces...
|
66917
|
|
67861
|
1529
|
21
|
2026-04-21T16:10:52.484073+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776787852484_m2.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsServiceTest.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
2 files committed
JY-18909 modify the recipients check
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsServiceTest
Run 'AutomatedReportsServiceTest'
Debug 'AutomatedReportsServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.11037234,"height":0.027134877},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.102726065,"height":0.027134877},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8753325,"top":0.87150836,"width":0.03523936,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2 files committed","depth":2,"bounds":{"left":0.8753325,"top":0.91300875,"width":0.100398935,"height":0.013567438},"role_description":"text"},{"role":"AXTextField","text":"JY-18909 modify the recipients check","depth":3,"bounds":{"left":0.8753325,"top":0.92897046,"width":0.11037234,"height":0.013567438},"value":"JY-18909 modify the recipients check","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.92897046,"width":0.077792555,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"bounds":{"left":0.8753325,"top":0.9481245,"width":0.048204787,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.12732713,"height":0.025538707},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8218085,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsServiceTest","depth":6,"bounds":{"left":0.83710104,"top":0.019952115,"width":0.078457445,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
7095181912145797769
|
-8348317175836376684
|
click
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
2 files committed
JY-18909 modify the recipients check
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsServiceTest
Run 'AutomatedReportsServiceTest'
Debug 'AutomatedReportsServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings...
|
NULL
|
|
55749
|
1202
|
13
|
2026-04-20T10:07:01.132882+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-20/1776 /Users/lukas/.screenpipe/data/data/2026-04-20/1776679621132_m2.jpg...
|
PhpStorm
|
faVsco.js – AskJiminnyReportActivityServiceTest.ph faVsco.js – AskJiminnyReportActivityServiceTest.php...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 fix flanky test
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Kiosk\AutomatedReports;
use Carbon\CarbonImmutable;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityActualDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityUpdatedDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\DealInsights\ClosingPeriodFilter;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Component\ActivitySearch\Service\ActivitySearch;
use Jiminny\Models\Activity\Search;
use Jiminny\Models\Activity\SearchFilter;
use Jiminny\Models\User;
use Jiminny\Repositories\ElasticActivityRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AskJiminnyReportActivityService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
class AskJiminnyReportActivityServiceTest extends TestCase
{
private ActivitySearch&MockObject $activitySearch;
private ElasticActivityRepository&MockObject $elasticRepository;
private LoggerInterface&MockObject $logger;
private AskJiminnyReportActivityService $service;
protected function setUp(): void
{
$this->activitySearch = $this->createMock(ActivitySearch::class);
$this->elasticRepository = $this->createMock(ElasticActivityRepository::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->service = new AskJiminnyReportActivityService(
$this->activitySearch,
$this->elasticRepository,
$this->logger,
);
}
private function makeFilter(string $key, ?string $value): SearchFilter&MockObject
{
$filter = $this->createMock(SearchFilter::class);
$filter->method('getFilterProperty')->willReturn($key);
$filter->method('getFilterValue')->willReturn($value);
return $filter;
}
private function makeUser(): User&MockObject
{
$tz = new \DateTimeZone('UTC');
$user = $this->createMock(User::class);
$user->method('getTimezone')->willReturn($tz);
$user->method('getId')->willReturn(1);
$user->method('getUuid')->willReturn('user-uuid');
return $user;
}
private function makeSavedSearch(array $filters): Search&MockObject
{
$savedSearch = $this->createMock(Search::class);
$savedSearch->method('getId')->willReturn(42);
$savedSearch->method('getFilters')->willReturn(new \Illuminate\Support\LazyCollection($filters));
return $savedSearch;
}
public function testGetActivityIdsForSavedSearchReturnsIds(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->expects($this->once())
->method('getArrayFilterKeys')
->with($user)
->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->expects($this->once())
->method('onDemandSearchIdsOnly')
->willReturn(['id-1', 'id-2', 'id-3']);
$this->logger->expects($this->once())
->method('info')
->with('[AskJiminnyReport] Fetched activity IDs for saved search');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1', 'id-2', 'id-3'], $result);
}
public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->expects($this->once())->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEmpty($result);
}
public function testGetActivityIdsFiltersOutDateFilters(): void
{
$user = $this->makeUser();
$nonDateFilter = $this->makeFilter('owner_id', '123');
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');
$updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');
$updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');
$savedSearch = $this->makeSavedSearch([
$nonDateFilter,
$startDateFilter,
$endDateFilter,
$updatedFromFilter,
$updatedToFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
}
public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void
{
$user = $this->makeUser();
$closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');
$closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');
$regularFilter = $this->makeFilter('rep_id', '99');
$savedSearch = $this->makeSavedSearch([
$closingStartFilter,
$closingEndFilter,
$regularFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesArrayFilters(): void
{
$user = $this->makeUser();
$filter1 = $this->makeFilter('outcome', 'positive');
$filter2 = $this->makeFilter('outcome', 'negative');
$savedSearch = $this->makeSavedSearch([$filter1, $filter2]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesScalarFilters(): void
{
$user = $this->makeUser();
$filter = $this->makeFilter('direction', 'inbound');
$savedSearch = $this->makeSavedSearch([$filter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-5'], $result);
}
public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
$this->assertFalse($capturedCriteria->isFirstRequest());
}
public function testGetActivityIdsLogsWithCorrectContext(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);
$this->logger->expects($this->once())
->method('info')
->with(
'[AskJiminnyReport] Fetched activity IDs for saved search',
$this->callback(fn ($context) => $context['saved_search_id'] === 42
&& $context['user_id'] === 1
&& $context['activity_count'] === 2)
);
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
}
public static function frequencyDateRangeProvider(): array
{
$now = CarbonImmutable::parse('2025-06-16 12:00:00');
return [
'daily' => [
AutomatedReportsService::FREQUENCY_DAILY,
$now->subDay()->startOfDay()->format('Y-m-d H:i:s'),
$now->subDay()->endOfDay()->format('Y-m-d H:i:s'),
],
'weekly' => [
AutomatedReportsService::FREQUENCY_WEEKLY,
$now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),
$now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),
],
'monthly' => [
AutomatedReportsService::FREQUENCY_MONTHLY,
$now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),
$now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),
],
'quarterly' => [
AutomatedReportsService::FREQUENCY_QUARTERLY,
$now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),
$now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),
],
];
}
/**
* @dataProvider frequencyDateRangeProvider
*/
public function testGetActivityIdsInjectsDateRangeForFrequency(
string $frequency,
string $expectedStartDate,
string $expectedEndDate,
): void {
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);
$this->assertNotNull($capturedCriteria);
$this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void
{
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');
$savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);
$this->assertNotNull($capturedCriteria);
$this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a....
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.11037234,"height":0.027134877},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.102726065,"height":0.027134877},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8753325,"top":0.87150836,"width":0.03523936,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1 file committed","depth":2,"bounds":{"left":0.8753325,"top":0.91300875,"width":0.100398935,"height":0.013567438},"role_description":"text"},{"role":"AXTextField","text":"JY-18909 fix flanky test","depth":3,"bounds":{"left":0.8753325,"top":0.92897046,"width":0.11037234,"height":0.013567438},"value":"JY-18909 fix flanky test","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.92897046,"width":0.04886968,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"bounds":{"left":0.8753325,"top":0.9481245,"width":0.048204787,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.12732713,"height":0.025538707},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.36968085,"top":0.2490024,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.37965426,"top":0.2490024,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.38929522,"top":0.24740623,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.39660904,"top":0.24740623,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Kiosk\\AutomatedReports;\n\nuse Carbon\\CarbonImmutable;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityActualDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityUpdatedDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\DealInsights\\ClosingPeriodFilter;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Component\\ActivitySearch\\Service\\ActivitySearch;\nuse Jiminny\\Models\\Activity\\Search;\nuse Jiminny\\Models\\Activity\\SearchFilter;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ElasticActivityRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AskJiminnyReportActivityService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse PHPUnit\\Framework\\TestCase;\nuse Psr\\Log\\LoggerInterface;\n\nclass AskJiminnyReportActivityServiceTest extends TestCase\n{\n private ActivitySearch&MockObject $activitySearch;\n private ElasticActivityRepository&MockObject $elasticRepository;\n private LoggerInterface&MockObject $logger;\n private AskJiminnyReportActivityService $service;\n\n protected function setUp(): void\n {\n $this->activitySearch = $this->createMock(ActivitySearch::class);\n $this->elasticRepository = $this->createMock(ElasticActivityRepository::class);\n $this->logger = $this->createMock(LoggerInterface::class);\n\n $this->service = new AskJiminnyReportActivityService(\n $this->activitySearch,\n $this->elasticRepository,\n $this->logger,\n );\n }\n\n private function makeFilter(string $key, ?string $value): SearchFilter&MockObject\n {\n $filter = $this->createMock(SearchFilter::class);\n $filter->method('getFilterProperty')->willReturn($key);\n $filter->method('getFilterValue')->willReturn($value);\n\n return $filter;\n }\n\n private function makeUser(): User&MockObject\n {\n $tz = new \\DateTimeZone('UTC');\n $user = $this->createMock(User::class);\n $user->method('getTimezone')->willReturn($tz);\n $user->method('getId')->willReturn(1);\n $user->method('getUuid')->willReturn('user-uuid');\n\n return $user;\n }\n\n private function makeSavedSearch(array $filters): Search&MockObject\n {\n $savedSearch = $this->createMock(Search::class);\n $savedSearch->method('getId')->willReturn(42);\n $savedSearch->method('getFilters')->willReturn(new \\Illuminate\\Support\\LazyCollection($filters));\n\n return $savedSearch;\n }\n\n public function testGetActivityIdsForSavedSearchReturnsIds(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->expects($this->once())\n ->method('getArrayFilterKeys')\n ->with($user)\n ->willReturn([]);\n\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n\n $this->elasticRepository->expects($this->once())\n ->method('onDemandSearchIdsOnly')\n ->willReturn(['id-1', 'id-2', 'id-3']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with('[AskJiminnyReport] Fetched activity IDs for saved search');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1', 'id-2', 'id-3'], $result);\n }\n\n public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $this->logger->expects($this->once())->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEmpty($result);\n }\n\n public function testGetActivityIdsFiltersOutDateFilters(): void\n {\n $user = $this->makeUser();\n\n $nonDateFilter = $this->makeFilter('owner_id', '123');\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');\n $updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');\n $updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');\n\n $savedSearch = $this->makeSavedSearch([\n $nonDateFilter,\n $startDateFilter,\n $endDateFilter,\n $updatedFromFilter,\n $updatedToFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n }\n\n public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void\n {\n $user = $this->makeUser();\n\n $closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');\n $closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');\n $regularFilter = $this->makeFilter('rep_id', '99');\n\n $savedSearch = $this->makeSavedSearch([\n $closingStartFilter,\n $closingEndFilter,\n $regularFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesArrayFilters(): void\n {\n $user = $this->makeUser();\n\n $filter1 = $this->makeFilter('outcome', 'positive');\n $filter2 = $this->makeFilter('outcome', 'negative');\n\n $savedSearch = $this->makeSavedSearch([$filter1, $filter2]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesScalarFilters(): void\n {\n $user = $this->makeUser();\n\n $filter = $this->makeFilter('direction', 'inbound');\n $savedSearch = $this->makeSavedSearch([$filter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-5'], $result);\n }\n\n public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertFalse($capturedCriteria->isFirstRequest());\n }\n\n public function testGetActivityIdsLogsWithCorrectContext(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with(\n '[AskJiminnyReport] Fetched activity IDs for saved search',\n $this->callback(fn ($context) => $context['saved_search_id'] === 42\n && $context['user_id'] === 1\n && $context['activity_count'] === 2)\n );\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n }\n\n public static function frequencyDateRangeProvider(): array\n {\n $now = CarbonImmutable::parse('2025-06-16 12:00:00');\n\n return [\n 'daily' => [\n AutomatedReportsService::FREQUENCY_DAILY,\n $now->subDay()->startOfDay()->format('Y-m-d H:i:s'),\n $now->subDay()->endOfDay()->format('Y-m-d H:i:s'),\n ],\n 'weekly' => [\n AutomatedReportsService::FREQUENCY_WEEKLY,\n $now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),\n $now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),\n ],\n 'monthly' => [\n AutomatedReportsService::FREQUENCY_MONTHLY,\n $now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),\n $now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),\n ],\n 'quarterly' => [\n AutomatedReportsService::FREQUENCY_QUARTERLY,\n $now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),\n $now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),\n ],\n ];\n }\n\n /**\n * @dataProvider frequencyDateRangeProvider\n */\n public function testGetActivityIdsInjectsDateRangeForFrequency(\n string $frequency,\n string $expectedStartDate,\n string $expectedEndDate,\n ): void {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n\n public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void\n {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');\n $savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Kiosk\\AutomatedReports;\n\nuse Carbon\\CarbonImmutable;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityActualDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityUpdatedDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\DealInsights\\ClosingPeriodFilter;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Component\\ActivitySearch\\Service\\ActivitySearch;\nuse Jiminny\\Models\\Activity\\Search;\nuse Jiminny\\Models\\Activity\\SearchFilter;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ElasticActivityRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AskJiminnyReportActivityService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse PHPUnit\\Framework\\TestCase;\nuse Psr\\Log\\LoggerInterface;\n\nclass AskJiminnyReportActivityServiceTest extends TestCase\n{\n private ActivitySearch&MockObject $activitySearch;\n private ElasticActivityRepository&MockObject $elasticRepository;\n private LoggerInterface&MockObject $logger;\n private AskJiminnyReportActivityService $service;\n\n protected function setUp(): void\n {\n $this->activitySearch = $this->createMock(ActivitySearch::class);\n $this->elasticRepository = $this->createMock(ElasticActivityRepository::class);\n $this->logger = $this->createMock(LoggerInterface::class);\n\n $this->service = new AskJiminnyReportActivityService(\n $this->activitySearch,\n $this->elasticRepository,\n $this->logger,\n );\n }\n\n private function makeFilter(string $key, ?string $value): SearchFilter&MockObject\n {\n $filter = $this->createMock(SearchFilter::class);\n $filter->method('getFilterProperty')->willReturn($key);\n $filter->method('getFilterValue')->willReturn($value);\n\n return $filter;\n }\n\n private function makeUser(): User&MockObject\n {\n $tz = new \\DateTimeZone('UTC');\n $user = $this->createMock(User::class);\n $user->method('getTimezone')->willReturn($tz);\n $user->method('getId')->willReturn(1);\n $user->method('getUuid')->willReturn('user-uuid');\n\n return $user;\n }\n\n private function makeSavedSearch(array $filters): Search&MockObject\n {\n $savedSearch = $this->createMock(Search::class);\n $savedSearch->method('getId')->willReturn(42);\n $savedSearch->method('getFilters')->willReturn(new \\Illuminate\\Support\\LazyCollection($filters));\n\n return $savedSearch;\n }\n\n public function testGetActivityIdsForSavedSearchReturnsIds(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->expects($this->once())\n ->method('getArrayFilterKeys')\n ->with($user)\n ->willReturn([]);\n\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n\n $this->elasticRepository->expects($this->once())\n ->method('onDemandSearchIdsOnly')\n ->willReturn(['id-1', 'id-2', 'id-3']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with('[AskJiminnyReport] Fetched activity IDs for saved search');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1', 'id-2', 'id-3'], $result);\n }\n\n public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $this->logger->expects($this->once())->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEmpty($result);\n }\n\n public function testGetActivityIdsFiltersOutDateFilters(): void\n {\n $user = $this->makeUser();\n\n $nonDateFilter = $this->makeFilter('owner_id', '123');\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');\n $updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');\n $updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');\n\n $savedSearch = $this->makeSavedSearch([\n $nonDateFilter,\n $startDateFilter,\n $endDateFilter,\n $updatedFromFilter,\n $updatedToFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n }\n\n public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void\n {\n $user = $this->makeUser();\n\n $closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');\n $closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');\n $regularFilter = $this->makeFilter('rep_id', '99');\n\n $savedSearch = $this->makeSavedSearch([\n $closingStartFilter,\n $closingEndFilter,\n $regularFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesArrayFilters(): void\n {\n $user = $this->makeUser();\n\n $filter1 = $this->makeFilter('outcome', 'positive');\n $filter2 = $this->makeFilter('outcome', 'negative');\n\n $savedSearch = $this->makeSavedSearch([$filter1, $filter2]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesScalarFilters(): void\n {\n $user = $this->makeUser();\n\n $filter = $this->makeFilter('direction', 'inbound');\n $savedSearch = $this->makeSavedSearch([$filter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-5'], $result);\n }\n\n public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertFalse($capturedCriteria->isFirstRequest());\n }\n\n public function testGetActivityIdsLogsWithCorrectContext(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with(\n '[AskJiminnyReport] Fetched activity IDs for saved search',\n $this->callback(fn ($context) => $context['saved_search_id'] === 42\n && $context['user_id'] === 1\n && $context['activity_count'] === 2)\n );\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n }\n\n public static function frequencyDateRangeProvider(): array\n {\n $now = CarbonImmutable::parse('2025-06-16 12:00:00');\n\n return [\n 'daily' => [\n AutomatedReportsService::FREQUENCY_DAILY,\n $now->subDay()->startOfDay()->format('Y-m-d H:i:s'),\n $now->subDay()->endOfDay()->format('Y-m-d H:i:s'),\n ],\n 'weekly' => [\n AutomatedReportsService::FREQUENCY_WEEKLY,\n $now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),\n $now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),\n ],\n 'monthly' => [\n AutomatedReportsService::FREQUENCY_MONTHLY,\n $now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),\n $now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),\n ],\n 'quarterly' => [\n AutomatedReportsService::FREQUENCY_QUARTERLY,\n $now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),\n $now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),\n ],\n ];\n }\n\n /**\n * @dataProvider frequencyDateRangeProvider\n */\n public function testGetActivityIdsInjectsDateRangeForFrequency(\n string $frequency,\n string $expectedStartDate,\n string $expectedEndDate,\n ): void {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n\n public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void\n {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');\n $savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.40492022,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.41356382,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.4331782,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.4418218,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.45279256,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.4637633,"top":0.09896249,"width":0.024268618,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.49035904,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.5013298,"top":0.09896249,"width":0.029587766,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.69913566,"top":0.09896249,"width":0.02825798,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"27","depth":4,"bounds":{"left":0.6565825,"top":0.123703115,"width":0.009973404,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"bounds":{"left":0.66855055,"top":0.123703115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"23","depth":4,"bounds":{"left":0.67852396,"top":0.123703115,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.69082445,"top":0.123703115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"105","depth":4,"bounds":{"left":0.70079786,"top":0.123703115,"width":0.011968086,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.7144282,"top":0.12210695,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.72174203,"top":0.12210695,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 2288;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","depth":4,"value":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 2288;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5134344117864598351
|
2146738724037637229
|
visual_change
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 fix flanky test
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Kiosk\AutomatedReports;
use Carbon\CarbonImmutable;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityActualDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityUpdatedDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\DealInsights\ClosingPeriodFilter;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Component\ActivitySearch\Service\ActivitySearch;
use Jiminny\Models\Activity\Search;
use Jiminny\Models\Activity\SearchFilter;
use Jiminny\Models\User;
use Jiminny\Repositories\ElasticActivityRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AskJiminnyReportActivityService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
class AskJiminnyReportActivityServiceTest extends TestCase
{
private ActivitySearch&MockObject $activitySearch;
private ElasticActivityRepository&MockObject $elasticRepository;
private LoggerInterface&MockObject $logger;
private AskJiminnyReportActivityService $service;
protected function setUp(): void
{
$this->activitySearch = $this->createMock(ActivitySearch::class);
$this->elasticRepository = $this->createMock(ElasticActivityRepository::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->service = new AskJiminnyReportActivityService(
$this->activitySearch,
$this->elasticRepository,
$this->logger,
);
}
private function makeFilter(string $key, ?string $value): SearchFilter&MockObject
{
$filter = $this->createMock(SearchFilter::class);
$filter->method('getFilterProperty')->willReturn($key);
$filter->method('getFilterValue')->willReturn($value);
return $filter;
}
private function makeUser(): User&MockObject
{
$tz = new \DateTimeZone('UTC');
$user = $this->createMock(User::class);
$user->method('getTimezone')->willReturn($tz);
$user->method('getId')->willReturn(1);
$user->method('getUuid')->willReturn('user-uuid');
return $user;
}
private function makeSavedSearch(array $filters): Search&MockObject
{
$savedSearch = $this->createMock(Search::class);
$savedSearch->method('getId')->willReturn(42);
$savedSearch->method('getFilters')->willReturn(new \Illuminate\Support\LazyCollection($filters));
return $savedSearch;
}
public function testGetActivityIdsForSavedSearchReturnsIds(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->expects($this->once())
->method('getArrayFilterKeys')
->with($user)
->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->expects($this->once())
->method('onDemandSearchIdsOnly')
->willReturn(['id-1', 'id-2', 'id-3']);
$this->logger->expects($this->once())
->method('info')
->with('[AskJiminnyReport] Fetched activity IDs for saved search');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1', 'id-2', 'id-3'], $result);
}
public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->expects($this->once())->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEmpty($result);
}
public function testGetActivityIdsFiltersOutDateFilters(): void
{
$user = $this->makeUser();
$nonDateFilter = $this->makeFilter('owner_id', '123');
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');
$updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');
$updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');
$savedSearch = $this->makeSavedSearch([
$nonDateFilter,
$startDateFilter,
$endDateFilter,
$updatedFromFilter,
$updatedToFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
}
public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void
{
$user = $this->makeUser();
$closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');
$closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');
$regularFilter = $this->makeFilter('rep_id', '99');
$savedSearch = $this->makeSavedSearch([
$closingStartFilter,
$closingEndFilter,
$regularFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesArrayFilters(): void
{
$user = $this->makeUser();
$filter1 = $this->makeFilter('outcome', 'positive');
$filter2 = $this->makeFilter('outcome', 'negative');
$savedSearch = $this->makeSavedSearch([$filter1, $filter2]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesScalarFilters(): void
{
$user = $this->makeUser();
$filter = $this->makeFilter('direction', 'inbound');
$savedSearch = $this->makeSavedSearch([$filter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-5'], $result);
}
public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
$this->assertFalse($capturedCriteria->isFirstRequest());
}
public function testGetActivityIdsLogsWithCorrectContext(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);
$this->logger->expects($this->once())
->method('info')
->with(
'[AskJiminnyReport] Fetched activity IDs for saved search',
$this->callback(fn ($context) => $context['saved_search_id'] === 42
&& $context['user_id'] === 1
&& $context['activity_count'] === 2)
);
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
}
public static function frequencyDateRangeProvider(): array
{
$now = CarbonImmutable::parse('2025-06-16 12:00:00');
return [
'daily' => [
AutomatedReportsService::FREQUENCY_DAILY,
$now->subDay()->startOfDay()->format('Y-m-d H:i:s'),
$now->subDay()->endOfDay()->format('Y-m-d H:i:s'),
],
'weekly' => [
AutomatedReportsService::FREQUENCY_WEEKLY,
$now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),
$now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),
],
'monthly' => [
AutomatedReportsService::FREQUENCY_MONTHLY,
$now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),
$now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),
],
'quarterly' => [
AutomatedReportsService::FREQUENCY_QUARTERLY,
$now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),
$now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),
],
];
}
/**
* @dataProvider frequencyDateRangeProvider
*/
public function testGetActivityIdsInjectsDateRangeForFrequency(
string $frequency,
string $expectedStartDate,
string $expectedEndDate,
): void {
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);
$this->assertNotNull($capturedCriteria);
$this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void
{
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');
$savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);
$this->assertNotNull($capturedCriteria);
$this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a....
|
55748
|
|
55785
|
1202
|
38
|
2026-04-20T10:08:23.387092+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-20/1776 /Users/lukas/.screenpipe/data/data/2026-04-20/1776679703387_m2.jpg...
|
PhpStorm
|
faVsco.js – AskJiminnyReportActivityServiceTest.ph faVsco.js – AskJiminnyReportActivityServiceTest.php...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 fix flanky test
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Kiosk\AutomatedReports;
use Carbon\CarbonImmutable;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityActualDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityUpdatedDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\DealInsights\ClosingPeriodFilter;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Component\ActivitySearch\Service\ActivitySearch;
use Jiminny\Models\Activity\Search;
use Jiminny\Models\Activity\SearchFilter;
use Jiminny\Models\User;
use Jiminny\Repositories\ElasticActivityRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AskJiminnyReportActivityService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
class AskJiminnyReportActivityServiceTest extends TestCase
{
private ActivitySearch&MockObject $activitySearch;
private ElasticActivityRepository&MockObject $elasticRepository;
private LoggerInterface&MockObject $logger;
private AskJiminnyReportActivityService $service;
protected function setUp(): void
{
$this->activitySearch = $this->createMock(ActivitySearch::class);
$this->elasticRepository = $this->createMock(ElasticActivityRepository::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->service = new AskJiminnyReportActivityService(
$this->activitySearch,
$this->elasticRepository,
$this->logger,
);
}
private function makeFilter(string $key, ?string $value): SearchFilter&MockObject
{
$filter = $this->createMock(SearchFilter::class);
$filter->method('getFilterProperty')->willReturn($key);
$filter->method('getFilterValue')->willReturn($value);
return $filter;
}
private function makeUser(): User&MockObject
{
$tz = new \DateTimeZone('UTC');
$user = $this->createMock(User::class);
$user->method('getTimezone')->willReturn($tz);
$user->method('getId')->willReturn(1);
$user->method('getUuid')->willReturn('user-uuid');
return $user;
}
private function makeSavedSearch(array $filters): Search&MockObject
{
$savedSearch = $this->createMock(Search::class);
$savedSearch->method('getId')->willReturn(42);
$savedSearch->method('getFilters')->willReturn(new \Illuminate\Support\LazyCollection($filters));
return $savedSearch;
}
public function testGetActivityIdsForSavedSearchReturnsIds(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->expects($this->once())
->method('getArrayFilterKeys')
->with($user)
->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->expects($this->once())
->method('onDemandSearchIdsOnly')
->willReturn(['id-1', 'id-2', 'id-3']);
$this->logger->expects($this->once())
->method('info')
->with('[AskJiminnyReport] Fetched activity IDs for saved search');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1', 'id-2', 'id-3'], $result);
}
public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->expects($this->once())->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEmpty($result);
}
public function testGetActivityIdsFiltersOutDateFilters(): void
{
$user = $this->makeUser();
$nonDateFilter = $this->makeFilter('owner_id', '123');
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');
$updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');
$updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');
$savedSearch = $this->makeSavedSearch([
$nonDateFilter,
$startDateFilter,
$endDateFilter,
$updatedFromFilter,
$updatedToFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
}
public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void
{
$user = $this->makeUser();
$closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');
$closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');
$regularFilter = $this->makeFilter('rep_id', '99');
$savedSearch = $this->makeSavedSearch([
$closingStartFilter,
$closingEndFilter,
$regularFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesArrayFilters(): void
{
$user = $this->makeUser();
$filter1 = $this->makeFilter('outcome', 'positive');
$filter2 = $this->makeFilter('outcome', 'negative');
$savedSearch = $this->makeSavedSearch([$filter1, $filter2]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesScalarFilters(): void
{
$user = $this->makeUser();
$filter = $this->makeFilter('direction', 'inbound');
$savedSearch = $this->makeSavedSearch([$filter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-5'], $result);
}
public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
$this->assertFalse($capturedCriteria->isFirstRequest());
}
public function testGetActivityIdsLogsWithCorrectContext(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);
$this->logger->expects($this->once())
->method('info')
->with(
'[AskJiminnyReport] Fetched activity IDs for saved search',
$this->callback(fn ($context) => $context['saved_search_id'] === 42
&& $context['user_id'] === 1
&& $context['activity_count'] === 2)
);
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
}
public static function frequencyDateRangeProvider(): array
{
$now = CarbonImmutable::parse('2025-06-16 12:00:00');
return [
'daily' => [
AutomatedReportsService::FREQUENCY_DAILY,
$now->subDay()->startOfDay()->format('Y-m-d H:i:s'),
$now->subDay()->endOfDay()->format('Y-m-d H:i:s'),
],
'weekly' => [
AutomatedReportsService::FREQUENCY_WEEKLY,
$now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),
$now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),
],
'monthly' => [
AutomatedReportsService::FREQUENCY_MONTHLY,
$now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),
$now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),
],
'quarterly' => [
AutomatedReportsService::FREQUENCY_QUARTERLY,
$now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),
$now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),
],
];
}
/**
* @dataProvider frequencyDateRangeProvider
*/
public function testGetActivityIdsInjectsDateRangeForFrequency(
string $frequency,
string $expectedStartDate,
string $expectedEndDate,
): void {
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);
$this->assertNotNull($capturedCriteria);
$this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void
{
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');
$savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);
$this->assertNotNull($capturedCriteria);
$this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a....
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.11037234,"height":0.027134877},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.102726065,"height":0.027134877},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8753325,"top":0.87150836,"width":0.03523936,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1 file committed","depth":2,"bounds":{"left":0.8753325,"top":0.91300875,"width":0.100398935,"height":0.013567438},"role_description":"text"},{"role":"AXTextField","text":"JY-18909 fix flanky test","depth":3,"bounds":{"left":0.8753325,"top":0.92897046,"width":0.11037234,"height":0.013567438},"value":"JY-18909 fix flanky test","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.92897046,"width":0.04886968,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"bounds":{"left":0.8753325,"top":0.9481245,"width":0.048204787,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.12134308,"height":0.025538707},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.3620346,"top":0.2490024,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.37200797,"top":0.2490024,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.38164893,"top":0.24740623,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.38896278,"top":0.24740623,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Kiosk\\AutomatedReports;\n\nuse Carbon\\CarbonImmutable;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityActualDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityUpdatedDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\DealInsights\\ClosingPeriodFilter;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Component\\ActivitySearch\\Service\\ActivitySearch;\nuse Jiminny\\Models\\Activity\\Search;\nuse Jiminny\\Models\\Activity\\SearchFilter;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ElasticActivityRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AskJiminnyReportActivityService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse PHPUnit\\Framework\\TestCase;\nuse Psr\\Log\\LoggerInterface;\n\nclass AskJiminnyReportActivityServiceTest extends TestCase\n{\n private ActivitySearch&MockObject $activitySearch;\n private ElasticActivityRepository&MockObject $elasticRepository;\n private LoggerInterface&MockObject $logger;\n private AskJiminnyReportActivityService $service;\n\n protected function setUp(): void\n {\n $this->activitySearch = $this->createMock(ActivitySearch::class);\n $this->elasticRepository = $this->createMock(ElasticActivityRepository::class);\n $this->logger = $this->createMock(LoggerInterface::class);\n\n $this->service = new AskJiminnyReportActivityService(\n $this->activitySearch,\n $this->elasticRepository,\n $this->logger,\n );\n }\n\n private function makeFilter(string $key, ?string $value): SearchFilter&MockObject\n {\n $filter = $this->createMock(SearchFilter::class);\n $filter->method('getFilterProperty')->willReturn($key);\n $filter->method('getFilterValue')->willReturn($value);\n\n return $filter;\n }\n\n private function makeUser(): User&MockObject\n {\n $tz = new \\DateTimeZone('UTC');\n $user = $this->createMock(User::class);\n $user->method('getTimezone')->willReturn($tz);\n $user->method('getId')->willReturn(1);\n $user->method('getUuid')->willReturn('user-uuid');\n\n return $user;\n }\n\n private function makeSavedSearch(array $filters): Search&MockObject\n {\n $savedSearch = $this->createMock(Search::class);\n $savedSearch->method('getId')->willReturn(42);\n $savedSearch->method('getFilters')->willReturn(new \\Illuminate\\Support\\LazyCollection($filters));\n\n return $savedSearch;\n }\n\n public function testGetActivityIdsForSavedSearchReturnsIds(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->expects($this->once())\n ->method('getArrayFilterKeys')\n ->with($user)\n ->willReturn([]);\n\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n\n $this->elasticRepository->expects($this->once())\n ->method('onDemandSearchIdsOnly')\n ->willReturn(['id-1', 'id-2', 'id-3']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with('[AskJiminnyReport] Fetched activity IDs for saved search');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1', 'id-2', 'id-3'], $result);\n }\n\n public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $this->logger->expects($this->once())->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEmpty($result);\n }\n\n public function testGetActivityIdsFiltersOutDateFilters(): void\n {\n $user = $this->makeUser();\n\n $nonDateFilter = $this->makeFilter('owner_id', '123');\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');\n $updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');\n $updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');\n\n $savedSearch = $this->makeSavedSearch([\n $nonDateFilter,\n $startDateFilter,\n $endDateFilter,\n $updatedFromFilter,\n $updatedToFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n }\n\n public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void\n {\n $user = $this->makeUser();\n\n $closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');\n $closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');\n $regularFilter = $this->makeFilter('rep_id', '99');\n\n $savedSearch = $this->makeSavedSearch([\n $closingStartFilter,\n $closingEndFilter,\n $regularFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesArrayFilters(): void\n {\n $user = $this->makeUser();\n\n $filter1 = $this->makeFilter('outcome', 'positive');\n $filter2 = $this->makeFilter('outcome', 'negative');\n\n $savedSearch = $this->makeSavedSearch([$filter1, $filter2]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesScalarFilters(): void\n {\n $user = $this->makeUser();\n\n $filter = $this->makeFilter('direction', 'inbound');\n $savedSearch = $this->makeSavedSearch([$filter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-5'], $result);\n }\n\n public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertFalse($capturedCriteria->isFirstRequest());\n }\n\n public function testGetActivityIdsLogsWithCorrectContext(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with(\n '[AskJiminnyReport] Fetched activity IDs for saved search',\n $this->callback(fn ($context) => $context['saved_search_id'] === 42\n && $context['user_id'] === 1\n && $context['activity_count'] === 2)\n );\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n }\n\n public static function frequencyDateRangeProvider(): array\n {\n $now = CarbonImmutable::parse('2025-06-16 12:00:00');\n\n return [\n 'daily' => [\n AutomatedReportsService::FREQUENCY_DAILY,\n $now->subDay()->startOfDay()->format('Y-m-d H:i:s'),\n $now->subDay()->endOfDay()->format('Y-m-d H:i:s'),\n ],\n 'weekly' => [\n AutomatedReportsService::FREQUENCY_WEEKLY,\n $now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),\n $now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),\n ],\n 'monthly' => [\n AutomatedReportsService::FREQUENCY_MONTHLY,\n $now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),\n $now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),\n ],\n 'quarterly' => [\n AutomatedReportsService::FREQUENCY_QUARTERLY,\n $now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),\n $now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),\n ],\n ];\n }\n\n /**\n * @dataProvider frequencyDateRangeProvider\n */\n public function testGetActivityIdsInjectsDateRangeForFrequency(\n string $frequency,\n string $expectedStartDate,\n string $expectedEndDate,\n ): void {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n\n public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void\n {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');\n $savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Kiosk\\AutomatedReports;\n\nuse Carbon\\CarbonImmutable;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityActualDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityUpdatedDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\DealInsights\\ClosingPeriodFilter;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Component\\ActivitySearch\\Service\\ActivitySearch;\nuse Jiminny\\Models\\Activity\\Search;\nuse Jiminny\\Models\\Activity\\SearchFilter;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ElasticActivityRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AskJiminnyReportActivityService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse PHPUnit\\Framework\\TestCase;\nuse Psr\\Log\\LoggerInterface;\n\nclass AskJiminnyReportActivityServiceTest extends TestCase\n{\n private ActivitySearch&MockObject $activitySearch;\n private ElasticActivityRepository&MockObject $elasticRepository;\n private LoggerInterface&MockObject $logger;\n private AskJiminnyReportActivityService $service;\n\n protected function setUp(): void\n {\n $this->activitySearch = $this->createMock(ActivitySearch::class);\n $this->elasticRepository = $this->createMock(ElasticActivityRepository::class);\n $this->logger = $this->createMock(LoggerInterface::class);\n\n $this->service = new AskJiminnyReportActivityService(\n $this->activitySearch,\n $this->elasticRepository,\n $this->logger,\n );\n }\n\n private function makeFilter(string $key, ?string $value): SearchFilter&MockObject\n {\n $filter = $this->createMock(SearchFilter::class);\n $filter->method('getFilterProperty')->willReturn($key);\n $filter->method('getFilterValue')->willReturn($value);\n\n return $filter;\n }\n\n private function makeUser(): User&MockObject\n {\n $tz = new \\DateTimeZone('UTC');\n $user = $this->createMock(User::class);\n $user->method('getTimezone')->willReturn($tz);\n $user->method('getId')->willReturn(1);\n $user->method('getUuid')->willReturn('user-uuid');\n\n return $user;\n }\n\n private function makeSavedSearch(array $filters): Search&MockObject\n {\n $savedSearch = $this->createMock(Search::class);\n $savedSearch->method('getId')->willReturn(42);\n $savedSearch->method('getFilters')->willReturn(new \\Illuminate\\Support\\LazyCollection($filters));\n\n return $savedSearch;\n }\n\n public function testGetActivityIdsForSavedSearchReturnsIds(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->expects($this->once())\n ->method('getArrayFilterKeys')\n ->with($user)\n ->willReturn([]);\n\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n\n $this->elasticRepository->expects($this->once())\n ->method('onDemandSearchIdsOnly')\n ->willReturn(['id-1', 'id-2', 'id-3']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with('[AskJiminnyReport] Fetched activity IDs for saved search');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1', 'id-2', 'id-3'], $result);\n }\n\n public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $this->logger->expects($this->once())->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEmpty($result);\n }\n\n public function testGetActivityIdsFiltersOutDateFilters(): void\n {\n $user = $this->makeUser();\n\n $nonDateFilter = $this->makeFilter('owner_id', '123');\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');\n $updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');\n $updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');\n\n $savedSearch = $this->makeSavedSearch([\n $nonDateFilter,\n $startDateFilter,\n $endDateFilter,\n $updatedFromFilter,\n $updatedToFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n }\n\n public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void\n {\n $user = $this->makeUser();\n\n $closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');\n $closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');\n $regularFilter = $this->makeFilter('rep_id', '99');\n\n $savedSearch = $this->makeSavedSearch([\n $closingStartFilter,\n $closingEndFilter,\n $regularFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesArrayFilters(): void\n {\n $user = $this->makeUser();\n\n $filter1 = $this->makeFilter('outcome', 'positive');\n $filter2 = $this->makeFilter('outcome', 'negative');\n\n $savedSearch = $this->makeSavedSearch([$filter1, $filter2]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesScalarFilters(): void\n {\n $user = $this->makeUser();\n\n $filter = $this->makeFilter('direction', 'inbound');\n $savedSearch = $this->makeSavedSearch([$filter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-5'], $result);\n }\n\n public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertFalse($capturedCriteria->isFirstRequest());\n }\n\n public function testGetActivityIdsLogsWithCorrectContext(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with(\n '[AskJiminnyReport] Fetched activity IDs for saved search',\n $this->callback(fn ($context) => $context['saved_search_id'] === 42\n && $context['user_id'] === 1\n && $context['activity_count'] === 2)\n );\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n }\n\n public static function frequencyDateRangeProvider(): array\n {\n $now = CarbonImmutable::parse('2025-06-16 12:00:00');\n\n return [\n 'daily' => [\n AutomatedReportsService::FREQUENCY_DAILY,\n $now->subDay()->startOfDay()->format('Y-m-d H:i:s'),\n $now->subDay()->endOfDay()->format('Y-m-d H:i:s'),\n ],\n 'weekly' => [\n AutomatedReportsService::FREQUENCY_WEEKLY,\n $now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),\n $now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),\n ],\n 'monthly' => [\n AutomatedReportsService::FREQUENCY_MONTHLY,\n $now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),\n $now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),\n ],\n 'quarterly' => [\n AutomatedReportsService::FREQUENCY_QUARTERLY,\n $now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),\n $now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),\n ],\n ];\n }\n\n /**\n * @dataProvider frequencyDateRangeProvider\n */\n public function testGetActivityIdsInjectsDateRangeForFrequency(\n string $frequency,\n string $expectedStartDate,\n string $expectedEndDate,\n ): void {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n\n public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void\n {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');\n $savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.40492022,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.41356382,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.4331782,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.4418218,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.45279256,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.4637633,"top":0.09896249,"width":0.024268618,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.49035904,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.5013298,"top":0.09896249,"width":0.029587766,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.69913566,"top":0.09896249,"width":0.02825798,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"27","depth":4,"bounds":{"left":0.6565825,"top":0.123703115,"width":0.009973404,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"bounds":{"left":0.66855055,"top":0.123703115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"23","depth":4,"bounds":{"left":0.67852396,"top":0.123703115,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.69082445,"top":0.123703115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"105","depth":4,"bounds":{"left":0.70079786,"top":0.123703115,"width":0.011968086,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.7144282,"top":0.12210695,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.72174203,"top":0.12210695,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 2288;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","depth":4,"value":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 2288;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5134344117864598351
|
2146738724037637229
|
visual_change
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 fix flanky test
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Kiosk\AutomatedReports;
use Carbon\CarbonImmutable;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityActualDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityUpdatedDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\DealInsights\ClosingPeriodFilter;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Component\ActivitySearch\Service\ActivitySearch;
use Jiminny\Models\Activity\Search;
use Jiminny\Models\Activity\SearchFilter;
use Jiminny\Models\User;
use Jiminny\Repositories\ElasticActivityRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AskJiminnyReportActivityService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
class AskJiminnyReportActivityServiceTest extends TestCase
{
private ActivitySearch&MockObject $activitySearch;
private ElasticActivityRepository&MockObject $elasticRepository;
private LoggerInterface&MockObject $logger;
private AskJiminnyReportActivityService $service;
protected function setUp(): void
{
$this->activitySearch = $this->createMock(ActivitySearch::class);
$this->elasticRepository = $this->createMock(ElasticActivityRepository::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->service = new AskJiminnyReportActivityService(
$this->activitySearch,
$this->elasticRepository,
$this->logger,
);
}
private function makeFilter(string $key, ?string $value): SearchFilter&MockObject
{
$filter = $this->createMock(SearchFilter::class);
$filter->method('getFilterProperty')->willReturn($key);
$filter->method('getFilterValue')->willReturn($value);
return $filter;
}
private function makeUser(): User&MockObject
{
$tz = new \DateTimeZone('UTC');
$user = $this->createMock(User::class);
$user->method('getTimezone')->willReturn($tz);
$user->method('getId')->willReturn(1);
$user->method('getUuid')->willReturn('user-uuid');
return $user;
}
private function makeSavedSearch(array $filters): Search&MockObject
{
$savedSearch = $this->createMock(Search::class);
$savedSearch->method('getId')->willReturn(42);
$savedSearch->method('getFilters')->willReturn(new \Illuminate\Support\LazyCollection($filters));
return $savedSearch;
}
public function testGetActivityIdsForSavedSearchReturnsIds(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->expects($this->once())
->method('getArrayFilterKeys')
->with($user)
->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->expects($this->once())
->method('onDemandSearchIdsOnly')
->willReturn(['id-1', 'id-2', 'id-3']);
$this->logger->expects($this->once())
->method('info')
->with('[AskJiminnyReport] Fetched activity IDs for saved search');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1', 'id-2', 'id-3'], $result);
}
public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->expects($this->once())->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEmpty($result);
}
public function testGetActivityIdsFiltersOutDateFilters(): void
{
$user = $this->makeUser();
$nonDateFilter = $this->makeFilter('owner_id', '123');
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');
$updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');
$updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');
$savedSearch = $this->makeSavedSearch([
$nonDateFilter,
$startDateFilter,
$endDateFilter,
$updatedFromFilter,
$updatedToFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
}
public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void
{
$user = $this->makeUser();
$closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');
$closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');
$regularFilter = $this->makeFilter('rep_id', '99');
$savedSearch = $this->makeSavedSearch([
$closingStartFilter,
$closingEndFilter,
$regularFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesArrayFilters(): void
{
$user = $this->makeUser();
$filter1 = $this->makeFilter('outcome', 'positive');
$filter2 = $this->makeFilter('outcome', 'negative');
$savedSearch = $this->makeSavedSearch([$filter1, $filter2]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesScalarFilters(): void
{
$user = $this->makeUser();
$filter = $this->makeFilter('direction', 'inbound');
$savedSearch = $this->makeSavedSearch([$filter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-5'], $result);
}
public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
$this->assertFalse($capturedCriteria->isFirstRequest());
}
public function testGetActivityIdsLogsWithCorrectContext(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);
$this->logger->expects($this->once())
->method('info')
->with(
'[AskJiminnyReport] Fetched activity IDs for saved search',
$this->callback(fn ($context) => $context['saved_search_id'] === 42
&& $context['user_id'] === 1
&& $context['activity_count'] === 2)
);
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
}
public static function frequencyDateRangeProvider(): array
{
$now = CarbonImmutable::parse('2025-06-16 12:00:00');
return [
'daily' => [
AutomatedReportsService::FREQUENCY_DAILY,
$now->subDay()->startOfDay()->format('Y-m-d H:i:s'),
$now->subDay()->endOfDay()->format('Y-m-d H:i:s'),
],
'weekly' => [
AutomatedReportsService::FREQUENCY_WEEKLY,
$now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),
$now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),
],
'monthly' => [
AutomatedReportsService::FREQUENCY_MONTHLY,
$now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),
$now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),
],
'quarterly' => [
AutomatedReportsService::FREQUENCY_QUARTERLY,
$now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),
$now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),
],
];
}
/**
* @dataProvider frequencyDateRangeProvider
*/
public function testGetActivityIdsInjectsDateRangeForFrequency(
string $frequency,
string $expectedStartDate,
string $expectedEndDate,
): void {
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);
$this->assertNotNull($capturedCriteria);
$this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void
{
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');
$savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);
$this->assertNotNull($capturedCriteria);
$this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a....
|
NULL
|
|
55773
|
1202
|
30
|
2026-04-20T10:07:37.423595+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-20/1776 /Users/lukas/.screenpipe/data/data/2026-04-20/1776679657423_m2.jpg...
|
PhpStorm
|
faVsco.js – AskJiminnyReportActivityServiceTest.ph faVsco.js – AskJiminnyReportActivityServiceTest.php...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 fix flanky test
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Kiosk\AutomatedReports;
use Carbon\CarbonImmutable;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityActualDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityUpdatedDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\DealInsights\ClosingPeriodFilter;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Component\ActivitySearch\Service\ActivitySearch;
use Jiminny\Models\Activity\Search;
use Jiminny\Models\Activity\SearchFilter;
use Jiminny\Models\User;
use Jiminny\Repositories\ElasticActivityRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AskJiminnyReportActivityService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
class AskJiminnyReportActivityServiceTest extends TestCase
{
private ActivitySearch&MockObject $activitySearch;
private ElasticActivityRepository&MockObject $elasticRepository;
private LoggerInterface&MockObject $logger;
private AskJiminnyReportActivityService $service;
protected function setUp(): void
{
$this->activitySearch = $this->createMock(ActivitySearch::class);
$this->elasticRepository = $this->createMock(ElasticActivityRepository::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->service = new AskJiminnyReportActivityService(
$this->activitySearch,
$this->elasticRepository,
$this->logger,
);
}
private function makeFilter(string $key, ?string $value): SearchFilter&MockObject
{
$filter = $this->createMock(SearchFilter::class);
$filter->method('getFilterProperty')->willReturn($key);
$filter->method('getFilterValue')->willReturn($value);
return $filter;
}
private function makeUser(): User&MockObject
{
$tz = new \DateTimeZone('UTC');
$user = $this->createMock(User::class);
$user->method('getTimezone')->willReturn($tz);
$user->method('getId')->willReturn(1);
$user->method('getUuid')->willReturn('user-uuid');
return $user;
}
private function makeSavedSearch(array $filters): Search&MockObject
{
$savedSearch = $this->createMock(Search::class);
$savedSearch->method('getId')->willReturn(42);
$savedSearch->method('getFilters')->willReturn(new \Illuminate\Support\LazyCollection($filters));
return $savedSearch;
}
public function testGetActivityIdsForSavedSearchReturnsIds(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->expects($this->once())
->method('getArrayFilterKeys')
->with($user)
->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->expects($this->once())
->method('onDemandSearchIdsOnly')
->willReturn(['id-1', 'id-2', 'id-3']);
$this->logger->expects($this->once())
->method('info')
->with('[AskJiminnyReport] Fetched activity IDs for saved search');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1', 'id-2', 'id-3'], $result);
}
public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->expects($this->once())->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEmpty($result);
}
public function testGetActivityIdsFiltersOutDateFilters(): void
{
$user = $this->makeUser();
$nonDateFilter = $this->makeFilter('owner_id', '123');
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');
$updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');
$updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');
$savedSearch = $this->makeSavedSearch([
$nonDateFilter,
$startDateFilter,
$endDateFilter,
$updatedFromFilter,
$updatedToFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
}
public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void
{
$user = $this->makeUser();
$closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');
$closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');
$regularFilter = $this->makeFilter('rep_id', '99');
$savedSearch = $this->makeSavedSearch([
$closingStartFilter,
$closingEndFilter,
$regularFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesArrayFilters(): void
{
$user = $this->makeUser();
$filter1 = $this->makeFilter('outcome', 'positive');
$filter2 = $this->makeFilter('outcome', 'negative');
$savedSearch = $this->makeSavedSearch([$filter1, $filter2]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesScalarFilters(): void
{
$user = $this->makeUser();
$filter = $this->makeFilter('direction', 'inbound');
$savedSearch = $this->makeSavedSearch([$filter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-5'], $result);
}
public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
$this->assertFalse($capturedCriteria->isFirstRequest());
}
public function testGetActivityIdsLogsWithCorrectContext(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);
$this->logger->expects($this->once())
->method('info')
->with(
'[AskJiminnyReport] Fetched activity IDs for saved search',
$this->callback(fn ($context) => $context['saved_search_id'] === 42
&& $context['user_id'] === 1
&& $context['activity_count'] === 2)
);
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
}
public static function frequencyDateRangeProvider(): array
{
$now = CarbonImmutable::parse('2025-06-16 12:00:00');
return [
'daily' => [
AutomatedReportsService::FREQUENCY_DAILY,
$now->subDay()->startOfDay()->format('Y-m-d H:i:s'),
$now->subDay()->endOfDay()->format('Y-m-d H:i:s'),
],
'weekly' => [
AutomatedReportsService::FREQUENCY_WEEKLY,
$now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),
$now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),
],
'monthly' => [
AutomatedReportsService::FREQUENCY_MONTHLY,
$now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),
$now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),
],
'quarterly' => [
AutomatedReportsService::FREQUENCY_QUARTERLY,
$now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),
$now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),
],
];
}
/**
* @dataProvider frequencyDateRangeProvider
*/
public function testGetActivityIdsInjectsDateRangeForFrequency(
string $frequency,
string $expectedStartDate,
string $expectedEndDate,
): void {
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);
$this->assertNotNull($capturedCriteria);
$this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void
{
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');
$savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);
$this->assertNotNull($capturedCriteria);
$this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a....
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.11037234,"height":0.027134877},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.8387869,"width":0.102726065,"height":0.027134877},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8753325,"top":0.87150836,"width":0.03523936,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1 file committed","depth":2,"bounds":{"left":0.8753325,"top":0.91300875,"width":0.100398935,"height":0.013567438},"role_description":"text"},{"role":"AXTextField","text":"JY-18909 fix flanky test","depth":3,"bounds":{"left":0.8753325,"top":0.92897046,"width":0.11037234,"height":0.013567438},"value":"JY-18909 fix flanky test","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.92897046,"width":0.04886968,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"bounds":{"left":0.8753325,"top":0.9481245,"width":0.048204787,"height":0.013567438},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.12134308,"height":0.025538707},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.3620346,"top":0.2490024,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.37200797,"top":0.2490024,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.38164893,"top":0.24740623,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.38896278,"top":0.24740623,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Kiosk\\AutomatedReports;\n\nuse Carbon\\CarbonImmutable;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityActualDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityUpdatedDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\DealInsights\\ClosingPeriodFilter;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Component\\ActivitySearch\\Service\\ActivitySearch;\nuse Jiminny\\Models\\Activity\\Search;\nuse Jiminny\\Models\\Activity\\SearchFilter;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ElasticActivityRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AskJiminnyReportActivityService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse PHPUnit\\Framework\\TestCase;\nuse Psr\\Log\\LoggerInterface;\n\nclass AskJiminnyReportActivityServiceTest extends TestCase\n{\n private ActivitySearch&MockObject $activitySearch;\n private ElasticActivityRepository&MockObject $elasticRepository;\n private LoggerInterface&MockObject $logger;\n private AskJiminnyReportActivityService $service;\n\n protected function setUp(): void\n {\n $this->activitySearch = $this->createMock(ActivitySearch::class);\n $this->elasticRepository = $this->createMock(ElasticActivityRepository::class);\n $this->logger = $this->createMock(LoggerInterface::class);\n\n $this->service = new AskJiminnyReportActivityService(\n $this->activitySearch,\n $this->elasticRepository,\n $this->logger,\n );\n }\n\n private function makeFilter(string $key, ?string $value): SearchFilter&MockObject\n {\n $filter = $this->createMock(SearchFilter::class);\n $filter->method('getFilterProperty')->willReturn($key);\n $filter->method('getFilterValue')->willReturn($value);\n\n return $filter;\n }\n\n private function makeUser(): User&MockObject\n {\n $tz = new \\DateTimeZone('UTC');\n $user = $this->createMock(User::class);\n $user->method('getTimezone')->willReturn($tz);\n $user->method('getId')->willReturn(1);\n $user->method('getUuid')->willReturn('user-uuid');\n\n return $user;\n }\n\n private function makeSavedSearch(array $filters): Search&MockObject\n {\n $savedSearch = $this->createMock(Search::class);\n $savedSearch->method('getId')->willReturn(42);\n $savedSearch->method('getFilters')->willReturn(new \\Illuminate\\Support\\LazyCollection($filters));\n\n return $savedSearch;\n }\n\n public function testGetActivityIdsForSavedSearchReturnsIds(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->expects($this->once())\n ->method('getArrayFilterKeys')\n ->with($user)\n ->willReturn([]);\n\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n\n $this->elasticRepository->expects($this->once())\n ->method('onDemandSearchIdsOnly')\n ->willReturn(['id-1', 'id-2', 'id-3']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with('[AskJiminnyReport] Fetched activity IDs for saved search');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1', 'id-2', 'id-3'], $result);\n }\n\n public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $this->logger->expects($this->once())->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEmpty($result);\n }\n\n public function testGetActivityIdsFiltersOutDateFilters(): void\n {\n $user = $this->makeUser();\n\n $nonDateFilter = $this->makeFilter('owner_id', '123');\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');\n $updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');\n $updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');\n\n $savedSearch = $this->makeSavedSearch([\n $nonDateFilter,\n $startDateFilter,\n $endDateFilter,\n $updatedFromFilter,\n $updatedToFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n }\n\n public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void\n {\n $user = $this->makeUser();\n\n $closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');\n $closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');\n $regularFilter = $this->makeFilter('rep_id', '99');\n\n $savedSearch = $this->makeSavedSearch([\n $closingStartFilter,\n $closingEndFilter,\n $regularFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesArrayFilters(): void\n {\n $user = $this->makeUser();\n\n $filter1 = $this->makeFilter('outcome', 'positive');\n $filter2 = $this->makeFilter('outcome', 'negative');\n\n $savedSearch = $this->makeSavedSearch([$filter1, $filter2]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesScalarFilters(): void\n {\n $user = $this->makeUser();\n\n $filter = $this->makeFilter('direction', 'inbound');\n $savedSearch = $this->makeSavedSearch([$filter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-5'], $result);\n }\n\n public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertFalse($capturedCriteria->isFirstRequest());\n }\n\n public function testGetActivityIdsLogsWithCorrectContext(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with(\n '[AskJiminnyReport] Fetched activity IDs for saved search',\n $this->callback(fn ($context) => $context['saved_search_id'] === 42\n && $context['user_id'] === 1\n && $context['activity_count'] === 2)\n );\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n }\n\n public static function frequencyDateRangeProvider(): array\n {\n $now = CarbonImmutable::parse('2025-06-16 12:00:00');\n\n return [\n 'daily' => [\n AutomatedReportsService::FREQUENCY_DAILY,\n $now->subDay()->startOfDay()->format('Y-m-d H:i:s'),\n $now->subDay()->endOfDay()->format('Y-m-d H:i:s'),\n ],\n 'weekly' => [\n AutomatedReportsService::FREQUENCY_WEEKLY,\n $now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),\n $now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),\n ],\n 'monthly' => [\n AutomatedReportsService::FREQUENCY_MONTHLY,\n $now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),\n $now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),\n ],\n 'quarterly' => [\n AutomatedReportsService::FREQUENCY_QUARTERLY,\n $now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),\n $now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),\n ],\n ];\n }\n\n /**\n * @dataProvider frequencyDateRangeProvider\n */\n public function testGetActivityIdsInjectsDateRangeForFrequency(\n string $frequency,\n string $expectedStartDate,\n string $expectedEndDate,\n ): void {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n\n public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void\n {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');\n $savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Kiosk\\AutomatedReports;\n\nuse Carbon\\CarbonImmutable;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityActualDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityUpdatedDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\DealInsights\\ClosingPeriodFilter;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Component\\ActivitySearch\\Service\\ActivitySearch;\nuse Jiminny\\Models\\Activity\\Search;\nuse Jiminny\\Models\\Activity\\SearchFilter;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ElasticActivityRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AskJiminnyReportActivityService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse PHPUnit\\Framework\\TestCase;\nuse Psr\\Log\\LoggerInterface;\n\nclass AskJiminnyReportActivityServiceTest extends TestCase\n{\n private ActivitySearch&MockObject $activitySearch;\n private ElasticActivityRepository&MockObject $elasticRepository;\n private LoggerInterface&MockObject $logger;\n private AskJiminnyReportActivityService $service;\n\n protected function setUp(): void\n {\n $this->activitySearch = $this->createMock(ActivitySearch::class);\n $this->elasticRepository = $this->createMock(ElasticActivityRepository::class);\n $this->logger = $this->createMock(LoggerInterface::class);\n\n $this->service = new AskJiminnyReportActivityService(\n $this->activitySearch,\n $this->elasticRepository,\n $this->logger,\n );\n }\n\n private function makeFilter(string $key, ?string $value): SearchFilter&MockObject\n {\n $filter = $this->createMock(SearchFilter::class);\n $filter->method('getFilterProperty')->willReturn($key);\n $filter->method('getFilterValue')->willReturn($value);\n\n return $filter;\n }\n\n private function makeUser(): User&MockObject\n {\n $tz = new \\DateTimeZone('UTC');\n $user = $this->createMock(User::class);\n $user->method('getTimezone')->willReturn($tz);\n $user->method('getId')->willReturn(1);\n $user->method('getUuid')->willReturn('user-uuid');\n\n return $user;\n }\n\n private function makeSavedSearch(array $filters): Search&MockObject\n {\n $savedSearch = $this->createMock(Search::class);\n $savedSearch->method('getId')->willReturn(42);\n $savedSearch->method('getFilters')->willReturn(new \\Illuminate\\Support\\LazyCollection($filters));\n\n return $savedSearch;\n }\n\n public function testGetActivityIdsForSavedSearchReturnsIds(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->expects($this->once())\n ->method('getArrayFilterKeys')\n ->with($user)\n ->willReturn([]);\n\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n\n $this->elasticRepository->expects($this->once())\n ->method('onDemandSearchIdsOnly')\n ->willReturn(['id-1', 'id-2', 'id-3']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with('[AskJiminnyReport] Fetched activity IDs for saved search');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1', 'id-2', 'id-3'], $result);\n }\n\n public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $this->logger->expects($this->once())->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEmpty($result);\n }\n\n public function testGetActivityIdsFiltersOutDateFilters(): void\n {\n $user = $this->makeUser();\n\n $nonDateFilter = $this->makeFilter('owner_id', '123');\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');\n $updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');\n $updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');\n\n $savedSearch = $this->makeSavedSearch([\n $nonDateFilter,\n $startDateFilter,\n $endDateFilter,\n $updatedFromFilter,\n $updatedToFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n }\n\n public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void\n {\n $user = $this->makeUser();\n\n $closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');\n $closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');\n $regularFilter = $this->makeFilter('rep_id', '99');\n\n $savedSearch = $this->makeSavedSearch([\n $closingStartFilter,\n $closingEndFilter,\n $regularFilter,\n ]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesArrayFilters(): void\n {\n $user = $this->makeUser();\n\n $filter1 = $this->makeFilter('outcome', 'positive');\n $filter2 = $this->makeFilter('outcome', 'negative');\n\n $savedSearch = $this->makeSavedSearch([$filter1, $filter2]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-1'], $result);\n }\n\n public function testGetActivityIdsHandlesScalarFilters(): void\n {\n $user = $this->makeUser();\n\n $filter = $this->makeFilter('direction', 'inbound');\n $savedSearch = $this->makeSavedSearch([$filter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);\n $this->logger->method('info');\n\n $result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertEquals(['id-5'], $result);\n }\n\n public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n $this->logger->method('info');\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertFalse($capturedCriteria->isFirstRequest());\n }\n\n public function testGetActivityIdsLogsWithCorrectContext(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);\n\n $this->logger->expects($this->once())\n ->method('info')\n ->with(\n '[AskJiminnyReport] Fetched activity IDs for saved search',\n $this->callback(fn ($context) => $context['saved_search_id'] === 42\n && $context['user_id'] === 1\n && $context['activity_count'] === 2)\n );\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user);\n }\n\n public static function frequencyDateRangeProvider(): array\n {\n $now = CarbonImmutable::parse('2025-06-16 12:00:00');\n\n return [\n 'daily' => [\n AutomatedReportsService::FREQUENCY_DAILY,\n $now->subDay()->startOfDay()->format('Y-m-d H:i:s'),\n $now->subDay()->endOfDay()->format('Y-m-d H:i:s'),\n ],\n 'weekly' => [\n AutomatedReportsService::FREQUENCY_WEEKLY,\n $now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),\n $now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),\n ],\n 'monthly' => [\n AutomatedReportsService::FREQUENCY_MONTHLY,\n $now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),\n $now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),\n ],\n 'quarterly' => [\n AutomatedReportsService::FREQUENCY_QUARTERLY,\n $now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),\n $now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),\n ],\n ];\n }\n\n /**\n * @dataProvider frequencyDateRangeProvider\n */\n public function testGetActivityIdsInjectsDateRangeForFrequency(\n string $frequency,\n string $expectedStartDate,\n string $expectedEndDate,\n ): void {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n\n public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void\n {\n $user = $this->makeUser();\n $savedSearch = $this->makeSavedSearch([]);\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertNull($capturedCriteria->getStartDate());\n $this->assertNull($capturedCriteria->getEndDate());\n }\n\n public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void\n {\n CarbonImmutable::setTestNow('2025-06-16 12:00:00');\n\n try {\n $user = $this->makeUser();\n\n $startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');\n $endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');\n $savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);\n\n $filterSet = $this->createMock(FilterDefinitionCollection::class);\n\n $this->activitySearch->method('getArrayFilterKeys')->willReturn([]);\n $this->logger->method('info');\n $this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);\n\n $capturedCriteria = null;\n $this->activitySearch->expects($this->once())\n ->method('getOnDemandPageFilterSet')\n ->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {\n $capturedCriteria = $criteria;\n\n return $filterSet;\n });\n\n $this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);\n\n $this->assertNotNull($capturedCriteria);\n $this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));\n $this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));\n } finally {\n CarbonImmutable::setTestNow();\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.40492022,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.41356382,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.4331782,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.4418218,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.45279256,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.4637633,"top":0.09896249,"width":0.024268618,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.49035904,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.5013298,"top":0.09896249,"width":0.029587766,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.69913566,"top":0.09896249,"width":0.02825798,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"27","depth":4,"bounds":{"left":0.6565825,"top":0.123703115,"width":0.009973404,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"bounds":{"left":0.66855055,"top":0.123703115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"23","depth":4,"bounds":{"left":0.67852396,"top":0.123703115,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.69082445,"top":0.123703115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"105","depth":4,"bounds":{"left":0.70079786,"top":0.123703115,"width":0.011968086,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.7144282,"top":0.12210695,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.72174203,"top":0.12210695,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 2288;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","depth":4,"value":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 2288;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5134344117864598351
|
2146738724037637229
|
visual_change
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 fix flanky test
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Kiosk\AutomatedReports;
use Carbon\CarbonImmutable;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityActualDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityUpdatedDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\DealInsights\ClosingPeriodFilter;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Component\ActivitySearch\Service\ActivitySearch;
use Jiminny\Models\Activity\Search;
use Jiminny\Models\Activity\SearchFilter;
use Jiminny\Models\User;
use Jiminny\Repositories\ElasticActivityRepository;
use Jiminny\Services\Kiosk\AutomatedReports\AskJiminnyReportActivityService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
class AskJiminnyReportActivityServiceTest extends TestCase
{
private ActivitySearch&MockObject $activitySearch;
private ElasticActivityRepository&MockObject $elasticRepository;
private LoggerInterface&MockObject $logger;
private AskJiminnyReportActivityService $service;
protected function setUp(): void
{
$this->activitySearch = $this->createMock(ActivitySearch::class);
$this->elasticRepository = $this->createMock(ElasticActivityRepository::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->service = new AskJiminnyReportActivityService(
$this->activitySearch,
$this->elasticRepository,
$this->logger,
);
}
private function makeFilter(string $key, ?string $value): SearchFilter&MockObject
{
$filter = $this->createMock(SearchFilter::class);
$filter->method('getFilterProperty')->willReturn($key);
$filter->method('getFilterValue')->willReturn($value);
return $filter;
}
private function makeUser(): User&MockObject
{
$tz = new \DateTimeZone('UTC');
$user = $this->createMock(User::class);
$user->method('getTimezone')->willReturn($tz);
$user->method('getId')->willReturn(1);
$user->method('getUuid')->willReturn('user-uuid');
return $user;
}
private function makeSavedSearch(array $filters): Search&MockObject
{
$savedSearch = $this->createMock(Search::class);
$savedSearch->method('getId')->willReturn(42);
$savedSearch->method('getFilters')->willReturn(new \Illuminate\Support\LazyCollection($filters));
return $savedSearch;
}
public function testGetActivityIdsForSavedSearchReturnsIds(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->expects($this->once())
->method('getArrayFilterKeys')
->with($user)
->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->expects($this->once())
->method('onDemandSearchIdsOnly')
->willReturn(['id-1', 'id-2', 'id-3']);
$this->logger->expects($this->once())
->method('info')
->with('[AskJiminnyReport] Fetched activity IDs for saved search');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1', 'id-2', 'id-3'], $result);
}
public function testGetActivityIdsForSavedSearchReturnsEmptyWhenNoResults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->expects($this->once())->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEmpty($result);
}
public function testGetActivityIdsFiltersOutDateFilters(): void
{
$user = $this->makeUser();
$nonDateFilter = $this->makeFilter('owner_id', '123');
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2025-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2025-01-31 23:59:59');
$updatedFromFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_FROM, '2025-01-01 00:00:00');
$updatedToFilter = $this->makeFilter(ActivityUpdatedDate::PARAM_UPDATED_TO, '2025-01-31 23:59:59');
$savedSearch = $this->makeSavedSearch([
$nonDateFilter,
$startDateFilter,
$endDateFilter,
$updatedFromFilter,
$updatedToFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
}
public function testGetActivityIdsFiltersOutClosingPeriodDateFilters(): void
{
$user = $this->makeUser();
$closingStartFilter = $this->makeFilter(ClosingPeriodFilter::KEY_START_DATE, '2025-01-01');
$closingEndFilter = $this->makeFilter(ClosingPeriodFilter::KEY_END_DATE, '2025-03-31');
$regularFilter = $this->makeFilter('rep_id', '99');
$savedSearch = $this->makeSavedSearch([
$closingStartFilter,
$closingEndFilter,
$regularFilter,
]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesArrayFilters(): void
{
$user = $this->makeUser();
$filter1 = $this->makeFilter('outcome', 'positive');
$filter2 = $this->makeFilter('outcome', 'negative');
$savedSearch = $this->makeSavedSearch([$filter1, $filter2]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn(['outcome']);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-1']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-1'], $result);
}
public function testGetActivityIdsHandlesScalarFilters(): void
{
$user = $this->makeUser();
$filter = $this->makeFilter('direction', 'inbound');
$savedSearch = $this->makeSavedSearch([$filter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['id-5']);
$this->logger->method('info');
$result = $this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertEquals(['id-5'], $result);
}
public function testGetActivityIdsPassesNonZeroSequenceNumberToDisableFirstRequestDefaults(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$this->logger->method('info');
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
$this->assertNotNull($capturedCriteria);
$this->assertFalse($capturedCriteria->isFirstRequest());
}
public function testGetActivityIdsLogsWithCorrectContext(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->activitySearch->method('getOnDemandPageFilterSet')->willReturn($filterSet);
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn(['a', 'b']);
$this->logger->expects($this->once())
->method('info')
->with(
'[AskJiminnyReport] Fetched activity IDs for saved search',
$this->callback(fn ($context) => $context['saved_search_id'] === 42
&& $context['user_id'] === 1
&& $context['activity_count'] === 2)
);
$this->service->getActivityIdsForSavedSearch($savedSearch, $user);
}
public static function frequencyDateRangeProvider(): array
{
$now = CarbonImmutable::parse('2025-06-16 12:00:00');
return [
'daily' => [
AutomatedReportsService::FREQUENCY_DAILY,
$now->subDay()->startOfDay()->format('Y-m-d H:i:s'),
$now->subDay()->endOfDay()->format('Y-m-d H:i:s'),
],
'weekly' => [
AutomatedReportsService::FREQUENCY_WEEKLY,
$now->subWeek()->startOfWeek()->format('Y-m-d H:i:s'),
$now->subWeek()->endOfWeek()->format('Y-m-d H:i:s'),
],
'monthly' => [
AutomatedReportsService::FREQUENCY_MONTHLY,
$now->subMonthNoOverflow()->startOfMonth()->format('Y-m-d H:i:s'),
$now->subMonthNoOverflow()->endOfMonth()->format('Y-m-d H:i:s'),
],
'quarterly' => [
AutomatedReportsService::FREQUENCY_QUARTERLY,
$now->subQuarterNoOverflow()->startOfQuarter()->format('Y-m-d H:i:s'),
$now->subQuarterNoOverflow()->endOfQuarter()->format('Y-m-d H:i:s'),
],
];
}
/**
* @dataProvider frequencyDateRangeProvider
*/
public function testGetActivityIdsInjectsDateRangeForFrequency(
string $frequency,
string $expectedStartDate,
string $expectedEndDate,
): void {
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, $frequency);
$this->assertNotNull($capturedCriteria);
$this->assertSame($expectedStartDate, $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame($expectedEndDate, $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
public function testGetActivityIdsWithNullFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, null);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsWithUnknownFrequencyDoesNotInjectDates(): void
{
$user = $this->makeUser();
$savedSearch = $this->makeSavedSearch([]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_ONE_OFF);
$this->assertNotNull($capturedCriteria);
$this->assertNull($capturedCriteria->getStartDate());
$this->assertNull($capturedCriteria->getEndDate());
}
public function testGetActivityIdsFrequencyDateRangeOverridesSavedSearchDateFilters(): void
{
CarbonImmutable::setTestNow('2025-06-16 12:00:00');
try {
$user = $this->makeUser();
$startDateFilter = $this->makeFilter(ActivityActualDate::PARAM_START_DATE, '2024-01-01 00:00:00');
$endDateFilter = $this->makeFilter(ActivityActualDate::PARAM_END_DATE, '2024-12-31 23:59:59');
$savedSearch = $this->makeSavedSearch([$startDateFilter, $endDateFilter]);
$filterSet = $this->createMock(FilterDefinitionCollection::class);
$this->activitySearch->method('getArrayFilterKeys')->willReturn([]);
$this->logger->method('info');
$this->elasticRepository->method('onDemandSearchIdsOnly')->willReturn([]);
$capturedCriteria = null;
$this->activitySearch->expects($this->once())
->method('getOnDemandPageFilterSet')
->willReturnCallback(function (Criteria $criteria) use ($filterSet, &$capturedCriteria) {
$capturedCriteria = $criteria;
return $filterSet;
});
$this->service->getActivityIdsForSavedSearch($savedSearch, $user, AutomatedReportsService::FREQUENCY_DAILY);
$this->assertNotNull($capturedCriteria);
$this->assertSame('2025-06-15 00:00:00', $capturedCriteria->getStartDate()->format('Y-m-d H:i:s'));
$this->assertSame('2025-06-15 23:59:59', $capturedCriteria->getEndDate()->format('Y-m-d H:i:s'));
} finally {
CarbonImmutable::setTestNow();
}
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a....
|
NULL
|
|
11909
|
249
|
14
|
2026-04-14T10:29:31.905768+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-14/1776 /Users/lukas/.screenpipe/data/data/2026-04-14/1776162571905_m2.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsCommandTest.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 fix test
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsCommandTest
Run 'AutomatedReportsCommandTest'
Debug 'AutomatedReportsCommandTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
873
Previous Highlighted Error
Next Highlighted Error
[2026-04-14 10:05:19] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"9756bfa7-c8e1-4b17-bc55-9f224d2af2e3","trace_id":"9e5fa115-9cf5-45d6-a1da-109e154cfae7"}
[2026-04-14 10:05:19] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"9756bfa7-c8e1-4b17-bc55-9f224d2af2e3","trace_id":"9e5fa115-9cf5-45d6-a1da-109e154cfae7"}
[2026-04-14 10:05:23] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"d9d68876-323b-42bd-9953-635da8008f2e","trace_id":"6c00ce4c-f2df-4ccb-908d-4862de973096"}
[2026-04-14 10:05:23] local.INFO: Running pre-meeting notification command {"correlation_id":"d9d68876-323b-42bd-9953-635da8008f2e","trace_id":"6c00ce4c-f2df-4ccb-908d-4862de973096"}
[2026-04-14 10:05:23] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"d9d68876-323b-42bd-9953-635da8008f2e","trace_id":"6c00ce4c-f2df-4ccb-908d-4862de973096"}
[2026-04-14 10:05:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"27d73fea-a8cb-4757-9bbb-fbe7222e6943","trace_id":"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e"}
[2026-04-14 10:05:26] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 09:55:00, 2026-04-14 10:00:00] {"correlation_id":"27d73fea-a8cb-4757-9bbb-fbe7222e6943","trace_id":"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e"}
[2026-04-14 10:05:26] local.INFO: [conference:monitor:start] start ok {"activity_id":407307} {"correlation_id":"27d73fea-a8cb-4757-9bbb-fbe7222e6943","trace_id":"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e"}
[2026-04-14 10:05:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"27d73fea-a8cb-4757-9bbb-fbe7222e6943","trace_id":"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e"}
[2026-04-14 10:05:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"588bae45-3998-4b86-b056-51aaf8b6882f","trace_id":"8f716a65-7768-44c5-b0e4-02a859f329e5"}
[2026-04-14 10:05:28] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:00","to":"10:05"} {"correlation_id":"588bae45-3998-4b86-b056-51aaf8b6882f","trace_id":"8f716a65-7768-44c5-b0e4-02a859f329e5"}
[2026-04-14 10:05:28] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"23:55","to":"00:00"} {"correlation_id":"588bae45-3998-4b86-b056-51aaf8b6882f","trace_id":"8f716a65-7768-44c5-b0e4-02a859f329e5"}
[2026-04-14 10:05:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"588bae45-3998-4b86-b056-51aaf8b6882f","trace_id":"8f716a65-7768-44c5-b0e4-02a859f329e5"}
[2026-04-14 10:05:30] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:30] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:30] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:30] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b","state":"full-refresh"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: Trying to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":306,"provider":"hubspot","refreshToken":"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b","state":"full-refresh"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: Trying to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1372,"provider":"hubspot","refreshToken":"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4","state":"full-refresh"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:34] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-reminder","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"2b2ca83a-1263-4a7c-a5d7-86dc15ea7aec","trace_id":"fbf48d3d-4e50-4442-b14f-d2ae5e6e70bd"}
[2026-04-14 10:05:34] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"crm:bullhorn:ping","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"73b127c9-c033-4fa7-a8ed-2e28077ba970","trace_id":"fd1cf3c5-d4ce-41d6-a19d-5e67fd544d9e"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"crm:bullhorn:ping","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"73b127c9-c033-4fa7-a8ed-2e28077ba970","trace_id":"fd1cf3c5-d4ce-41d6-a19d-5e67fd544d9e"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Command] Starting polling service {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Service starting {"memory_limit":"256M","max_execution_time":"0","initial_memory_mb":62.0} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Acquired polling lock {"expires_at":"2026-04-14T10:07:34.196472Z"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal API] Fetching latest journal entry {"url":"https://api.hubapi.com/webhooks/v4/journal/latest"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-reminder","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"2b2ca83a-1263-4a7c-a5d7-86dc15ea7aec","trace_id":"fbf48d3d-4e50-4442-b14f-d2ae5e6e70bd"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:39] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:39] local.INFO: [HubSpot Journal API] Fetching latest journal entry {"url":"https://api.hubapi.com/webhooks/v4/journal/latest"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:39] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:44] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:44] local.INFO: [HubSpot Journal API] Fetching latest journal entry {"url":"https://api.hubapi.com/webhooks/v4/journal/latest"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:44] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:59] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:59] local.INFO: [HubSpot Journal API] Fetching latest journal entry {"url":"https://api.hubapi.com/webhooks/v4/journal/latest"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:00] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a","trace_id":"b4c87c8d-120d-48fb-b13c-aee84323f3e2"}
[2026-04-14 10:06:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a","trace_id":"b4c87c8d-120d-48fb-b13c-aee84323f3e2"}
[2026-04-14 10:06:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a","trace_id":"b4c87c8d-120d-48fb-b13c-aee84323f3e2"}
[2026-04-14 10:06:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"8403c1e4-b5b6-41f9-9280-ff666beed28b","trace_id":"3f631f60-6d14-44f5-b6c3-b401999867f9"}
[2026-04-14 10:06:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"8403c1e4-b5b6-41f9-9280-ff666beed28b","trace_id":"3f631f60-6d14-44f5-b6c3-b401999867f9"}
[2026-04-14 10:06:08] local.NOTICE: Monitoring start {"correlation_id":"0d51eb08-f2f1-4322-97d0-268700856a99","trace_id":"92b45b9a-b6e8-40c8-a783-193cf1a4eea2"}
[2026-04-14 10:06:08] local.NOTICE: Monitoring end {"correlation_id":"0d51eb08-f2f1-4322-97d0-268700856a99","trace_id":"92b45b9a-b6e8-40c8-a783-193cf1a4eea2"}
[2026-04-14 10:06:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"0566c59b-bf67-49eb-970a-a6b955ddd756","trace_id":"724c5f5e-cd88-41fb-9b7e-74315e131024"}
[2026-04-14 10:06:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"0566c59b-bf67-49eb-970a-a6b955ddd756","trace_id":"724c5f5e-cd88-41fb-9b7e-74315e131024"}
[2026-04-14 10:06:12] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"33d190d4-0abb-4e63-af52-95faa913e7a1","trace_id":"703aaa4d-a551-4ed1-8a4a-609d373e2fc0"}
[2026-04-14 10:06:12] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"33d190d4-0abb-4e63-af52-95faa913e7a1","trace_id":"703aaa4d-a551-4ed1-8a4a-609d373e2fc0"}
[2026-04-14 10:06:12] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"33d190d4-0abb-4e63-af52-95faa913e7a1","trace_id":"703aaa4d-a551-4ed1-8a4a-609d373e2fc0"}
[2026-04-14 10:06:12] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"33d190d4-0abb-4e63-af52-95faa913e7a1","trace_id":"703aaa4d-a551-4ed1-8a4a-609d373e2fc0"}
[2026-04-14 10:06:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"da41d77d-46d9-41ae-90b7-f8418b05fb9a","trace_id":"47329a55-e6f4-406b-8730-e72d69737f09"}
[2026-04-14 10:06:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:04:00, 2026-04-14 10:06:00] {"correlation_id":"da41d77d-46d9-41ae-90b7-f8418b05fb9a","trace_id":"47329a55-e6f4-406b-8730-e72d69737f09"}
[2026-04-14 10:06:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:04:00, 2026-04-14 10:06:00] {"correlation_id":"da41d77d-46d9-41ae-90b7-f8418b05fb9a","trace_id":"47329a55-e6f4-406b-8730-e72d69737f09"}
[2026-04-14 10:06:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"da41d77d-46d9-41ae-90b7-f8418b05fb9a","trace_id":"47329a55-e6f4-406b-8730-e72d69737f09"}
[2026-04-14 10:06:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:notify-not-logged","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"310e7e99-6de4-4f93-967e-37c78e9ec826","trace_id":"2a1fdf0a-be0e-4e5a-a677-fa16ddc33e9e"}
[2026-04-14 10:06:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:notify-not-logged","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"310e7e99-6de4-4f93-967e-37c78e9ec826","trace_id":"2a1fdf0a-be0e-4e5a-a677-fa16ddc33e9e"}
[2026-04-14 10:06:19] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:sync","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"de8430ad-f242-4536-bebe-e165320b6b26","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:19] local.INFO: [EmailSchedule] STARTING Inbox Sync {"host":"docker_lamp_1"} {"correlation_id":"de8430ad-f242-4536-bebe-e165320b6b26","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:19] local.INFO: [EmailSchedule] FINISHED Inbox Sync {"host":"docker_lamp_1","events":1} {"correlation_id":"de8430ad-f242-4536-bebe-e165320b6b26","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:19] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:sync","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"de8430ad-f242-4536-bebe-e165320b6b26","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:22] local.INFO: [Sync Mailbox] Sync start {"inbox_id":59} {"correlation_id":"eb46c86e-5c80-48b1-a4ee-ac425f197754","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:22] local.INFO: [Inbox service] Skipping METADATA SYNC for inbox 59 due to unauthorized access to the mailbox {"correlation_id":"eb46c86e-5c80-48b1-a4ee-ac425f197754","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:22] local.INFO: [Sync Mailbox] Sync complete {"inbox_id":59} {"correlation_id":"eb46c86e-5c80-48b1-a4ee-ac425f197754","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.INFO: [HubSpot Journal API] Fetching latest journal entry {"url":"https://api.hubapi.com/webhooks/v4/journal/latest"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {"empty_results":5,"max_empty_results":5} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {"empty_results":5,"max_empty_results":5} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Service ending {"runtime_seconds":56,"total_cycles":5,"files_downloaded":0,"empty_files":0,"other_portal_skipped":0,"total_events":0,"events_per_file":0,"avg_api_ms":169.9,"avg_download_ms":0.0,"avg_transform_ms":0.0,"avg_process_ms":0.0,"peak_memory_mb":99.75} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Released polling lock {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:07:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"53329974-bdd6-4cd2-a022-0d565b0a5cf4","trace_id":"08246763-f961-45fb-b262-51378bdbc955"}
[2026-04-14 10:07:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"53329974-bdd6-4cd2-a022-0d565b0a5cf4","trace_id":"08246763-f961-45fb-b262-51378bdbc955"}
[2026-04-14 10:07:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"53329974-bdd6-4cd2-a022-0d565b0a5cf4","trace_id":"08246763-f961-45fb-b262-51378bdbc955"}
[2026-04-14 10:07:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"2b6586f0-419e-4422-8800-e4b7619c43d6","trace_id":"221c682d-c45f-4e4a-a793-ed11006dc6a1"}
[2026-04-14 10:07:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"2b6586f0-419e-4422-8800-e4b7619c43d6","trace_id":"221c682d-c45f-4e4a-a793-ed11006dc6a1"}
[2026-04-14 10:07:08] local.NOTICE: Monitoring start {"correlation_id":"9ba692ee-5286-41ca-abf0-86f6e1167a8e","trace_id":"d58ab8ad-7737-4d7c-91c0-81733c21e709"}
[2026-04-14 10:07:08] local.NOTICE: Monitoring end {"correlation_id":"9ba692ee-5286-41ca-abf0-86f6e1167a8e","trace_id":"d58ab8ad-7737-4d7c-91c0-81733c21e709"}
[2026-04-14 10:07:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"28e708ed-74ee-4417-a8da-c1a9ae0cd745","trace_id":"bd848201-9700-40bf-8fa4-9df13ae88f6e"}
[2026-04-14 10:07:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"28e708ed-74ee-4417-a8da-c1a9ae0cd745","trace_id":"bd848201-9700-40bf-8fa4-9df13ae88f6e"}
[2026-04-14 10:07:12] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"95326c5a-7b17-475d-9245-634d15d51bfe","trace_id":"31b36f9d-93cc-4917-bc7b-6b6a3da139e7"}
[2026-04-14 10:07:12] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"95326c5a-7b17-475d-9245-634d15d51bfe","trace_id":"31b36f9d-93cc-4917-bc7b-6b6a3da139e7"}
[2026-04-14 10:07:12] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"95326c5a-7b17-475d-9245-634d15d51bfe","trace_id":"31b36f9d-93cc-4917-bc7b-6b6a3da139e7"}
[2026-04-14 10:07:12] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"95326c5a-7b17-475d-9245-634d15d51bfe","trace_id":"31b36f9d-93cc-4917-bc7b-6b6a3da139e7"}
[2026-04-14 10:07:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:create","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"f4f68165-0bcc-4e79-89e5-81f9c627e4dc","trace_id":"5766aab2-0316-400f-aa89-168ea0579941"}
[2026-04-14 10:07:14] local.INFO: [EmailSchedule] STARTING batch create {"host":"docker_lamp_1"} {"correlation_id":"f4f68165-0bcc-4e79-89e5-81f9c627e4dc","trace_id":"5766aab2-0316-400f-aa89-168ea0579941"}
[2026-04-14 10:07:14] local.INFO: [EmailSchedule] FINISHED batch create {"host":"docker_lamp_1"} {"correlation_id":"f4f68165-0bcc-4e79-89e5-81f9c627e4dc","trace_id":"5766aab2-0316-400f-aa89-168ea0579941"}
[2026-04-14 10:07:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:create","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"f4f68165-0bcc-4e79-89e5-81f9c627e4dc","trace_id":"5766aab2-0316-400f-aa89-168ea0579941"}
[2026-04-14 10:07:15] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:sync","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"a7d5580f-8b90-4ff6-91e8-de94514f8ca1","trace_id":"fc40909d-86c1-4e45-bd51-96e2bd8c4556"}
[2026-04-14 10:07:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:sync","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"a7d5580f-8b90-4ff6-91e8-de94514f8ca1","trace_id":"fc40909d-86c1-4e45-bd51-96e2bd8c4556"}
[2026-04-14 10:07:16] local.INFO: [Jiminny\Jobs\Mailbox\CreateBatches] processed 0 inboxes and created 0 batches {"userId":null,"batchSize":30,"maxBatches":1000} {"correlation_id":"df4d1442-bcd6-4b63-8513-802ae90993e6","trace_id":"5766aab2-0316-400f-aa89-168ea0579941"}
[2026-04-14 10:08:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"43299ccb-af86-42b1-b793-4ede57e2b91d","trace_id":"2f919b69-9d68-488c-89fa-2aade6ef8519"}
[2026-04-14 10:08:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"43299ccb-af86-42b1-b793-4ede57e2b91d","trace_id":"2f919b69-9d68-488c-89fa-2aade6ef8519"}
[2026-04-14 10:08:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"43299ccb-af86-42b1-b793-4ede57e2b91d","trace_id":"2f919b69-9d68-488c-89fa-2aade6ef8519"}
[2026-04-14 10:08:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"cde80757-333e-4268-a902-892c031b2373","trace_id":"36e932e0-8362-432f-9e36-d819f902d49e"}
[2026-04-14 10:08:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"cde80757-333e-4268-a902-892c031b2373","trace_id":"36e932e0-8362-432f-9e36-d819f902d49e"}
[2026-04-14 10:08:07] local.NOTICE: Monitoring start {"correlation_id":"146390f8-e91a-4e5c-b282-0c83b4947101","trace_id":"fb689e40-c867-4fc5-9847-c223835da80e"}
[2026-04-14 10:08:07] local.NOTICE: Monitoring end {"correlation_id":"146390f8-e91a-4e5c-b282-0c83b4947101","trace_id":"fb689e40-c867-4fc5-9847-c223835da80e"}
[2026-04-14 10:08:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"58e23da5-8f3f-4836-aac7-315ab32f74a3","trace_id":"c71267c4-b5fe-42ad-9bcd-76f6299c1538"}
[2026-04-14 10:08:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"58e23da5-8f3f-4836-aac7-315ab32f74a3","trace_id":"c71267c4-b5fe-42ad-9bcd-76f6299c1538"}
[2026-04-14 10:08:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"9158bb6f-c165-495a-9b6e-8077d8343c87","trace_id":"df378af8-cacb-41ea-b030-b8f53144fddd"}
[2026-04-14 10:08:13] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"9158bb6f-c165-495a-9b6e-8077d8343c87","trace_id":"df378af8-cacb-41ea-b030-b8f53144fddd"}
[2026-04-14 10:08:13] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"9158bb6f-c165-495a-9b6e-8077d8343c87","trace_id":"df378af8-cacb-41ea-b030-b8f53144fddd"}
[2026-04-14 10:08:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"9158bb6f-c165-495a-9b6e-8077d8343c87","trace_id":"df378af8-cacb-41ea-b030-b8f53144fddd"}
[2026-04-14 10:08:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"35774df7-e046-49ec-835f-45f9dc1ec025","trace_id":"45c5e102-6b65-4d23-9edd-684ca996316c"}
[2026-04-14 10:08:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:06:00, 2026-04-14 10:08:00] {"correlation_id":"35774df7-e046-49ec-835f-45f9dc1ec025","trace_id":"45c5e102-6b65-4d23-9edd-684ca996316c"}
[2026-04-14 10:08:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:06:00, 2026-04-14 10:08:00] {"correlation_id":"35774df7-e046-49ec-835f-45f9dc1ec025","trace_id":"45c5e102-6b65-4d23-9edd-684ca996316c"}
[2026-04-14 10:08:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"35774df7-e046-49ec-835f-45f9dc1ec025","trace_id":"45c5e102-6b65-4d23-9edd-684ca996316c"}
[2026-04-14 10:08:17] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:retry-failed","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"d4dc4b3b-8dc8-4665-aec7-139be0df2306","trace_id":"853f2210-e804-40aa-a1d8-4457c60f4993"}
[2026-04-14 10:08:17] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:retry-failed","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"d4dc4b3b-8dc8-4665-aec7-139be0df2306","trace_id":"853f2210-e804-40aa-a1d8-4457c60f4993"}
[2026-04-14 10:09:05] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"8052fb2f-5876-4e2c-8f64-c770d9fe37fe","trace_id":"63249c19-bf59-4e52-9096-156d537a9786"}
[2026-04-14 10:09:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"8052fb2f-5876-4e2c-8f64-c770d9fe37fe","trace_id":"63249c19-bf59-4e52-9096-156d537a9786"}
[2026-04-14 10:09:05] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"8052fb2f-5876-4e2c-8f64-c770d9fe37fe","trace_id":"63249c19-bf59-4e52-9096-156d537a9786"}
[2026-04-14 10:09:07] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"1dd274b4-f71d-486e-b6c4-aaf106304102","trace_id":"1d55139c-a58d-4456-801a-9bcb3bf9b024"}
[2026-04-14 10:09:07] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"1dd274b4-f71d-486e-b6c4-aaf106304102","trace_id":"1d55139c-a58d-4456-801a-9bcb3bf9b024"}
[2026-04-14 10:09:10] local.NOTICE: Monitoring start {"correlation_id":"09dc762e-2b78-4dbb-a880-5c8f1cbfc4ad","trace_id":"8e60392d-4ea4-41f2-be2f-a01853c7a1ab"}
[2026-04-14 10:09:10] local.NOTICE: Monitoring end {"correlation_id":"09dc762e-2b78-4dbb-a880-5c8f1cbfc4ad","trace_id":"8e60392d-4ea4-41f2-be2f-a01853c7a1ab"}
[2026-04-14 10:09:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"2de9f84e-2691-459d-adfd-f5f6746501d0","trace_id":"418ad958-86c0-4477-b0fb-e487768d6fa1"}
[2026-04-14 10:09:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"2de9f84e-2691-459d-adfd-f5f6746501d0","trace_id":"418ad958-86c0-4477-b0fb-e487768d6fa1"}
[2026-04-14 10:09:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"1be8488c-ae59-4f42-8475-c426905c3ca6","trace_id":"aeb8b412-635e-4929-915f-fb3fe5786eae"}
[2026-04-14 10:09:16] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"1be8488c-ae59-4f42-8475-c426905c3ca6","trace_id":"aeb8b412-635e-4929-915f-fb3fe5786eae"}
[2026-04-14 10:09:16] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"1be8488c-ae59-4f42-8475-c426905c3ca6","trace_id":"aeb8b412-635e-4929-915f-fb3fe5786eae"}
[2026-04-14 10:09:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"1be8488c-ae59-4f42-8475-c426905c3ca6","trace_id":"aeb8b412-635e-4929-915f-fb3fe5786eae"}
[2026-04-14 10:09:18] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:aircall:check-and-renew","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:18] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1496,"provider":"aircall"} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:18] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1496,"provider":"aircall"} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:18] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:18] local.ERROR: [Aircall] Re-activating webhooks failed {"team_id":1,"reason":"{\"message\":\"Forbidden\"}"} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:18] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:aircall:check-and-renew","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:21] local.INFO: [RetryFailedDownloads] Starting {"options":{"from":null,"to":null,"help":false,"silent":false,"quiet":false,"verbose":false,"version":false,"ansi":null,"no-interaction":false,"env":null}} {"correlation_id":"c7aba065-c8f1-473d-b8b5-4797245873bf","trace_id":"48f587f9-dd77-4634-9ad9-1137b029b5f5"}
[2026-04-14 10:10:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"7310aae5-3829-4d5c-bbc9-f6550a35f539","trace_id":"6099cf10-45e2-4b82-9649-649e2f8a1209"}
[2026-04-14 10:10:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"7310aae5-3829-4d5c-bbc9-f6550a35f539","trace_id":"6099cf10-45e2-4b82-9649-649e2f8a1209"}
[2026-04-14 10:10:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"7310aae5-3829-4d5c-bbc9-f6550a35f539","trace_id":"6099cf10-45e2-4b82-9649-649e2f8a1209"}
[2026-04-14 10:10:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"5119d94e-0c61-4312-a740-2b569388cc9f","trace_id":"6a412a32-3bc3-46a4-af7c-24ad560a4e41"}
[2026-04-14 10:10:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"5119d94e-0c61-4312-a740-2b569388cc9f","trace_id":"6a412a32-3bc3-46a4-af7c-24ad560a4e41"}
[2026-04-14 10:10:08] local.NOTICE: Monitoring start {"correlation_id":"95cdb3b7-b356-4325-be28-20663ece6aa0","trace_id":"e64a75a4-2493-4f35-ba46-ccd002e6b7b7"}
[2026-04-14 10:10:08] local.NOTICE: Monitoring end {"correlation_id":"95cdb3b7-b356-4325-be28-20663ece6aa0","trace_id":"e64a75a4-2493-4f35-ba46-ccd002e6b7b7"}
[2026-04-14 10:10:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"6460dd5f-4b94-4cd1-867e-53304d785744","trace_id":"683b103d-2dfc-4266-84a2-d5cd799b133f"}
[2026-04-14 10:10:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"6460dd5f-4b94-4cd1-867e-53304d785744","trace_id":"683b103d-2dfc-4266-84a2-d5cd799b133f"}
[2026-04-14 10:10:11] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"5a59007d-2a12-4977-8a5a-59c678aa12ee","trace_id":"bc3a2ad5-9f13-4728-adaa-529da75cf011"}
[2026-04-14 10:10:11] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"5a59007d-2a12-4977-8a5a-59c678aa12ee","trace_id":"bc3a2ad5-9f13-4728-adaa-529da75cf011"}
[2026-04-14 10:10:11] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"5a59007d-2a12-4977-8a5a-59c678aa12ee","trace_id":"bc3a2ad5-9f13-4728-adaa-529da75cf011"}
[2026-04-14 10:10:11] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"5a59007d-2a12-4977-8a5a-59c678aa12ee","trace_id":"bc3a2ad5-9f13-4728-adaa-529da75cf011"}
[2026-04-14 10:10:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"afe2ff6b-1b9e-4485-bdad-a758d873a782","trace_id":"d507becf-55d6-4fda-8831-e981f95b85c8"}
[2026-04-14 10:10:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:08:00, 2026-04-14 10:10:00] {"correlation_id":"afe2ff6b-1b9e-4485-bdad-a758d873a782","trace_id":"d507becf-55d6-4fda-8831-e981f95b85c8"}
[2026-04-14 10:10:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:08:00, 2026-04-14 10:10:00] {"correlation_id":"afe2ff6b-1b9e-4485-bdad-a758d873a782","trace_id":"d507becf-55d6-4fda-8831-e981f95b85c8"}
[2026-04-14 10:10:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"afe2ff6b-1b9e-4485-bdad-a758d873a782","trace_id":"d507becf-55d6-4fda-8831-e981f95b85c8"}
[2026-04-14 10:10:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:purge-stale","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"ebe2ad2b-df9a-48d7-b78f-d52b7489c6f0","trace_id":"05b44216-d5ac-44cd-b74b-3e92567b192d"}
[2026-04-14 10:10:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:purge-stale","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"ebe2ad2b-df9a-48d7-b78f-d52b7489c6f0","trace_id":"05b44216-d5ac-44cd-b74b-3e92567b192d"}
[2026-04-14 10:10:18] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"d76b00ee-6271-4df7-ba45-769738bbb7ae","trace_id":"92384790-9588-452d-abea-cdd25a2fe7ff"}
[2026-04-14 10:10:18] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"d76b00ee-6271-4df7-ba45-769738bbb7ae","trace_id":"92384790-9588-452d-abea-cdd25a2fe7ff"}
[2026-04-14 10:10:20] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"c8f3b5c1-bef5-4584-b9d8-0c10578fefac","trace_id":"b700f03d-b02b-495e-b505-1598c7a9ea4b"}
[2026-04-14 10:10:20] local.INFO: Running pre-meeting notification command {"correlation_id":"c8f3b5c1-bef5-4584-b9d8-0c10578fefac","trace_id":"b700f03d-b02b-495e-b505-1598c7a9ea4b"}
[2026-04-14 10:10:20] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"c8f3b5c1-bef5-4584-b9d8-0c10578fefac","trace_id":"b700f03d-b02b-495e-b505-1598c7a9ea4b"}
[2026-04-14 10:10:22] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"d7b97fbb-00b9-47c2-ae81-dda03fd8b253","trace_id":"54447306-49bf-4629-8de0-bb191c61cce2"}
[2026-04-14 10:10:22] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 10:00:00, 2026-04-14 10:05:00] {"correlation_id":"d7b97fbb-00b9-47c2-ae81-dda03fd8b253","trace_id":"54447306-49bf-4629-8de0-bb191c61cce2"}
[2026-04-14 10:10:22] local.INFO: [conference:monitor:start] No activities found in (2026-04-14 10:00:00, 2026-04-14 10:05:00] {"correlation_id":"d7b97fbb-00b9-47c2-ae81-dda03fd8b253","trace_id":"54447306-49bf-4629-8de0-bb191c61cce2"}
[2026-04-14 10:10:22] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"d7b97fbb-00b9-47c2-ae81-dda03fd8b253","trace_id":"54447306-49bf-4629-8de0-bb191c61cce2"}
[2026-04-14 10:10:23] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"07665538-664f-421e-af9b-97152a688b68","trace_id":"d116813e-2d96-4a3d-ae04-6e53d69ca565"}
[2026-04-14 10:10:23] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:05","to":"10:10"} {"correlation_id":"07665538-664f-421e-af9b-97152a688b68","trace_id":"d116813e-2d96-4a3d-ae04-6e53d69ca565"}
[2026-04-14 10:10:23] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"00:00","to":"00:05"} {"correlation_id":"07665538-664f-421e-af9b-97152a688b68","trace_id":"d116813e-2d96-4a3d-ae04-6e53d69ca565"}
[2026-04-14 10:10:23] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"07665538-664f-421e-af9b-97152a688b68","trace_id":"d116813e-2d96-4a3d-ae04-6e53d69ca565"}
[2026-04-14 10:10:25] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"d269668d-cb18-4aeb-9a05-13a9e53195ed","trace_id":"ecbe2fde-809f-4720-8113-609eda111b53"}
[2026-04-14 10:10:25] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"d269668d-cb18-4aeb-9a05-13a9e53195ed","trace_id":"ecbe2fde-809f-4720-8113-609eda111b53"}
[2026-04-14 10:10:25] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d269668d-cb18-4aeb-9a05-13a9e53195ed","trace_id":"ecbe2fde-809f-4720-8113-609eda111b53"}
[2026-04-14 10:10:25] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f1...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8535156,"top":0.8597222,"width":0.1296875,"height":0.023611112},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8535156,"top":0.8597222,"width":0.12070312,"height":0.023611112},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8535156,"top":0.88819444,"width":0.04140625,"height":0.011805556},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1 file committed","depth":2,"bounds":{"left":0.8535156,"top":0.92430556,"width":0.11796875,"height":0.011805556},"role_description":"text"},{"role":"AXTextField","text":"JY-18909 fix test","depth":3,"bounds":{"left":0.8535156,"top":0.93819445,"width":0.1296875,"height":0.011805556},"value":"JY-18909 fix test","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8535156,"top":0.93819445,"width":0.04140625,"height":0.011805556},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"bounds":{"left":0.8535156,"top":0.9548611,"width":0.056640625,"height":0.011805556},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.03046875,"top":0.017361112,"width":0.0453125,"height":0.022222223},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.07578125,"top":0.017361112,"width":0.14960937,"height":0.022222223},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.78515625,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsCommandTest","depth":6,"bounds":{"left":0.803125,"top":0.017361112,"width":0.09765625,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsCommandTest'","depth":6,"bounds":{"left":0.9007813,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsCommandTest'","depth":6,"bounds":{"left":0.9140625,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9273437,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96015626,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9734375,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9867188,"top":0.017361112,"width":0.013281226,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.049609374,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"873","depth":4,"bounds":{"left":0.58125,"top":0.15208334,"width":0.014453125,"height":0.013194445},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.59765625,"top":0.15069444,"width":0.00859375,"height":0.015972223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.60625,"top":0.15069444,"width":0.008203125,"height":0.015972223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"[2026-04-14 10:05:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"9756bfa7-c8e1-4b17-bc55-9f224d2af2e3\",\"trace_id\":\"9e5fa115-9cf5-45d6-a1da-109e154cfae7\"}\n[2026-04-14 10:05:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"9756bfa7-c8e1-4b17-bc55-9f224d2af2e3\",\"trace_id\":\"9e5fa115-9cf5-45d6-a1da-109e154cfae7\"}\n[2026-04-14 10:05:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d9d68876-323b-42bd-9953-635da8008f2e\",\"trace_id\":\"6c00ce4c-f2df-4ccb-908d-4862de973096\"}\n[2026-04-14 10:05:23] local.INFO: Running pre-meeting notification command {\"correlation_id\":\"d9d68876-323b-42bd-9953-635da8008f2e\",\"trace_id\":\"6c00ce4c-f2df-4ccb-908d-4862de973096\"}\n[2026-04-14 10:05:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d9d68876-323b-42bd-9953-635da8008f2e\",\"trace_id\":\"6c00ce4c-f2df-4ccb-908d-4862de973096\"}\n[2026-04-14 10:05:26] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"27d73fea-a8cb-4757-9bbb-fbe7222e6943\",\"trace_id\":\"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e\"}\n[2026-04-14 10:05:26] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 09:55:00, 2026-04-14 10:00:00] {\"correlation_id\":\"27d73fea-a8cb-4757-9bbb-fbe7222e6943\",\"trace_id\":\"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e\"}\n[2026-04-14 10:05:26] local.INFO: [conference:monitor:start] start ok {\"activity_id\":407307} {\"correlation_id\":\"27d73fea-a8cb-4757-9bbb-fbe7222e6943\",\"trace_id\":\"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e\"}\n[2026-04-14 10:05:26] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"27d73fea-a8cb-4757-9bbb-fbe7222e6943\",\"trace_id\":\"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e\"}\n[2026-04-14 10:05:28] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"588bae45-3998-4b86-b056-51aaf8b6882f\",\"trace_id\":\"8f716a65-7768-44c5-b0e4-02a859f329e5\"}\n[2026-04-14 10:05:28] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesEnded {\"from\":\"10:00\",\"to\":\"10:05\"} {\"correlation_id\":\"588bae45-3998-4b86-b056-51aaf8b6882f\",\"trace_id\":\"8f716a65-7768-44c5-b0e4-02a859f329e5\"}\n[2026-04-14 10:05:28] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {\"from\":\"23:55\",\"to\":\"00:00\"} {\"correlation_id\":\"588bae45-3998-4b86-b056-51aaf8b6882f\",\"trace_id\":\"8f716a65-7768-44c5-b0e4-02a859f329e5\"}\n[2026-04-14 10:05:28] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"588bae45-3998-4b86-b056-51aaf8b6882f\",\"trace_id\":\"8f716a65-7768-44c5-b0e4-02a859f329e5\"}\n[2026-04-14 10:05:30] local.NOTICE: Repairing HubSpot tokens start {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:30] local.INFO: Trying to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:30] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:30] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":59,\"provider\":\"hubspot\",\"refreshToken\":\"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: Trying to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":306,\"provider\":\"hubspot\",\"refreshToken\":\"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: Trying to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1372,\"provider\":\"hubspot\",\"refreshToken\":\"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.NOTICE: Repairing HubSpot tokens end {\"total\":3,\"fixed\":0,\"failed\":3} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2b2ca83a-1263-4a7c-a5d7-86dc15ea7aec\",\"trace_id\":\"fbf48d3d-4e50-4442-b14f-d2ae5e6e70bd\"}\n[2026-04-14 10:05:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"73b127c9-c033-4fa7-a8ed-2e28077ba970\",\"trace_id\":\"fd1cf3c5-d4ce-41d6-a19d-5e67fd544d9e\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"73b127c9-c033-4fa7-a8ed-2e28077ba970\",\"trace_id\":\"fd1cf3c5-d4ce-41d6-a19d-5e67fd544d9e\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Command] Starting polling service {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Service starting {\"memory_limit\":\"256M\",\"max_execution_time\":\"0\",\"initial_memory_mb\":62.0} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Acquired polling lock {\"expires_at\":\"2026-04-14T10:07:34.196472Z\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2b2ca83a-1263-4a7c-a5d7-86dc15ea7aec\",\"trace_id\":\"fbf48d3d-4e50-4442-b14f-d2ae5e6e70bd\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:39] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:39] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:39] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:44] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:44] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:44] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:59] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:59] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:00] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a\",\"trace_id\":\"b4c87c8d-120d-48fb-b13c-aee84323f3e2\"}\n[2026-04-14 10:06:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a\",\"trace_id\":\"b4c87c8d-120d-48fb-b13c-aee84323f3e2\"}\n[2026-04-14 10:06:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a\",\"trace_id\":\"b4c87c8d-120d-48fb-b13c-aee84323f3e2\"}\n[2026-04-14 10:06:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8403c1e4-b5b6-41f9-9280-ff666beed28b\",\"trace_id\":\"3f631f60-6d14-44f5-b6c3-b401999867f9\"}\n[2026-04-14 10:06:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8403c1e4-b5b6-41f9-9280-ff666beed28b\",\"trace_id\":\"3f631f60-6d14-44f5-b6c3-b401999867f9\"}\n[2026-04-14 10:06:08] local.NOTICE: Monitoring start {\"correlation_id\":\"0d51eb08-f2f1-4322-97d0-268700856a99\",\"trace_id\":\"92b45b9a-b6e8-40c8-a783-193cf1a4eea2\"}\n[2026-04-14 10:06:08] local.NOTICE: Monitoring end {\"correlation_id\":\"0d51eb08-f2f1-4322-97d0-268700856a99\",\"trace_id\":\"92b45b9a-b6e8-40c8-a783-193cf1a4eea2\"}\n[2026-04-14 10:06:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"0566c59b-bf67-49eb-970a-a6b955ddd756\",\"trace_id\":\"724c5f5e-cd88-41fb-9b7e-74315e131024\"}\n[2026-04-14 10:06:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"0566c59b-bf67-49eb-970a-a6b955ddd756\",\"trace_id\":\"724c5f5e-cd88-41fb-9b7e-74315e131024\"}\n[2026-04-14 10:06:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"33d190d4-0abb-4e63-af52-95faa913e7a1\",\"trace_id\":\"703aaa4d-a551-4ed1-8a4a-609d373e2fc0\"}\n[2026-04-14 10:06:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"33d190d4-0abb-4e63-af52-95faa913e7a1\",\"trace_id\":\"703aaa4d-a551-4ed1-8a4a-609d373e2fc0\"}\n[2026-04-14 10:06:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"33d190d4-0abb-4e63-af52-95faa913e7a1\",\"trace_id\":\"703aaa4d-a551-4ed1-8a4a-609d373e2fc0\"}\n[2026-04-14 10:06:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"33d190d4-0abb-4e63-af52-95faa913e7a1\",\"trace_id\":\"703aaa4d-a551-4ed1-8a4a-609d373e2fc0\"}\n[2026-04-14 10:06:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"da41d77d-46d9-41ae-90b7-f8418b05fb9a\",\"trace_id\":\"47329a55-e6f4-406b-8730-e72d69737f09\"}\n[2026-04-14 10:06:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:04:00, 2026-04-14 10:06:00] {\"correlation_id\":\"da41d77d-46d9-41ae-90b7-f8418b05fb9a\",\"trace_id\":\"47329a55-e6f4-406b-8730-e72d69737f09\"}\n[2026-04-14 10:06:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:04:00, 2026-04-14 10:06:00] {\"correlation_id\":\"da41d77d-46d9-41ae-90b7-f8418b05fb9a\",\"trace_id\":\"47329a55-e6f4-406b-8730-e72d69737f09\"}\n[2026-04-14 10:06:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"da41d77d-46d9-41ae-90b7-f8418b05fb9a\",\"trace_id\":\"47329a55-e6f4-406b-8730-e72d69737f09\"}\n[2026-04-14 10:06:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"310e7e99-6de4-4f93-967e-37c78e9ec826\",\"trace_id\":\"2a1fdf0a-be0e-4e5a-a677-fa16ddc33e9e\"}\n[2026-04-14 10:06:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"310e7e99-6de4-4f93-967e-37c78e9ec826\",\"trace_id\":\"2a1fdf0a-be0e-4e5a-a677-fa16ddc33e9e\"}\n[2026-04-14 10:06:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"de8430ad-f242-4536-bebe-e165320b6b26\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:19] local.INFO: [EmailSchedule] STARTING Inbox Sync {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"de8430ad-f242-4536-bebe-e165320b6b26\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:19] local.INFO: [EmailSchedule] FINISHED Inbox Sync {\"host\":\"docker_lamp_1\",\"events\":1} {\"correlation_id\":\"de8430ad-f242-4536-bebe-e165320b6b26\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"de8430ad-f242-4536-bebe-e165320b6b26\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:22] local.INFO: [Sync Mailbox] Sync start {\"inbox_id\":59} {\"correlation_id\":\"eb46c86e-5c80-48b1-a4ee-ac425f197754\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:22] local.INFO: [Inbox service] Skipping METADATA SYNC for inbox 59 due to unauthorized access to the mailbox {\"correlation_id\":\"eb46c86e-5c80-48b1-a4ee-ac425f197754\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:22] local.INFO: [Sync Mailbox] Sync complete {\"inbox_id\":59} {\"correlation_id\":\"eb46c86e-5c80-48b1-a4ee-ac425f197754\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Service ending {\"runtime_seconds\":56,\"total_cycles\":5,\"files_downloaded\":0,\"empty_files\":0,\"other_portal_skipped\":0,\"total_events\":0,\"events_per_file\":0,\"avg_api_ms\":169.9,\"avg_download_ms\":0.0,\"avg_transform_ms\":0.0,\"avg_process_ms\":0.0,\"peak_memory_mb\":99.75} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Released polling lock {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:07:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"53329974-bdd6-4cd2-a022-0d565b0a5cf4\",\"trace_id\":\"08246763-f961-45fb-b262-51378bdbc955\"}\n[2026-04-14 10:07:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"53329974-bdd6-4cd2-a022-0d565b0a5cf4\",\"trace_id\":\"08246763-f961-45fb-b262-51378bdbc955\"}\n[2026-04-14 10:07:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"53329974-bdd6-4cd2-a022-0d565b0a5cf4\",\"trace_id\":\"08246763-f961-45fb-b262-51378bdbc955\"}\n[2026-04-14 10:07:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2b6586f0-419e-4422-8800-e4b7619c43d6\",\"trace_id\":\"221c682d-c45f-4e4a-a793-ed11006dc6a1\"}\n[2026-04-14 10:07:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2b6586f0-419e-4422-8800-e4b7619c43d6\",\"trace_id\":\"221c682d-c45f-4e4a-a793-ed11006dc6a1\"}\n[2026-04-14 10:07:08] local.NOTICE: Monitoring start {\"correlation_id\":\"9ba692ee-5286-41ca-abf0-86f6e1167a8e\",\"trace_id\":\"d58ab8ad-7737-4d7c-91c0-81733c21e709\"}\n[2026-04-14 10:07:08] local.NOTICE: Monitoring end {\"correlation_id\":\"9ba692ee-5286-41ca-abf0-86f6e1167a8e\",\"trace_id\":\"d58ab8ad-7737-4d7c-91c0-81733c21e709\"}\n[2026-04-14 10:07:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"28e708ed-74ee-4417-a8da-c1a9ae0cd745\",\"trace_id\":\"bd848201-9700-40bf-8fa4-9df13ae88f6e\"}\n[2026-04-14 10:07:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"28e708ed-74ee-4417-a8da-c1a9ae0cd745\",\"trace_id\":\"bd848201-9700-40bf-8fa4-9df13ae88f6e\"}\n[2026-04-14 10:07:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"95326c5a-7b17-475d-9245-634d15d51bfe\",\"trace_id\":\"31b36f9d-93cc-4917-bc7b-6b6a3da139e7\"}\n[2026-04-14 10:07:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"95326c5a-7b17-475d-9245-634d15d51bfe\",\"trace_id\":\"31b36f9d-93cc-4917-bc7b-6b6a3da139e7\"}\n[2026-04-14 10:07:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"95326c5a-7b17-475d-9245-634d15d51bfe\",\"trace_id\":\"31b36f9d-93cc-4917-bc7b-6b6a3da139e7\"}\n[2026-04-14 10:07:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"95326c5a-7b17-475d-9245-634d15d51bfe\",\"trace_id\":\"31b36f9d-93cc-4917-bc7b-6b6a3da139e7\"}\n[2026-04-14 10:07:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"f4f68165-0bcc-4e79-89e5-81f9c627e4dc\",\"trace_id\":\"5766aab2-0316-400f-aa89-168ea0579941\"}\n[2026-04-14 10:07:14] local.INFO: [EmailSchedule] STARTING batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"f4f68165-0bcc-4e79-89e5-81f9c627e4dc\",\"trace_id\":\"5766aab2-0316-400f-aa89-168ea0579941\"}\n[2026-04-14 10:07:14] local.INFO: [EmailSchedule] FINISHED batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"f4f68165-0bcc-4e79-89e5-81f9c627e4dc\",\"trace_id\":\"5766aab2-0316-400f-aa89-168ea0579941\"}\n[2026-04-14 10:07:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"f4f68165-0bcc-4e79-89e5-81f9c627e4dc\",\"trace_id\":\"5766aab2-0316-400f-aa89-168ea0579941\"}\n[2026-04-14 10:07:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a7d5580f-8b90-4ff6-91e8-de94514f8ca1\",\"trace_id\":\"fc40909d-86c1-4e45-bd51-96e2bd8c4556\"}\n[2026-04-14 10:07:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a7d5580f-8b90-4ff6-91e8-de94514f8ca1\",\"trace_id\":\"fc40909d-86c1-4e45-bd51-96e2bd8c4556\"}\n[2026-04-14 10:07:16] local.INFO: [Jiminny\\Jobs\\Mailbox\\CreateBatches] processed 0 inboxes and created 0 batches {\"userId\":null,\"batchSize\":30,\"maxBatches\":1000} {\"correlation_id\":\"df4d1442-bcd6-4b63-8513-802ae90993e6\",\"trace_id\":\"5766aab2-0316-400f-aa89-168ea0579941\"}\n[2026-04-14 10:08:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"43299ccb-af86-42b1-b793-4ede57e2b91d\",\"trace_id\":\"2f919b69-9d68-488c-89fa-2aade6ef8519\"}\n[2026-04-14 10:08:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"43299ccb-af86-42b1-b793-4ede57e2b91d\",\"trace_id\":\"2f919b69-9d68-488c-89fa-2aade6ef8519\"}\n[2026-04-14 10:08:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"43299ccb-af86-42b1-b793-4ede57e2b91d\",\"trace_id\":\"2f919b69-9d68-488c-89fa-2aade6ef8519\"}\n[2026-04-14 10:08:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"cde80757-333e-4268-a902-892c031b2373\",\"trace_id\":\"36e932e0-8362-432f-9e36-d819f902d49e\"}\n[2026-04-14 10:08:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"cde80757-333e-4268-a902-892c031b2373\",\"trace_id\":\"36e932e0-8362-432f-9e36-d819f902d49e\"}\n[2026-04-14 10:08:07] local.NOTICE: Monitoring start {\"correlation_id\":\"146390f8-e91a-4e5c-b282-0c83b4947101\",\"trace_id\":\"fb689e40-c867-4fc5-9847-c223835da80e\"}\n[2026-04-14 10:08:07] local.NOTICE: Monitoring end {\"correlation_id\":\"146390f8-e91a-4e5c-b282-0c83b4947101\",\"trace_id\":\"fb689e40-c867-4fc5-9847-c223835da80e\"}\n[2026-04-14 10:08:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"58e23da5-8f3f-4836-aac7-315ab32f74a3\",\"trace_id\":\"c71267c4-b5fe-42ad-9bcd-76f6299c1538\"}\n[2026-04-14 10:08:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"58e23da5-8f3f-4836-aac7-315ab32f74a3\",\"trace_id\":\"c71267c4-b5fe-42ad-9bcd-76f6299c1538\"}\n[2026-04-14 10:08:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"9158bb6f-c165-495a-9b6e-8077d8343c87\",\"trace_id\":\"df378af8-cacb-41ea-b030-b8f53144fddd\"}\n[2026-04-14 10:08:13] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"9158bb6f-c165-495a-9b6e-8077d8343c87\",\"trace_id\":\"df378af8-cacb-41ea-b030-b8f53144fddd\"}\n[2026-04-14 10:08:13] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"9158bb6f-c165-495a-9b6e-8077d8343c87\",\"trace_id\":\"df378af8-cacb-41ea-b030-b8f53144fddd\"}\n[2026-04-14 10:08:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"9158bb6f-c165-495a-9b6e-8077d8343c87\",\"trace_id\":\"df378af8-cacb-41ea-b030-b8f53144fddd\"}\n[2026-04-14 10:08:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"35774df7-e046-49ec-835f-45f9dc1ec025\",\"trace_id\":\"45c5e102-6b65-4d23-9edd-684ca996316c\"}\n[2026-04-14 10:08:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:06:00, 2026-04-14 10:08:00] {\"correlation_id\":\"35774df7-e046-49ec-835f-45f9dc1ec025\",\"trace_id\":\"45c5e102-6b65-4d23-9edd-684ca996316c\"}\n[2026-04-14 10:08:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:06:00, 2026-04-14 10:08:00] {\"correlation_id\":\"35774df7-e046-49ec-835f-45f9dc1ec025\",\"trace_id\":\"45c5e102-6b65-4d23-9edd-684ca996316c\"}\n[2026-04-14 10:08:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"35774df7-e046-49ec-835f-45f9dc1ec025\",\"trace_id\":\"45c5e102-6b65-4d23-9edd-684ca996316c\"}\n[2026-04-14 10:08:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d4dc4b3b-8dc8-4665-aec7-139be0df2306\",\"trace_id\":\"853f2210-e804-40aa-a1d8-4457c60f4993\"}\n[2026-04-14 10:08:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d4dc4b3b-8dc8-4665-aec7-139be0df2306\",\"trace_id\":\"853f2210-e804-40aa-a1d8-4457c60f4993\"}\n[2026-04-14 10:09:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8052fb2f-5876-4e2c-8f64-c770d9fe37fe\",\"trace_id\":\"63249c19-bf59-4e52-9096-156d537a9786\"}\n[2026-04-14 10:09:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"8052fb2f-5876-4e2c-8f64-c770d9fe37fe\",\"trace_id\":\"63249c19-bf59-4e52-9096-156d537a9786\"}\n[2026-04-14 10:09:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8052fb2f-5876-4e2c-8f64-c770d9fe37fe\",\"trace_id\":\"63249c19-bf59-4e52-9096-156d537a9786\"}\n[2026-04-14 10:09:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"1dd274b4-f71d-486e-b6c4-aaf106304102\",\"trace_id\":\"1d55139c-a58d-4456-801a-9bcb3bf9b024\"}\n[2026-04-14 10:09:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"1dd274b4-f71d-486e-b6c4-aaf106304102\",\"trace_id\":\"1d55139c-a58d-4456-801a-9bcb3bf9b024\"}\n[2026-04-14 10:09:10] local.NOTICE: Monitoring start {\"correlation_id\":\"09dc762e-2b78-4dbb-a880-5c8f1cbfc4ad\",\"trace_id\":\"8e60392d-4ea4-41f2-be2f-a01853c7a1ab\"}\n[2026-04-14 10:09:10] local.NOTICE: Monitoring end {\"correlation_id\":\"09dc762e-2b78-4dbb-a880-5c8f1cbfc4ad\",\"trace_id\":\"8e60392d-4ea4-41f2-be2f-a01853c7a1ab\"}\n[2026-04-14 10:09:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2de9f84e-2691-459d-adfd-f5f6746501d0\",\"trace_id\":\"418ad958-86c0-4477-b0fb-e487768d6fa1\"}\n[2026-04-14 10:09:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2de9f84e-2691-459d-adfd-f5f6746501d0\",\"trace_id\":\"418ad958-86c0-4477-b0fb-e487768d6fa1\"}\n[2026-04-14 10:09:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"1be8488c-ae59-4f42-8475-c426905c3ca6\",\"trace_id\":\"aeb8b412-635e-4929-915f-fb3fe5786eae\"}\n[2026-04-14 10:09:16] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"1be8488c-ae59-4f42-8475-c426905c3ca6\",\"trace_id\":\"aeb8b412-635e-4929-915f-fb3fe5786eae\"}\n[2026-04-14 10:09:16] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"1be8488c-ae59-4f42-8475-c426905c3ca6\",\"trace_id\":\"aeb8b412-635e-4929-915f-fb3fe5786eae\"}\n[2026-04-14 10:09:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"1be8488c-ae59-4f42-8475-c426905c3ca6\",\"trace_id\":\"aeb8b412-635e-4929-915f-fb3fe5786eae\"}\n[2026-04-14 10:09:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:aircall:check-and-renew\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:18] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1496,\"provider\":\"aircall\"} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:18] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1496,\"provider\":\"aircall\"} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:18] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:18] local.ERROR: [Aircall] Re-activating webhooks failed {\"team_id\":1,\"reason\":\"{\\\"message\\\":\\\"Forbidden\\\"}\"} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:aircall:check-and-renew\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:21] local.INFO: [RetryFailedDownloads] Starting {\"options\":{\"from\":null,\"to\":null,\"help\":false,\"silent\":false,\"quiet\":false,\"verbose\":false,\"version\":false,\"ansi\":null,\"no-interaction\":false,\"env\":null}} {\"correlation_id\":\"c7aba065-c8f1-473d-b8b5-4797245873bf\",\"trace_id\":\"48f587f9-dd77-4634-9ad9-1137b029b5f5\"}\n[2026-04-14 10:10:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"7310aae5-3829-4d5c-bbc9-f6550a35f539\",\"trace_id\":\"6099cf10-45e2-4b82-9649-649e2f8a1209\"}\n[2026-04-14 10:10:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"7310aae5-3829-4d5c-bbc9-f6550a35f539\",\"trace_id\":\"6099cf10-45e2-4b82-9649-649e2f8a1209\"}\n[2026-04-14 10:10:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"7310aae5-3829-4d5c-bbc9-f6550a35f539\",\"trace_id\":\"6099cf10-45e2-4b82-9649-649e2f8a1209\"}\n[2026-04-14 10:10:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"5119d94e-0c61-4312-a740-2b569388cc9f\",\"trace_id\":\"6a412a32-3bc3-46a4-af7c-24ad560a4e41\"}\n[2026-04-14 10:10:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"5119d94e-0c61-4312-a740-2b569388cc9f\",\"trace_id\":\"6a412a32-3bc3-46a4-af7c-24ad560a4e41\"}\n[2026-04-14 10:10:08] local.NOTICE: Monitoring start {\"correlation_id\":\"95cdb3b7-b356-4325-be28-20663ece6aa0\",\"trace_id\":\"e64a75a4-2493-4f35-ba46-ccd002e6b7b7\"}\n[2026-04-14 10:10:08] local.NOTICE: Monitoring end {\"correlation_id\":\"95cdb3b7-b356-4325-be28-20663ece6aa0\",\"trace_id\":\"e64a75a4-2493-4f35-ba46-ccd002e6b7b7\"}\n[2026-04-14 10:10:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"6460dd5f-4b94-4cd1-867e-53304d785744\",\"trace_id\":\"683b103d-2dfc-4266-84a2-d5cd799b133f\"}\n[2026-04-14 10:10:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"6460dd5f-4b94-4cd1-867e-53304d785744\",\"trace_id\":\"683b103d-2dfc-4266-84a2-d5cd799b133f\"}\n[2026-04-14 10:10:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"5a59007d-2a12-4977-8a5a-59c678aa12ee\",\"trace_id\":\"bc3a2ad5-9f13-4728-adaa-529da75cf011\"}\n[2026-04-14 10:10:11] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"5a59007d-2a12-4977-8a5a-59c678aa12ee\",\"trace_id\":\"bc3a2ad5-9f13-4728-adaa-529da75cf011\"}\n[2026-04-14 10:10:11] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"5a59007d-2a12-4977-8a5a-59c678aa12ee\",\"trace_id\":\"bc3a2ad5-9f13-4728-adaa-529da75cf011\"}\n[2026-04-14 10:10:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"5a59007d-2a12-4977-8a5a-59c678aa12ee\",\"trace_id\":\"bc3a2ad5-9f13-4728-adaa-529da75cf011\"}\n[2026-04-14 10:10:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"afe2ff6b-1b9e-4485-bdad-a758d873a782\",\"trace_id\":\"d507becf-55d6-4fda-8831-e981f95b85c8\"}\n[2026-04-14 10:10:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:08:00, 2026-04-14 10:10:00] {\"correlation_id\":\"afe2ff6b-1b9e-4485-bdad-a758d873a782\",\"trace_id\":\"d507becf-55d6-4fda-8831-e981f95b85c8\"}\n[2026-04-14 10:10:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:08:00, 2026-04-14 10:10:00] {\"correlation_id\":\"afe2ff6b-1b9e-4485-bdad-a758d873a782\",\"trace_id\":\"d507becf-55d6-4fda-8831-e981f95b85c8\"}\n[2026-04-14 10:10:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"afe2ff6b-1b9e-4485-bdad-a758d873a782\",\"trace_id\":\"d507becf-55d6-4fda-8831-e981f95b85c8\"}\n[2026-04-14 10:10:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ebe2ad2b-df9a-48d7-b78f-d52b7489c6f0\",\"trace_id\":\"05b44216-d5ac-44cd-b74b-3e92567b192d\"}\n[2026-04-14 10:10:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ebe2ad2b-df9a-48d7-b78f-d52b7489c6f0\",\"trace_id\":\"05b44216-d5ac-44cd-b74b-3e92567b192d\"}\n[2026-04-14 10:10:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d76b00ee-6271-4df7-ba45-769738bbb7ae\",\"trace_id\":\"92384790-9588-452d-abea-cdd25a2fe7ff\"}\n[2026-04-14 10:10:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d76b00ee-6271-4df7-ba45-769738bbb7ae\",\"trace_id\":\"92384790-9588-452d-abea-cdd25a2fe7ff\"}\n[2026-04-14 10:10:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"c8f3b5c1-bef5-4584-b9d8-0c10578fefac\",\"trace_id\":\"b700f03d-b02b-495e-b505-1598c7a9ea4b\"}\n[2026-04-14 10:10:20] local.INFO: Running pre-meeting notification command {\"correlation_id\":\"c8f3b5c1-bef5-4584-b9d8-0c10578fefac\",\"trace_id\":\"b700f03d-b02b-495e-b505-1598c7a9ea4b\"}\n[2026-04-14 10:10:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"c8f3b5c1-bef5-4584-b9d8-0c10578fefac\",\"trace_id\":\"b700f03d-b02b-495e-b505-1598c7a9ea4b\"}\n[2026-04-14 10:10:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d7b97fbb-00b9-47c2-ae81-dda03fd8b253\",\"trace_id\":\"54447306-49bf-4629-8de0-bb191c61cce2\"}\n[2026-04-14 10:10:22] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 10:00:00, 2026-04-14 10:05:00] {\"correlation_id\":\"d7b97fbb-00b9-47c2-ae81-dda03fd8b253\",\"trace_id\":\"54447306-49bf-4629-8de0-bb191c61cce2\"}\n[2026-04-14 10:10:22] local.INFO: [conference:monitor:start] No activities found in (2026-04-14 10:00:00, 2026-04-14 10:05:00] {\"correlation_id\":\"d7b97fbb-00b9-47c2-ae81-dda03fd8b253\",\"trace_id\":\"54447306-49bf-4629-8de0-bb191c61cce2\"}\n[2026-04-14 10:10:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d7b97fbb-00b9-47c2-ae81-dda03fd8b253\",\"trace_id\":\"54447306-49bf-4629-8de0-bb191c61cce2\"}\n[2026-04-14 10:10:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"07665538-664f-421e-af9b-97152a688b68\",\"trace_id\":\"d116813e-2d96-4a3d-ae04-6e53d69ca565\"}\n[2026-04-14 10:10:23] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesEnded {\"from\":\"10:05\",\"to\":\"10:10\"} {\"correlation_id\":\"07665538-664f-421e-af9b-97152a688b68\",\"trace_id\":\"d116813e-2d96-4a3d-ae04-6e53d69ca565\"}\n[2026-04-14 10:10:23] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {\"from\":\"00:00\",\"to\":\"00:05\"} {\"correlation_id\":\"07665538-664f-421e-af9b-97152a688b68\",\"trace_id\":\"d116813e-2d96-4a3d-ae04-6e53d69ca565\"}\n[2026-04-14 10:10:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"07665538-664f-421e-af9b-97152a688b68\",\"trace_id\":\"d116813e-2d96-4a3d-ae04-6e53d69ca565\"}\n[2026-04-14 10:10:25] local.NOTICE: Repairing HubSpot tokens start {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:25] local.INFO: Trying to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:25] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:25] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":59,\"provider\":\"hubspot\",\"refreshToken\":\"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":306,\"provider\":\"hubspot\",\"refreshToken\":\"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1372,\"provider\":\"hubspot\",\"refreshToken\":\"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:27] local.ERROR: Failed to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:27] local.NOTICE: Repairing HubSpot tokens end {\"total\":3,\"fixed\":0,\"failed\":3} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"cba13635-8dbf-4423-ad70-69f2d927c6ff\",\"trace_id\":\"cca585f7-e8b4-4cbd-b63f-8d9be90960a6\"}\n[2026-04-14 10:10:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"jiminny:transcription:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8d29e53b-638b-4e55-8ee6-70567699b366\",\"trace_id\":\"ac17c380-0e7e-4425-bbc9-9e292ed99ea5\"}\n[2026-04-14 10:10:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"jiminny:transcription:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8d29e53b-638b-4e55-8ee6-70567699b366\",\"trace_id\":\"ac17c380-0e7e-4425-bbc9-9e292ed99ea5\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Command] Starting polling service {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Polling] Service starting {\"memory_limit\":\"256M\",\"max_execution_time\":\"0\",\"initial_memory_mb\":62.0} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Polling] Acquired polling lock {\"expires_at\":\"2026-04-14T10:12:30.407181Z\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"cba13635-8dbf-4423-ad70-69f2d927c6ff\",\"trace_id\":\"cca585f7-e8b4-4cbd-b63f-8d9be90960a6\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:32] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:reset-governor\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"4943604a-02ac-42cd-82ee-524a684c9d07\",\"trace_id\":\"dea56e3f-9697-4054-8b54-7db752a8613f\"}\n[2026-04-14 10:10:32] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:reset-governor\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"4943604a-02ac-42cd-82ee-524a684c9d07\",\"trace_id\":\"dea56e3f-9697-4054-8b54-7db752a8613f\"}\n[2026-04-14 10:10:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"7ae1dc8e-0ce6-461b-a054-be59c56de0b5\",\"trace_id\":\"8892af7b-37c9-4892-82fd-aa4596edc512\"}\n[2026-04-14 10:10:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"7ae1dc8e-0ce6-461b-a054-be59c56de0b5\",\"trace_id\":\"8892af7b-37c9-4892-82fd-aa4596edc512\"}\n[2026-04-14 10:10:35] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:35] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:35] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:40] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:40] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:41] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:56] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:56] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:56] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"79c8dc9b-058f-4f0e-9e9a-2e34a66209a7\",\"trace_id\":\"c6894787-c096-4c96-96cf-8ed81e40aa59\"}\n[2026-04-14 10:11:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"79c8dc9b-058f-4f0e-9e9a-2e34a66209a7\",\"trace_id\":\"c6894787-c096-4c96-96cf-8ed81e40aa59\"}\n[2026-04-14 10:11:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"79c8dc9b-058f-4f0e-9e9a-2e34a66209a7\",\"trace_id\":\"c6894787-c096-4c96-96cf-8ed81e40aa59\"}\n[2026-04-14 10:11:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d52d55c7-74a3-409b-b458-fecfd8990f5a\",\"trace_id\":\"407ded8c-1b50-4ba7-8190-f3e84814124e\"}\n[2026-04-14 10:11:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d52d55c7-74a3-409b-b458-fecfd8990f5a\",\"trace_id\":\"407ded8c-1b50-4ba7-8190-f3e84814124e\"}\n[2026-04-14 10:11:08] local.NOTICE: Monitoring start {\"correlation_id\":\"296fc7a0-329d-43bf-8c98-547c407c447c\",\"trace_id\":\"d2bbc8a9-18cb-408f-98a9-f87d6a2e4cb9\"}\n[2026-04-14 10:11:08] local.NOTICE: Monitoring end {\"correlation_id\":\"296fc7a0-329d-43bf-8c98-547c407c447c\",\"trace_id\":\"d2bbc8a9-18cb-408f-98a9-f87d6a2e4cb9\"}\n[2026-04-14 10:11:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"4aaf62d1-0d46-4f16-af0e-0617eb460382\",\"trace_id\":\"7bcc5249-9d16-44e5-a83c-3a613e00c860\"}\n[2026-04-14 10:11:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"4aaf62d1-0d46-4f16-af0e-0617eb460382\",\"trace_id\":\"7bcc5249-9d16-44e5-a83c-3a613e00c860\"}\n[2026-04-14 10:11:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"19290448-0263-4849-93fc-f09885da0c1f\",\"trace_id\":\"1483761c-464c-4374-994f-121758fcd534\"}\n[2026-04-14 10:11:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"19290448-0263-4849-93fc-f09885da0c1f\",\"trace_id\":\"1483761c-464c-4374-994f-121758fcd534\"}\n[2026-04-14 10:11:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"19290448-0263-4849-93fc-f09885da0c1f\",\"trace_id\":\"1483761c-464c-4374-994f-121758fcd534\"}\n[2026-04-14 10:11:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"19290448-0263-4849-93fc-f09885da0c1f\",\"trace_id\":\"1483761c-464c-4374-994f-121758fcd534\"}\n[2026-04-14 10:11:26] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.INFO: [HubSpot Journal Polling] Service ending {\"runtime_seconds\":56,\"total_cycles\":5,\"files_downloaded\":0,\"empty_files\":0,\"other_portal_skipped\":0,\"total_events\":0,\"events_per_file\":0,\"avg_api_ms\":252.2,\"avg_download_ms\":0.0,\"avg_transform_ms\":0.0,\"avg_process_ms\":0.0,\"peak_memory_mb\":99.75} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.INFO: [HubSpot Journal Polling] Released polling lock {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:12:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"74ad5a14-81b2-48f4-bb37-2d2ac73c5059\",\"trace_id\":\"6d6d809e-3d77-400c-a351-ac4db72cf3fc\"}\n[2026-04-14 10:12:07] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"74ad5a14-81b2-48f4-bb37-2d2ac73c5059\",\"trace_id\":\"6d6d809e-3d77-400c-a351-ac4db72cf3fc\"}\n[2026-04-14 10:12:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"74ad5a14-81b2-48f4-bb37-2d2ac73c5059\",\"trace_id\":\"6d6d809e-3d77-400c-a351-ac4db72cf3fc\"}\n[2026-04-14 10:12:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3671d2e5-29f6-43db-8f1a-4a0bf5ff669b\",\"trace_id\":\"1295351d-9c37-47db-bad6-dbccb4c6466f\"}\n[2026-04-14 10:12:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3671d2e5-29f6-43db-8f1a-4a0bf5ff669b\",\"trace_id\":\"1295351d-9c37-47db-bad6-dbccb4c6466f\"}\n[2026-04-14 10:12:11] local.NOTICE: Monitoring start {\"correlation_id\":\"f2d467c8-e822-4691-9920-cac071f14877\",\"trace_id\":\"4d67db65-374a-4eb2-9cc6-8c60dc9ebabc\"}\n[2026-04-14 10:12:11] local.NOTICE: Monitoring end {\"correlation_id\":\"f2d467c8-e822-4691-9920-cac071f14877\",\"trace_id\":\"4d67db65-374a-4eb2-9cc6-8c60dc9ebabc\"}\n[2026-04-14 10:12:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"04d8a469-317c-40e1-a163-ad747408f9e3\",\"trace_id\":\"bafa4d05-7e55-4524-b0a5-1764ecb964fe\"}\n[2026-04-14 10:12:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"04d8a469-317c-40e1-a163-ad747408f9e3\",\"trace_id\":\"bafa4d05-7e55-4524-b0a5-1764ecb964fe\"}\n[2026-04-14 10:12:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3cd3a658-bd65-4253-9c8d-b94cdd2f3c4d\",\"trace_id\":\"5ae25493-7098-481f-84f4-225c6595b140\"}\n[2026-04-14 10:12:20] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"3cd3a658-bd65-4253-9c8d-b94cdd2f3c4d\",\"trace_id\":\"5ae25493-7098-481f-84f4-225c6595b140\"}\n[2026-04-14 10:12:20] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"3cd3a658-bd65-4253-9c8d-b94cdd2f3c4d\",\"trace_id\":\"5ae25493-7098-481f-84f4-225c6595b140\"}\n[2026-04-14 10:12:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3cd3a658-bd65-4253-9c8d-b94cdd2f3c4d\",\"trace_id\":\"5ae25493-7098-481f-84f4-225c6595b140\"}\n[2026-04-14 10:12:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"4cabe4c8-81a7-4405-958c-783cc42dc31a\",\"trace_id\":\"844b27d2-1727-4f1a-bb9a-a3ad44d9d37a\"}\n[2026-04-14 10:12:22] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:10:00, 2026-04-14 10:12:00] {\"correlation_id\":\"4cabe4c8-81a7-4405-958c-783cc42dc31a\",\"trace_id\":\"844b27d2-1727-4f1a-bb9a-a3ad44d9d37a\"}\n[2026-04-14 10:12:22] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:10:00, 2026-04-14 10:12:00] {\"correlation_id\":\"4cabe4c8-81a7-4405-958c-783cc42dc31a\",\"trace_id\":\"844b27d2-1727-4f1a-bb9a-a3ad44d9d37a\"}\n[2026-04-14 10:12:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"4cabe4c8-81a7-4405-958c-783cc42dc31a\",\"trace_id\":\"844b27d2-1727-4f1a-bb9a-a3ad44d9d37a\"}\n[2026-04-14 10:12:25] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b573f9e3-5771-4b03-9fd9-1ff7d571916d\",\"trace_id\":\"e76af6ed-1fff-4aef-8b17-a8288121b37a\"}\n[2026-04-14 10:12:25] local.INFO: [EmailSchedule] STARTING batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"b573f9e3-5771-4b03-9fd9-1ff7d571916d\",\"trace_id\":\"e76af6ed-1fff-4aef-8b17-a8288121b37a\"}\n[2026-04-14 10:12:25] local.INFO: [EmailSchedule] FINISHED batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"b573f9e3-5771-4b03-9fd9-1ff7d571916d\",\"trace_id\":\"e76af6ed-1fff-4aef-8b17-a8288121b37a\"}\n[2026-04-14 10:12:25] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b573f9e3-5771-4b03-9fd9-1ff7d571916d\",\"trace_id\":\"e76af6ed-1fff-4aef-8b17-a8288121b37a\"}\n[2026-04-14 10:12:27] local.INFO: [Jiminny\\Jobs\\Mailbox\\CreateBatches] processed 0 inboxes and created 0 batches {\"userId\":null,\"batchSize\":30,\"maxBatches\":1000} {\"correlation_id\":\"ad382f07-8ff8-450f-b38c-fba577285d06\",\"trace_id\":\"e76af6ed-1fff-4aef-8b17-a8288121b37a\"}\n[2026-04-14 10:13:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"24a30c58-6ce4-427b-972e-87df2b1f0d31\",\"trace_id\":\"30809930-a6a8-49bb-9c61-f4dcca23683a\"}\n[2026-04-14 10:13:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"24a30c58-6ce4-427b-972e-87df2b1f0d31\",\"trace_id\":\"30809930-a6a8-49bb-9c61-f4dcca23683a\"}\n[2026-04-14 10:13:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"24a30c58-6ce4-427b-972e-87df2b1f0d31\",\"trace_id\":\"30809930-a6a8-49bb-9c61-f4dcca23683a\"}\n[2026-04-14 10:13:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"db368cd5-b4ea-4f77-8169-24ff5403199d\",\"trace_id\":\"0bd7332d-c4c1-44b6-b204-e68b8ec6217a\"}\n[2026-04-14 10:13:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"db368cd5-b4ea-4f77-8169-24ff5403199d\",\"trace_id\":\"0bd7332d-c4c1-44b6-b204-e68b8ec6217a\"}\n[2026-04-14 10:13:08] local.NOTICE: Monitoring start {\"correlation_id\":\"98628e85-9d56-4088-8ddb-5a33768305d6\",\"trace_id\":\"138288e6-6342-4250-9c1e-46921c407423\"}\n[2026-04-14 10:13:08] local.NOTICE: Monitoring end {\"correlation_id\":\"98628e85-9d56-4088-8ddb-5a33768305d6\",\"trace_id\":\"138288e6-6342-4250-9c1e-46921c407423\"}\n[2026-04-14 10:13:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"191fc76f-8aee-4891-810a-9844b5c123e4\",\"trace_id\":\"de876f70-8b00-416a-9ef4-dc20ca777b2b\"}\n[2026-04-14 10:13:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"191fc76f-8aee-4891-810a-9844b5c123e4\",\"trace_id\":\"de876f70-8b00-416a-9ef4-dc20ca777b2b\"}\n[2026-04-14 10:13:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3a813447-0014-4324-97a7-8822d7421613\",\"trace_id\":\"bf64c0c0-add2-496f-8abc-688f5b875ba3\"}\n[2026-04-14 10:13:13] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"3a813447-0014-4324-97a7-8822d7421613\",\"trace_id\":\"bf64c0c0-add2-496f-8abc-688f5b875ba3\"}\n[2026-04-14 10:13:13] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"3a813447-0014-4324-97a7-8822d7421613\",\"trace_id\":\"bf64c0c0-add2-496f-8abc-688f5b875ba3\"}\n[2026-04-14 10:13:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3a813447-0014-4324-97a7-8822d7421613\",\"trace_id\":\"bf64c0c0-add2-496f-8abc-688f5b875ba3\"}\n[2026-04-14 10:13:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"calendar:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"916686b7-6af9-48a2-95ef-2c9d7d13e032\",\"trace_id\":\"95ff9408-a142-42fc-b246-65098def557d\"}\n[2026-04-14 10:13:15] local.NOTICE: Calendar sync start {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"916686b7-6af9-48a2-95ef-2c9d7d13e032\",\"trace_id\":\"95ff9408-a142-42fc-b246-65098def557d\"}\n[2026-04-14 10:13:15] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1393,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:15] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1393,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:15] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:15] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1393,\"provider\":\"google\",\"refreshToken\":\"5aa7e2d96b53201cd16fca5d2e4ef3ad03320971fc064781d18aee3ae7b99fbf\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1393,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Account has been deleted\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1393,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1387,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1387,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1387,\"provider\":\"google\",\"refreshToken\":\"8157ac6de94842937194009e9c50e459253600f799dacf6a40755ffdbeb5bba6\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1387,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Account has been deleted\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1387,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1348,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1348,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1348,\"provider\":\"google\",\"refreshToken\":\"9e7d13d3032d0cb1b79d8e95aef01383e8e91eb52ff8ee960c8a0b6b95cd8c73\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1348,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1348,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1361,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1361,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1361,\"provider\":\"google\",\"refreshToken\":\"6c843da199c2b9907445329304fcc4ec5057a4ee748d8299641764395c08e1fd\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1361,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Account has been deleted\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1361,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1310,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1310,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1310,\"provider\":\"google\",\"refreshToken\":\"e34818922c2830a660813a63f6169a4a9a992ae2cccd7dc8dd7796cfdb470ef1\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1310,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1310,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1333,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1333,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1333,\"provider\":\"google\",\"refreshToken\":\"6c902986546d8e8da1dc539b046cdc1d458f519acc972e5b5f1d6a1a295165e0\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1333,\"provider\":\"google\",\"responseBody\":{\"error\":\"unauthorized_client\",\"error_description\":\"Unauthorized\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1333,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1368,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1368,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1368,\"provider\":\"google\",\"refreshToken\":\"d2f128898ff8543bd16b69cfae37896ab85119b0f5ed2b431d739593bb600333\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1368,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1368,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1365,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1365,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1365,\"provider\":\"google\",\"refreshToken\":\"7676e4a9afcd082b413248ab5ec6e487021fec6a9bdf315860a59cefad9caad8\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1365,\"provider\":\"google\",\"responseBody\":{\"error\":\"unauthorized_client\",\"error_description\":\"Unauthorized\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1365,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1364,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1364,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1364,\"provider\":\"google\",\"refreshToken\":\"dd5882ebce76e645292ce33ae74238abbb77c0a4ecc6a2bfe723cad82e72ba8e\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1364,\"provider\":\"google\",\"responseBody\":{\"error\":\"unauthorized_client\",\"error_description\":\"Unauthorized\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1364,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1370,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1370,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1370,\"provider\":\"office\",\"refreshToken\":\"b7ee8035306d0043cea6e00e7c4fe14f745e44074a1194db62a31cdf8b70af3e\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1370,\"provider\":\"office\",\"responseBody\":\"{\\\"error\\\":\\\"invalid_client\\\",\\\"error_description\\\":\\\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: a0c9f2b7-cb01-4abd-bacf-45d9e5680400 Correlation ID: 9a0f522e-1b07-4873-b073-d968cd65c74b Timestamp: 2026-04-14 10:13:18Z\\\",\\\"error_codes\\\":[7000215],\\\"timestamp\\\":\\\"2026-04-14 10:13:18Z\\\",\\\"trace_id\\\":\\\"a0c9f2b7-cb01-4abd-bacf-45d9e5680400\\\",\\\"correlation_id\\\":\\\"9a0f522e-1b07-4873-b073-d968cd65c74b\\\",\\\"error_uri\\\":\\\"https://login.microsoftonline.com/error?code=7000215\\\"}\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1370,\"provider\":\"office\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1202,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1202,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1202,\"provider\":\"office\",\"refreshToken\":\"b458799ccc29b21a6e2eb5260fdb63e49ccba21bf942a3973fb63799bd7f0afe\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1202,\"provider\":\"office\",\"responseBody\":\"{\\\"error\\\":\\\"invalid_client\\\",\\\"error_description\\\":\\\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 5fa1c342-7a85-4360-a1e3-44a1c6370000 Correlation ID: 10659d65-6337-4391-917e-475a77864114 Timestamp: 2026-04-14 10:13:18Z\\\",\\\"error_codes\\\":[7000215],\\\"timestamp\\\":\\\"2026-04-14 10:13:18Z\\\",\\\"trace_id\\\":\\\"5fa1c342-7a85-4360-a1e3-44a1c6370000\\\",\\\"correlation_id\\\":\\\"10659d65-6337-4391-917e-475a77864114\\\",\\\"error_uri\\\":\\\"https://login.microsoftonline.com/error?code=7000215\\\"}\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1202,\"provider\":\"office\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1413,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1413,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1413,\"provider\":\"google\",\"refreshToken\":\"6a7e45d818a56cd2bd3910c52eaa9acd00553369b353f8b7527fa82d3e319ce5\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1413,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1413,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1300,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1300,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1300,\"provider\":\"google\",\"refreshToken\":\"4b811db0725fd9602a95943519a7da935e2a5065da7d9ebfcb170752e3e1ddb8\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1300,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Account has been deleted\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1300,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1409,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1409,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1409,\"provider\":\"google\",\"refreshToken\":\"e2a3f2d06894894eed1ee87d9db1ace77d4d42ee6e1288a8940ad2c10333b0c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1409,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1409,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1352,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1352,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1352,\"provider\":\"google\",\"refreshToken\":\"dd4b16b00fdc1216da6b717c02338c073636e29162826b2de6db3f064fc029eb\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1352,\"provider\":\"google\",\"responseBody\":{\"error\":\"unauthorized_client\",\"error_description\":\"Unauthorized\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1352,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1296,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1296,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1296,\"provider\":\"office\",\"refreshToken\":\"011ae723c9d800c674e0b4be76f49fc046dac7d501b66c59ef0d9549cfa56ae5\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1296,\"provider\":\"office\",\"responseBody\":\"{\\\"error\\\":\\\"invalid_client\\\",\\\"error_description\\\":\\\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 18225c04-d579-4feb-87cc-c77995f60000 Correlation ID: 561c3e60-8cb1-4ded-a828-9d9910fc2906 Timestamp: 2026-04-14 10:13:20Z\\\",\\\"error_codes\\\":[7000215],\\\"timestamp\\\":\\\"2026-04-14 10:13:20Z\\\",\\\"trace_id\\\":\\\"18225c04-d579-4feb-87cc-c77995f60000\\\",\\\"correlation_id\\\":\\\"561c3e60-8cb1-4ded-a828-9d9910fc2906\\\",\\\"error_uri\\\":\\\"https://login.microsoftonline.com/error?code=7000215\\\"}\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1296,\"provider\":\"office\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":391,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":391,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":391,\"provider\":\"office\",\"refreshToken\":\"00045eebae0f39b34887c6d53f92ae78064f7145e1f4b67754aebd03cfb2d881\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":391,\"provider\":\"office\",\"responseBody\":\"{\\\"error\\\":\\\"invalid_client\\\",\\\"error_description\\\":\\\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: ad87e582-d425-4a80-a031-e4e93c450d00 Correlation ID: 0f0dc5e5-577a-488b-8b3c-aa0496be85ed Timestamp: 2026-04-14 10:13:21Z\\\",\\\"error_codes\\\":[7000215],\\\"timestamp\\\":\\\"2026-04-14 10:13:21Z\\\",\\\"trace_id\\\":\\\"ad87e582-d425-4a80-a031-e4e93c450d00\\\",\\\"correlation_id\\\":\\\"0f0dc5e5-577a-488b-8b3c-aa0496be85ed\\\",\\\"error_uri\\\":\\\"https://login.microsoftonline.com/error?code=7000215\\\"}\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":391,\"provider\":\"office\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1271,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1271,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1271,\"provider\":\"office\",\"refreshToken\":\"118cde2c06993147b07ccaec4cbcd5026a819dea6c71081166a492933e392afb\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1271,\"provider\":\"office\",\"responseBody\":\"{\\\"error\\\":\\\"invalid_client\\\",\\\"error_description\\\":\\\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 6a87850e-2a13-4112-bde4-d6cab8f36000 Correlation ID: d3c34a80-e297-4c8f-a878-98e7c645b200 Timestamp: 2026-04-14 10:13:21Z\\\",\\\"error_codes\\\":[7000215],\\\"timestamp\\\":\\\"2026-04-14 10:13:21Z\\\",\\\"trace_id\\\":\\\"6a87850e-2a13-4112-bde4-d6cab8f36000\\\",\\\"correlation_id\\\":\\\"d3c34a80-e297-4c8f-a878-98e7c645b200\\\",\\\"error_uri\\\":\\\"https://login.microsoftonline.com/error?code=7000215\\\"}\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1271,\"provider\":\"office\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1351,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1351,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1351,\"provider\":\"google\",\"refreshToken\":\"4271d15b9e60a606439caddc68337f783e472c85b03dacff14d1b6dfded9051c\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1351,\"provider\":\"google\",\"responseBody\":{\"error\":\"unauthorized_client\",\"error_description\":\"Unauthorized\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1351,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1366,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1366,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1366,\"provider\":\"google\",\"refreshToken\":\"ae21385059b2eebfd43f68aecd56eccd702a1aabb6598f1f7ab594ed8af491b4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1366,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1366,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1115,\"provider\":\"google\",\"refreshToken\":\"356b60f12e262a5e24d3042386ef47d6a6cfe3074c242f4426edcec8646192b1\",\"state\":\"connected\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountObserver] Access token was modified, encrypting {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Token refreshed {\"socialAccountId\":1115,\"provider\":\"google\",\"state\":\"connected\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: Calendar sync job dispatched {\"calendar_id\":378} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1421,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1421,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: Calendar sync job dispatched {\"calendar_id\":504} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.NOTICE: Calendar sync end {\"retrieved_calendars\":31,\"processed_calendars\":2} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"calendar:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [Calendar] Processing sync {\"calendarId\":\"2676cb6d-f86c-427e-bf78-591e388e3c1e\",\"from\":null,\"to\":null,\"delta\":\"CJ_x49O3jpIDEJ_x49O3jpIDGAUgw67KlwMow67KlwM=\",\"last_sync\":\"2026-01-19 07:48:40\",\"dateMode\":\"daily\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.WARNING: [Pipedrive] Account not connected for user {\"userId\":\"e6538737-e7b4-455f-a37a-3e79b665a220\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1116,\"sociable_id\":241,\"provider_user_id\":\"19555731\",\"expires\":1775683749,\"refresh_token_expires\":null,\"provider\":\"pipedrive\",\"state\":\"full-refresh\",\"auth_scope\":\"base,deals:full,activities:full,contacts:full,search:read\",\"retry_after\":null,\"created_at\":\"2023-09-08 09:44:29\",\"updated_at\":\"2026-04-08 22:58:34\"}}} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"pipedrive\",\"crm_owner\":241,\"team_id\":19} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":19} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":19} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.WARNING: [Calendar] CRM disconnected for user so events will not be matched {\"provider\":\"pipedrive\",\"user_id\":241,\"message\":\"Your Pipedrive account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [Google Calendar] Failed to watch channel for calendar {\"calendarId\":\"2676cb6d-f86c-427e-bf78-591e388e3c1e\",\"code\":400,\"reason\":\"{\n \\\"error\\\": {\n \\\"errors\\\": [\n {\n \\\"domain\\\": \\\"global\\\",\n \\\"reason\\\": \\\"push.webhookUrlNotHttps\\\",\n \\\"message\\\": \\\"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\\\"\n }\n ],\n \\\"code\\\": 400,\n \\\"message\\\": \\\"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\\\"\n }\n}\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.WARNING: [Calendar] Sync failed {\"calendarId\":\"2676cb6d-f86c-427e-bf78-591e388e3c1e\",\"code\":400,\"reason\":\"{\n \\\"error\\\": {\n \\\"errors\\\": [\n {\n \\\"domain\\\": \\\"global\\\",\n \\\"reason\\\": \\\"push.webhookUrlNotHttps\\\",\n \\\"message\\\": \\\"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\\\"\n }\n ],\n \\\"code\\\": 400,\n \\\"message\\\": \\\"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\\\"\n }\n}\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1421,\"provider\":\"office\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1421,\"provider\":\"office\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [Calendar] Processing sync {\"calendarId\":\"9e8b1a2c-1a8f-42bd-b161-810fc0baf540\",\"from\":null,\"to\":null,\"delta\":\"R0usmcdvmMuZCBYV0hguCMHsFO7eXNtxttzHbAJYhgEjS-R5DVVf-Qpiu1x1abSCjPi_6GyNNQkAr6QzlfYX5QQIViPlr6xQ6kMLGlYI2NcZng5dyOiPW7mVfNOMIyZjDQYC7N0dvAv975y9HBR7trnsCgpcjUtywYMZi-MeDGx3IKjUasrhRSTPdU9Udf7hbiTNTjFz4g-6cLtts5V1gQ.XmNrgOrsWLt3kS8T-h2qY30RyIR1RkKRDu2s9zO7qbM\",\"last_sync\":\"2026-04-14 07:13:35\",\"dateMode\":\"daily\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1499,\"provider\":\"hubspot\",\"refreshToken\":\"96f94c623a404e02ebdbf07f1b75707bb6cdbf848cbf45d418baf608c41a8d86\",\"state\":\"connected\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountObserver] Access token was modified, encrypting {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:24] local.INFO: [SocialAccountService] Token refreshed {\"socialAccountId\":1499,\"provider\":\"hubspot\",\"state\":\"connected\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:24] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {\"crm_provider\":\"hubspot\",\"crm_owner\":89,\"team_id\":2} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:24] local.INFO: [MS Office Calendar] Skipping delta sync for daily mode {\"calendarId\":\"9e8b1a2c-1a8f-42bd-b161-810fc0baf540\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:14:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"23ff3b18-7bba-4873-959b-5c3532813e26\",\"trace_id\":\"d6d3dcad-e5d1-4163-ab65-73a98767c1aa\"}\n[2026-04-14 10:14:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"23ff3b18-7bba-4873-959b-5c3532813e26\",\"trace_id\":\"d6d3dcad-e5d1-4163-ab65-73a98767c1aa\"}\n[2026-04-14 10:14:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"23ff3b18-7bba-4873-959b-5c3532813e26\",\"trace_id\":\"d6d3dcad-e5d1-4163-ab65-73a98767c1aa\"}\n[2026-04-14 10:14:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"f5505af8-fb38-405b-9c1b-de850a180c73\",\"trace_id\":\"b835b97b-0484-4c9e-b4ca-612d4f405f44\"}\n[2026-04-14 10:14:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"f5505af8-fb38-405b-9c1b-de850a180c73\",\"trace_id\":\"b835b97b-0484-4c9e-b4ca-612d4f405f44\"}\n[2026-04-14 10:14:09] local.NOTICE: Monitoring start {\"correlation_id\":\"ed4451ac-578d-4eff-a8d8-cc1fb5399c66\",\"trace_id\":\"8158b54f-1007-4fcc-a65f-548b82d202fc\"}\n[2026-04-14 10:14:09] local.NOTICE: Monitoring end {\"correlation_id\":\"ed4451ac-578d-4eff-a8d8-cc1fb5399c66\",\"trace_id\":\"8158b54f-1007-4fcc-a65f-548b82d202fc\"}\n[2026-04-14 10:14:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"5babadac-2755-4261-be70-29870ac2944f\",\"trace_id\":\"a701097c-9a8a-4b93-b4e9-de5a5fb34120\"}\n[2026-04-14 10:14:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"5babadac-2755-4261-be70-29870ac2944f\",\"trace_id\":\"a701097c-9a8a-4b93-b4e9-de5a5fb34120\"}\n[2026-04-14 10:14:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"81f604c5-13fc-485a-86ad-627a69a74529\",\"trace_id\":\"213caa28-79e7-4b24-94a4-f8b06c656dbd\"}\n[2026-04-14 10:14:13] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"81f604c5-13fc-485a-86ad-627a69a74529\",\"trace_id\":\"213caa28-79e7-4b24-94a4-f8b06c656dbd\"}\n[2026-04-14 10:14:13] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"81f604c5-13fc-485a-86ad-627a69a74529\",\"trace_id\":\"213caa28-79e7-4b24-94a4-f8b06c656dbd\"}\n[2026-04-14 10:14:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"81f604c5-13fc-485a-86ad-627a69a74529\",\"trace_id\":\"213caa28-79e7-4b24-94a4-f8b06c656dbd\"}\n[2026-04-14 10:14:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2151c2f9-66a9-4a4b-9b6e-724c4d607ef3\",\"trace_id\":\"38ddbbde-549d-477e-a4b7-08d53c6f48c8\"}\n[2026-04-14 10:14:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:12:00, 2026-04-14 10:14:00] {\"correlation_id\":\"2151c2f9-66a9-4a4b-9b6e-724c4d607ef3\",\"trace_id\":\"38ddbbde-549d-477e-a4b7-08d53c6f48c8\"}\n[2026-04-14 10:14:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:12:00, 2026-04-14 10:14:00] {\"correlation_id\":\"2151c2f9-66a9-4a4b-9b6e-724c4d607ef3\",\"trace_id\":\"38ddbbde-549d-477e-a4b7-08d53c6f48c8\"}\n[2026-04-14 10:14:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2151c2f9-66a9-4a4b-9b6e-724c4d607ef3\",\"trace_id\":\"38ddbbde-549d-477e-a4b7-08d53c6f48c8\"}\n[2026-04-14 10:14:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:sync-objects\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"27e589e1-40a2-405b-9a73-11b15079a387\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:16] local.ERROR: Call to a member function getAttribute() on null {\"exception\":\"[object] (Error(code: 0): Call to a member function getAttribute() on null at /home/jiminny/app/Console/Commands/Crm/SyncObjects.php:42)\n[stacktrace]\n#0 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Jiminny\\\\Console\\\\Commands\\\\Crm\\\\SyncObjects->handle()\n#1 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\\\Container\\\\BoundMethod::Illuminate\\\\Container\\\\{closure}()\n#2 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\\\\Container\\\\Util::unwrapIfClosure(Object(Closure))\n#3 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\\\Container\\\\BoundMethod::callBoundMethod(Object(Illuminate\\\\Foundation\\\\Application), Array, Object(Closure))\n#4 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Illuminate\\\\Container\\\\BoundMethod::call(Object(Illuminate\\\\Foundation\\\\Application), Array, Array, NULL)\n#5 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\\\Container\\\\Container->call(Array)\n#6 /home/jiminny/vendor/symfony/console/Command/Command.php(341): Illuminate\\\\Console\\\\Command->execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Illuminate\\\\Console\\\\OutputStyle))\n#7 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\\\Component\\\\Console\\\\Command\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Illuminate\\\\Console\\\\OutputStyle))\n#8 /home/jiminny/app/Console/Commands/Command.php(41): Illuminate\\\\Console\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#9 /home/jiminny/vendor/symfony/console/Application.php(1117): Jiminny\\\\Console\\\\Commands\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#10 /home/jiminny/vendor/symfony/console/Application.php(356): Symfony\\\\Component\\\\Console\\\\Application->doRunCommand(Object(Jiminny\\\\Console\\\\Commands\\\\Crm\\\\SyncObjects), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#11 /home/jiminny/vendor/symfony/console/Application.php(195): Symfony\\\\Component\\\\Console\\\\Application->doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#12 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\\\\Component\\\\Console\\\\Application->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#13 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\\\\Foundation\\\\Console\\\\Kernel->handle(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#14 /home/jiminny/artisan(13): Illuminate\\\\Foundation\\\\Application->handleCommand(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput))\n#15 {main}\n\"} {\"correlation_id\":\"27e589e1-40a2-405b-9a73-11b15079a387\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:16] local.ERROR: Scheduled command ['/usr/local/bin/php' 'artisan' crm:sync-objects] failed with exit code [1]. {\"exception\":\"[object] (Exception(code: 0): Scheduled command ['/usr/local/bin/php' 'artisan' crm:sync-objects] failed with exit code [1]. at /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207)\n[stacktrace]\n#0 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(41): Illuminate\\\\Console\\\\Scheduling\\\\ScheduleRunCommand->Illuminate\\\\Console\\\\Scheduling\\\\{closure}()\n#1 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php(59): Illuminate\\\\Console\\\\View\\\\Components\\\\Task->render('<fg=gray>2026-0...', Object(Closure))\n#2 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(191): Illuminate\\\\Console\\\\View\\\\Components\\\\Factory->__call('task', Array)\n#3 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(162): Illuminate\\\\Console\\\\Scheduling\\\\ScheduleRunCommand->runEvent(Object(Illuminate\\\\Console\\\\Scheduling\\\\Event))\n#4 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(132): Illuminate\\\\Console\\\\Scheduling\\\\ScheduleRunCommand->runSingleServerEvent(Object(Illuminate\\\\Console\\\\Scheduling\\\\Event))\n#5 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\\\Console\\\\Scheduling\\\\ScheduleRunCommand->handle(Object(Illuminate\\\\Console\\\\Scheduling\\\\Schedule), Object(Illuminate\\\\Events\\\\Dispatcher), Object(Illuminate\\\\Cache\\\\Repository), Object(NunoMaduro\\\\Collision\\\\Adapters\\\\Laravel\\\\ExceptionHandler))\n#6 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\\\Container\\\\BoundMethod::Illuminate\\\\Container\\\\{closure}()\n#7 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\\\\Container\\\\Util::unwrapIfClosure(Object(Closure))\n#8 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\\\Container\\\\BoundMethod::callBoundMethod(Object(Illuminate\\\\Foundation\\\\Application), Array, Object(Closure))\n#9 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Illuminate\\\\Container\\\\BoundMethod::call(Object(Illuminate\\\\Foundation\\\\Application), Array, Array, NULL)\n#10 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\\\Container\\\\Container->call(Array)\n#11 /home/jiminny/vendor/symfony/console/Command/Command.php(341): Illuminate\\\\Console\\\\Command->execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Illuminate\\\\Console\\\\OutputStyle))\n#12 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\\\Component\\\\Console\\\\Command\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Illuminate\\\\Console\\\\OutputStyle))\n#13 /home/jiminny/vendor/symfony/console/Application.php(1117): Illuminate\\\\Console\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#14 /home/jiminny/vendor/symfony/console/Application.php(356): Symfony\\\\Component\\\\Console\\\\Application->doRunCommand(Object(Illuminate\\\\Console\\\\Scheduling\\\\ScheduleRunCommand), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#15 /home/jiminny/vendor/symfony/console/Application.php(195): Symfony\\\\Component\\\\Console\\\\Application->doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#16 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\\\\Component\\\\Console\\\\Application->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#17 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\\\\Foundation\\\\Console\\\\Kernel->handle(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#18 /home/jiminny/artisan(13): Illuminate\\\\Foundation\\\\Application->handleCommand(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput))\n#19 {main}\n\"} {\"correlation_id\":\"7e825220-4803-460c-b32f-205701428575\",\"trace_id\":\"d4471232-e49d-4ed6-9fa9-7ce5ef181ad6\"}\n[2026-04-14 10:14:17] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"6473c918-d8db-4ded-a52b-4febfd7b7c02\",\"usage\":25081832,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [Salesforce] Account not connected for user {\"userId\":\"641f1acb-16b8-42d1-8726-df52979dad0e\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1500,\"sociable_id\":143,\"provider_user_id\":\"0052g000003frelAAA\",\"expires\":null,\"refresh_token_expires\":null,\"provider\":\"salesforce\",\"state\":\"full-refresh\",\"auth_scope\":\"refresh_token web api\",\"retry_after\":null,\"created_at\":\"2026-02-06 08:39:03\",\"updated_at\":\"2026-04-14 07:30:27\"}}} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"salesforce\",\"crm_owner\":143,\"team_id\":1} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"6473c918-d8db-4ded-a52b-4febfd7b7c02\",\"reason\":\"Your Salesforce account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"abae74b8-bfa8-4383-9a7f-89f4bf2bdbb4\",\"usage\":25121320,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {\"crm_provider\":\"hubspot\",\"crm_owner\":148,\"team_id\":2} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [HubSpot] Syncing opportunities using strategy: lastModified {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [Hubspot] Pagination completed {\"team_id\":2,\"endpoint\":\"https://api.hubapi.com/crm/v3/objects/deals/search\",\"total_requests\":1,\"total_records_fetched\":0,\"total_elapsed_seconds\":0.55,\"average_seconds_per_request\":0.55} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [HubSpot] Synced opportunities {\"team\":2,\"sync_count\":0,\"total\":0,\"last_synced_id\":null} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [SyncObjects] After memory usage: {\"team\":\"abae74b8-bfa8-4383-9a7f-89f4bf2bdbb4\",\"usage\":25243264,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"51467630-d89d-480b-be20-933e64a042f7\",\"usage\":25221224,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [Pipedrive] Account not connected for user {\"userId\":\"e6538737-e7b4-455f-a37a-3e79b665a220\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1116,\"sociable_id\":241,\"provider_user_id\":\"19555731\",\"expires\":1775683749,\"refresh_token_expires\":null,\"provider\":\"pipedrive\",\"state\":\"full-refresh\",\"auth_scope\":\"base,deals:full,activities:full,contacts:full,search:read\",\"retry_after\":null,\"created_at\":\"2023-09-08 09:44:29\",\"updated_at\":\"2026-04-08 22:58:34\"}}} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"pipedrive\",\"crm_owner\":241,\"team_id\":19} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":19} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":19} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"51467630-d89d-480b-be20-933e64a042f7\",\"reason\":\"Your Pipedrive account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:18] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"396ed57c-e3c4-49be-8290-37c32955f7c7\",\"usage\":25187072,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"18dafbf8-372a-4c4e-91a2-6150b517f8d9\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:18] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"18dafbf8-372a-4c4e-91a2-6150b517f8d9\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:18] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {\"crm_provider\":\"copper\",\"crm_owner\":333,\"team_id\":27} {\"correlation_id\":\"18dafbf8-372a-4c4e-91a2-6150b517f8d9\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:18] local.NOTICE: Leads unavailable {\"method\":\"POST\",\"endpoint\":\"leads/search\",\"options\":[],\"body\":{\"minimum_modified_date\":1776159855,\"sort_by\":\"date_modified\",\"page_number\":1},\"status_code\":403,\"error\":\"{\\\"success\\\":false,\\\"status\\\":403,\\\"message\\\":\\\"Feature not enabled\\\"}\"} {\"correlation_id\":\"18dafbf8-372a-4c4e-91a2-6150b517f8d9\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SyncObjects] After memory usage: {\"team\":\"396ed57c-e3c4-49be-8290-37c32955f7c7\",\"usage\":25160664,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"18dafbf8-372a-4c4e-91a2-6150b517f8d9\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"fda3cbdf-1117-4ba5-86f8-775f548b3a28\",\"usage\":25198328,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [Pipedrive] Account not connected for user {\"userId\":\"e6538737-e7b4-455f-a37a-3e79b665a220\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1116,\"sociable_id\":241,\"provider_user_id\":\"19555731\",\"expires\":1775683749,\"refresh_token_expires\":null,\"provider\":\"pipedrive\",\"state\":\"full-refresh\",\"auth_scope\":\"base,deals:full,activities:full,contacts:full,search:read\",\"retry_after\":null,\"created_at\":\"2023-09-08 09:44:29\",\"updated_at\":\"2026-04-08 22:58:34\"}}} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"pipedrive\",\"crm_owner\":241,\"team_id\":28} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":28} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":28} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"fda3cbdf-1117-4ba5-86f8-775f548b3a28\",\"reason\":\"Your Pipedrive account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"b2b115eb-93ce-4d1b-929c-173757df8fba\",\"usage\":25201312,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [HubSpot] Account not connected for user {\"userId\":\"33e34a7a-1c02-4f04-87ac-22c3a385e6e3\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":306,\"sociable_id\":109,\"provider_user_id\":\"11348452\",\"expires\":1701077403,\"refresh_token_expires\":null,\"provider\":\"hubspot\",\"state\":\"full-refresh\",\"auth_scope\":null,\"retry_after\":null,\"created_at\":\"2020-09-01 16:59:04\",\"updated_at\":\"2023-11-27 09:30:03\"}}} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"hubspot\",\"crm_owner\":109,\"team_id\":29} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":29} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":29} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"b2b115eb-93ce-4d1b-929c-173757df8fba\",\"reason\":\"Your HubSpot account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"3ff5a02a-86fb-4357-b1d6-a04e26c38602\",\"usage\":25172888,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1219,\"provider\":\"close\"} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1219,\"provider\":\"close\"} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {\"crm_provider\":\"close\",\"crm_owner\":257,\"team_id\":31} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [SyncObjects] After memory usage: {\"team\":\"3ff5a02a-86fb-4357-b1d6-a04e26c38602\",\"usage\":25194400,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"1640a0ac-19da-4c3b-90f7-87525f07a6d2\",\"usage\":25172928,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [Bullhorn] Account not connected for user {\"userId\":\"941d12a6-e84f-4c3a-a4c8-2ef433792095\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":348,\"sociable_id\":121,\"provider_user_id\":null,\"expires\":1733727508,\"refresh_token_expires\":null,\"provider\":\"bullhorn\",\"state\":\"full-refresh\",\"auth_scope\":null,\"retry_after\":null,\"created_at\":\"2021-04-06 11:07:26\",\"updated_at\":\"2024-12-09 15:10:40\"}}} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"bullhorn\",\"crm_owner\":121,\"team_id\":36} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"bullhorn\",\"team_id\":36} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"bullhorn\",\"team_id\":36} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"1640a0ac-19da-4c3b-90f7-87525f07a6d2\",\"reason\":\"Your Bullhorn account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"b2d49a54-b645-4637-a7ae-a86cfce6e8e4\",\"usage\":25132824,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [HubSpot] Account not connected for user {\"userId\":\"2ac0447f-3c8c-4ce0-baeb-b63ddb76fa9b\",\"account\":null} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"hubspot\",\"crm_owner\":130,\"team_id\":42} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":42} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":42} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"b2d49a54-b645-4637-a7ae-a86cfce6e8e4\",\"reason\":\"Social account for HubSpot cannot be found. Please login to Jiminny to connect.\"} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"c6b9d6b0-b48d-4832-a68c-a57d60651888\",\"usage\":25129088,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [HubSpot] Account not connected for user {\"userId\":\"71e3aac5-fb66-47c5-a236-2d051ae3e319\",\"account\":null} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"hubspot\",\"crm_owner\":256,\"team_id\":49} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":49} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":49} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"c6b9d6b0-b48d-4832-a68c-a57d60651888\",\"reason\":\"Social account for HubSpot cannot be found. Please login to Jiminny to connect.\"} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"0c33bf2d-1c77-4200-8ed6-6147ad444c30\",\"usage\":25156328,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [Salesforce] Account not connected for user {\"userId\":\"ed89227b-e364-4dfb-b4bf-343f154bf21e\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1360,\"sociable_id\":245,\"provider_user_id\":\"0052g000003frZNAAY\",\"expires\":null,\"refresh_token_expires\":null,\"provider\":\"salesforce\",\"state\":\"full-refresh\",\"auth_scope\":\"refresh_token web api\",\"retry_after\":null,\"created_at\":\"2024-09-02 06:11:55\",\"updated_at\":\"2024-12-11 08:50:23\"}}} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"salesforce\",\"crm_owner\":245,\"team_id\":59} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":59} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":59} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"0c33bf2d-1c77-4200-8ed6-6147ad444c30\",\"reason\":\"Your Salesforce account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:15:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b19787b8-89e4-4174-ac22-b53fa1965abc\",\"trace_id\":\"dc14a5bc-9648-469d-b68d-b2bff1651ecb\"}\n[2026-04-14 10:15:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"b19787b8-89e4-4174-ac22-b53fa1965abc\",\"trace_id\":\"dc14a5bc-9648-469d-b68d-b2bff1651ecb\"}\n[2026-04-14 10:15:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b19787b8-89e4-4174-ac22-b53fa1965abc\",\"trace_id\":\"dc14a5bc-9648-469d-b68d-b2bff1651ecb\"}\n[2026-04-14 10:15:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a333f21b-ae53-4915-b93a-596f1f2c926f\",\"trace_id\":\"3abd63e6-e174-458e-8400-f9c99f5742eb\"}\n[2026-04-14 10:15:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a333f21b-ae53-4915-b93a-596f1f2c926f\",\"trace_id\":\"3abd63e6-e174-458e-8400-f9c99f5742eb\"}\n[2026-04-14 10:15:08] local.NOTICE: Monitoring start {\"correlation_id\":\"0f075891-bb6c-4641-87a4-3994c5a043df\",\"trace_id\":\"ec5d699a-57af-41bc-bfb7-69e8d51dd17d\"}\n[2026-04-14 10:15:08] local.NOTICE: Monitoring end {\"correlation_id\":\"0f075891-bb6c-4641-87a4-3994c5a043df\",\"trace_id\":\"ec5d699a-57af-41bc-bfb7-69e8d51dd17d\"}\n[2026-04-14 10:15:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a616bfd0-6015-449d-8884-91dab87399b4\",\"trace_id\":\"b75643dc-0cbf-4c5b-8532-8fe5dbceaa3d\"}\n[2026-04-14 10:15:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a616bfd0-6015-449d-8884-91dab87399b4\",\"trace_id\":\"b75643dc-0cbf-4c5b-8532-8fe5dbceaa3d\"}\n[2026-04-14 10:15:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"32ced909-720e-4e0e-ae5a-477b57c0dec7\",\"trace_id\":\"2e6abd1f-94ba-4952-ba0d-d1de924f1663\"}\n[2026-04-14 10:15:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"32ced909-720e-4e0e-ae5a-477b57c0dec7\",\"trace_id\":\"2e6abd1f-94ba-4952-ba0d-d1de924f1663\"}\n[2026-04-14 10:15:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"32ced909-720e-4e0e-ae5a-477b57c0dec7\",\"trace_id\":\"2e6abd1f-94ba-4952-ba0d-d1de924f1663\"}\n[2026-04-14 10:15:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"32ced909-720e-4e0e-ae5a-477b57c0dec7\",\"trace_id\":\"2e6abd1f-94ba-4952-ba0d-d1de924f1663\"}\n[2026-04-14 10:15:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"96ed84f0-73cf-4aa3-9e6a-2793ccb7de49\",\"trace_id\":\"5d779593-3208-4ee5-b6b0-4b2b3bbf8408\"}\n[2026-04-14 10:15:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"96ed84f0-73cf-4aa3-9e6a-2793ccb7de49\",\"trace_id\":\"5d779593-3208-4ee5-b6b0-4b2b3bbf8408\"}\n[2026-04-14 10:15:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e39bb7cc-dc21-4cc6-b357-35563a63bff3\",\"trace_id\":\"3832e8c1-00ea-4493-a05b-c380bde7eef5\"}\n[2026-04-14 10:15:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e39bb7cc-dc21-4cc6-b357-35563a63bff3\",\"trace_id\":\"3832e8c1-00ea-4493-a05b-c380bde7eef5\"}\n[2026-04-14 10:15:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"931d521d-a375-4d69-b364-442247092f72\",\"trace_id\":\"a641da20-da66-4ff5-bf13-0da516259f3d\"}\n[2026-04-14 10:15:18] local.INFO: Running pre-meeting notification command {\"correlation_id\":\"931d521d-a375-4d69-b364-442247092f72\",\"trace_id\":\"a641da20-da66-4ff5-bf13-0da516259f3d\"}\n[2026-04-14 10:15:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"931d521d-a375-4d69-b364-442247092f72\",\"trace_id\":\"a641da20-da66-4ff5-bf13-0da516259f3d\"}\n[2026-04-14 10:15:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"74b81e6e-9b30-47c5-9ca2-3d986e2ed849\",\"trace_id\":\"71067e6a-a87b-4178-b96b-56c0f3eb11a9\"}\n[2026-04-14 10:15:21] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 10:05:00, 2026-04-14 10:10:00] {\"correlation_id\":\"74b81e6e-9b30-47c5-9ca2-3d986e2ed849\",\"trace_id\":\"71067e6a-a87b-4178-b96b-56c0f3eb11a9\"}\n[2026-04-14 10:15:21] local.INFO: [conference:monitor:start] No activities found in (2026-04-14 10:05:00, 2026-04-14 10:10:00] {\"correlation_id\":\"74b81e6e-9b30-47c5-9ca2-3d986e2ed849\",\"trace_id\":\"71067e6a-a87b-4178-b96b-56c0f3eb11a9\"}\n[2026-04-14 10:15:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"74b81e6e-9b30-47c5-9ca2-3d986e2ed849\",\"trace_id\":\"71067e6a-a87b-4178-b96b-56c0f3eb11a9\"}\n[2026-04-14 10:15:24] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e53334dc-6e3c-43dd-9475-0dede7bf0456\",\"trace_id\":\"4a038f09-2fdb-4f91-b0d8-da295cf1db09\"}\n[2026-04-14 10:15:24] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesEnded {\"from\":\"10:10\",\"to\":\"10:15\"} {\"correlation_id\":\"e53334dc-6e3c-43dd-9475-0dede7bf0456\",\"trace_id\":\"4a038f09-2fdb-4f91-b0d8-da295cf1db09\"}\n[2026-04-14 10:15:24] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {\"from\":\"00:05\",\"to\":\"00:10\"} {\"correlation_id\":\"e53334dc-6e3c-43dd-9475-0dede7bf0456\",\"trace_id\":\"4a038f09-2fdb-4f91-b0d8-da295cf1db09\"}\n[2026-04-14 10:15:24] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e53334dc-6e3c-43dd-9475-0dede7bf0456\",\"trace_id\":\"4a038f09-2fdb-4f91-b0d8-da295cf1db09\"}\n[2026-04-14 10:15:25] local.NOTICE: Repairing HubSpot tokens start {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:25] local.INFO: Trying to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:25] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:25] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":59,\"provider\":\"hubspot\",\"refreshToken\":\"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":306,\"provider\":\"hubspot\",\"refreshToken\":\"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1372,\"provider\":\"hubspot\",\"refreshToken\":\"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.NOTICE: Repairing HubSpot tokens end {\"total\":3,\"fixed\":0,\"failed\":3} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"89e8fd3c-557e-4b5f-badd-8954b2f66bb8\",\"trace_id\":\"f2421ea8-4c6d-4180-aa46-7027d7fa4f3f\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Command] Starting polling service {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Polling] Service starting {\"memory_limit\":\"256M\",\"max_execution_time\":\"0\",\"initial_memory_mb\":62.0} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Polling] Acquired polling lock {\"expires_at\":\"2026-04-14T10:17:30.794235Z\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Auth] Requesting new client credentials token {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"89e8fd3c-557e-4b5f-badd-8954b2f66bb8\",\"trace_id\":\"f2421ea8-4c6d-4180-aa46-7027d7fa4f3f\"}\n[2026-04-14 10:15:31] local.INFO: [HubSpot Journal Auth] Successfully obtained new access token {\"expires_in\":1800,\"cached_for\":1500} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:31] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:32] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810039,\"provider\":\"twilio-flex\",\"team\":\"jiminny\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810040,\"provider\":\"xant\",\"team\":\"jiminny\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810041,\"provider\":\"apollo\",\"team\":\"jiminny\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810042,\"provider\":\"groove\",\"team\":\"jiminny\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810043,\"provider\":\"twilio-video\",\"team\":\"jiminny\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810044,\"provider\":\"hubspot\",\"team\":\"hubspot\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.WARNING: [Salesforce] Account not connected for user {\"userId\":\"cdf8b554-d951-4758-bc2b-c1b85d1cd0b9\",\"account\":null} {\"correlation_id\":\"9b4a64ea-7083-4242-92fc-e22a39f3ccae\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"salesforce\",\"crm_owner\":3,\"team_id\":1} {\"correlation_id\":\"9b4a64ea-7083-4242-92fc-e22a39f3ccae\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"9b4a64ea-7083-4242-92fc-e22a39f3ccae\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"9b4a64ea-7083-4242-92fc-e22a39f3ccae\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.ALERT: [SyncActivity] Failed {\"import_id\":810039,\"provider\":\"twilio-flex\",\"provider_id\":317,\"team\":\"jiminny\",\"team_id\":1,\"reason\":\"Social account for Salesforce cannot be found. Please login to Jiminny to connect.\",\"file\":\"/home/jiminny/app/Services/Crm/BaseService.php\",\"line\":697} {\"correlation_id\":\"9b4a64ea-7083-4242-92fc-e22a39f3ccae\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"76f54fe3-c385-490f-adb7-97d3b8b6af8e\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"76f54fe3-c385-490f-adb7-97d3b8b6af8e\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"76f54fe3-c385-490f-adb7-97d3b8b6af8e\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.ALERT: [SyncActivity] Failed {\"import_id\":810040,\"provider\":\"xant\",\"provider_id\":161,\"team\":\"jiminny\",\"team_id\":1,\"reason\":\"Activity Provider account not connected.\",\"file\":\"/home/jiminny/app/Services/Activity/ActivityProviderService.php\",\"line\":174} {\"correlation_id\":\"76f54fe3-c385-490f-adb7-97d3b8b6af8e\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"8ab1362f-6630-42b0-a062-3c13b74aa200\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"8ab1362f-6630-42b0-a062-3c13b74aa200\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"8ab1362f-6630-42b0-a062-3c13b74aa200\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"cf1d258f-25eb-4dd9-96a7-bd33c25b2132\",\"trace_id\":\"f827347d-5c75-40d9-b343-210ac4e6f3be\"}\n[2026-04-14 10:15:35] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"cf1d258f-25eb-4dd9-96a7-bd33c25b2132\",\"trace_id\":\"f827347d-5c75-40d9-b343-210ac4e6f3be\"}\n[2026-04-14 10:15:35] local.ALERT: [SyncActivity] Failed {\"import_id\":810041,\"provider\":\"apollo\",\"provider_id\":441,\"team\":\"jiminny\",\"team_id\":1,\"reason\":\"Activity Provider account not connected.\",\"file\":\"/home/jiminny/app/Services/Activity/ActivityProviderService.php\",\"line\":174} {\"correlation_id\":\"8ab1362f-6630-42b0-a062-3c13b74aa200\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"747e064b-723f-4612-b61e-e4f6581ba972\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"747e064b-723f-4612-b61e-e4f6581ba972\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"747e064b-723f-4612-b61e-e4f6581ba972\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.ALERT: [SyncActivity] Failed {\"import_id\":810042,\"provider\":\"groove\",\"provider_id\":228,\"team\":\"jiminny\",\"team_id\":1,\"reason\":\"Activity Provider account not connected.\",\"file\":\"/home/jiminny/app/Services/Activity/ActivityProviderService.php\",\"line\":174} {\"correlation_id\":\"747e064b-723f-4612-b61e-e4f6581ba972\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"928573f1-075b-4c7a-b320-c1f059325f10\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"928573f1-075b-4c7a-b320-c1f059325f10\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"928573f1-075b-4c7a-b320-c1f059325f10\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:36] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:36] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:36] local.ALERT: [SyncActivity] Failed {\"import_id\":810043,\"provider\":\"twilio-video\",\"provider_id\":243,\"team\":\"jiminny\",\"team_id\":1,\"reason\":\"Activity Provider account not connected.\",\"file\":\"/home/jiminny/app/Services/Activity/ActivityProviderService.php\",\"line\":174} {\"correlation_id\":\"928573f1-075b-4c7a-b320-c1f059325f10\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {\"crm_provider\":\"hubspot\",\"crm_owner\":89,\"team_id\":2} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":408,\"provider\":\"hubspot\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":408,\"provider\":\"hubspot\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":408,\"provider\":\"hubspot\",\"refreshToken\":\"de4e47eb985578f4218833e763e31059e88b562e87e10749b3389be2328f0aa7\",\"state\":\"connected\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountObserver] Access token was modified, encrypting {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:37] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"nudges:send\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"67eff9ce-d3c1-484d-a3d7-11b715d43da9\",\"trace_id\":\"3142085a-2cef-4ffe-9ad5-4d9b4769fa85\"}\n[2026-04-14 10:15:37] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"nudges:send\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"67eff9ce-d3c1-484d-a3d7-11b715d43da9\",\"trace_id\":\"3142085a-2cef-4ffe-9ad5-4d9b4769fa85\"}\n[2026-04-14 10:15:37] local.INFO: [SocialAccountService] Token refreshed {\"socialAccountId\":408,\"provider\":\"hubspot\",\"state\":\"connected\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:37] local.INFO: [SyncActivity] Start {\"import_id\":810044,\"provider\":\"hubspot\",\"provider_id\":31,\"team\":\"hubspot\",\"team_id\":2} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:37] local.INFO: [HubSpot] Search calls for period {\"from\":\"2026-04-14 09:59:00\",\"to\":\"2026-04-14 10:15:00\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:37] local.INFO: [SyncActivity] End {\"import_id\":810044,\"provider\":\"hubspot\",\"provider_id\":31,\"team\":\"hubspot\",\"team_id\":2} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:37] local.INFO: [SyncActivity] Memory usage {\"import_id\":810044,\"provider\":\"hubspot\",\"provider_id\":31,\"team\":\"hubspot\",\"team_id\":2,\"memory_usage\":30998384,\"memory_real_usage\":67108864,\"pid\":37757} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:38] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"jiminny:playlists:normalize-sort\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ae160650-efe8-4f49-94a1-1821b4c424d6\",\"trace_id\":\"ff354824-7714-4f54-b759-0849e2394eec\"}\n[2026-04-14 10:15:38] local.INFO: [Jiminny\\Component\\Playlist\\Command\\NormalizeSortCommand::handle] starting. {\"playlists\":[]} {\"correlation_id\":\"ae160650-efe8-4f49-94a1-1821b4c424d6\",\"trace_id\":\"ff354824-7714-4f54-b759-0849e2394eec\"}\n[2026-04-14 10:15:38] local.INFO: [Jiminny\\Component\\Playlist\\Command\\NormalizeSortCommand::handle] finished. {\"normalizedPlaylists\":[],\"deletedPlaylists\":[]} {\"correlation_id\":\"ae160650-efe8-4f49-94a1-1821b4c424d6\",\"trace_id\":\"ff354824-7714-4f54-b759-0849e2394eec\"}\n[2026-04-14 10:15:38] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"jiminny:playlists:normalize-sort\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ae160650-efe8-4f49-94a1-1821b4c424d6\",\"trace_id\":\"ff354824-7714-4f54-b759-0849e2394eec\"}\n[2026-04-14 10:15:41] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:41] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:41] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:56] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:56] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:56] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8e1b8b11-79ba-4f4e-8685-b775817232fd\",\"trace_id\":\"1e128a69-7f3d-4e0f-8f62-616bcf487c5d\"}\n[2026-04-14 10:16:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"8e1b8b11-79ba-4f4e-8685-b775817232fd\",\"trace_id\":\"1e128a69-7f3d-4e0f-8f62-616bcf487c5d\"}\n[2026-04-14 10:16:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8e1b8b11-79ba-4f4e-8685-b775817232fd\",\"trace_id\":\"1e128a69-7f3d-4e0f-8f62-616bcf487c5d\"}\n[2026-04-14 10:16:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"239a9da7-f467-42b0-9e40-33794d1f2417\",\"trace_id\":\"dad528f2-05ae-4faa-a895-a0dd0087ba4d\"}\n[2026-04-14 10:16:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"239a9da7-f467-42b0-9e40-33794d1f2417\",\"trace_id\":\"dad528f2-05ae-4faa-a895-a0dd0087ba4d\"}\n[2026-04-14 10:16:08] local.NOTICE: Monitoring start {\"correlation_id\":\"739cea00-88f1-4a47-8984-06a35042de46\",\"trace_id\":\"0d843b4c-25fe-46d6-b830-07a01761e703\"}\n[2026-04-14 10:16:08] local.NOTICE: Monitoring end {\"correlation_id\":\"739cea00-88f1-4a47-8984-06a35042de46\",\"trace_id\":\"0d843b4c-25fe-46d6-b830-07a01761e703\"}\n[2026-04-14 10:16:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"29cf312e-e3ee-4a3c-ae96-728991fff96d\",\"trace_id\":\"8e554de9-60f6-411a-882c-1573407802a1\"}\n[2026-04-14 10:16:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"29cf312e-e3ee-4a3c-ae96-728991fff96d\",\"trace_id\":\"8e554de9-60f6-411a-882c-1573407802a1\"}\n[2026-04-14 10:16:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"6a0d0b68-2fe4-47db-a52f-9549f58fc8fd\",\"trace_id\":\"2e27f6a4-519c-42c5-8b3b-653b26fa8fa6\"}\n[2026-04-14 10:16:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"6a0d0b68-2fe4-47db-a52f-9549f58fc8fd\",\"trace_id\":\"2e27f6a4-519c-42c5-8b3b-653b26fa8fa6\"}\n[2026-04-14 10:16:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"6a0d0b68-2fe4-47db-a52f-9549f58fc8fd\",\"trace_id\":\"2e27f6a4-519c-42c5-8b3b-653b26fa8fa6\"}\n[2026-04-14 10:16:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"6a0d0b68-2fe4-47db-a52f-9549f58fc8fd\",\"trace_id\":\"2e27f6a4-519c-42c5-8b3b-653b26fa8fa6\"}\n[2026-04-14 10:16:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"758b4724-e445-441a-9612-23d1e87a5854\",\"trace_id\":\"c9942cf2-f503-475d-8afb-f55a26d53730\"}\n[2026-04-14 10:16:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:14:00, 2026-04-14 10:16:00] {\"correlation_id\":\"758b4724-e445-441a-9612-23d1e87a5854\",\"trace_id\":\"c9942cf2-f503-475d-8afb-f55a26d53730\"}\n[2026-04-14 10:16:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:14:00, 2026-04-14 10:16:00] {\"correlation_id\":\"758b4724-e445-441a-9612-23d1e87a5854\",\"trace_id\":\"c9942cf2-f503-475d-8afb-f55a26d53730\"}\n[2026-04-14 10:16:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"758b4724-e445-441a-9612-23d1e87a5854\",\"trace_id\":\"c9942cf2-f503-475d-8afb-f55a26d53730\"}\n[2026-04-14 10:16:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a8396e52-2e01-4a0e-9c0c-f5e0cbee4121\",\"trace_id\":\"e41cb131-16f3-4cb7-82a6-e70ab9ec3164\"}\n[2026-04-14 10:16:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a8396e52-2e01-4a0e-9c0c-f5e0cbee4121\",\"trace_id\":\"e41cb131-16f3-4cb7-82a6-e70ab9ec3164\"}\n[2026-04-14 10:16:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"7f36df61-d80b-4d46-a59d-de30a5c60135\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:20] local.INFO: [EmailSchedule] STARTING Inbox Sync {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"7f36df61-d80b-4d46-a59d-de30a5c60135\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:20] local.INFO: [EmailSchedule] FINISHED Inbox Sync {\"host\":\"docker_lamp_1\",\"events\":2} {\"correlation_id\":\"7f36df61-d80b-4d46-a59d-de30a5c60135\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"7f36df61-d80b-4d46-a59d-de30a5c60135\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:22] local.INFO: [Sync Mailbox] Sync start {\"inbox_id\":59} {\"correlation_id\":\"e5318327-0376-4d99-ae7a-9c4beede1707\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:22] local.INFO: [Inbox service] Skipping METADATA SYNC for inbox 59 due to unauthorized access to the mailbox {\"correlation_id\":\"e5318327-0376-4d99-ae7a-9c4beede1707\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:22] local.INFO: [Sync Mailbox] Sync complete {\"inbox_id\":59} {\"correlation_id\":\"e5318327-0376-4d99-ae7a-9c4beede1707\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:22] local.INFO: [Sync Mailbox] Sync start {\"inbox_id\":212} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:22] local.WARNING: [Salesforce] Account not connected for user {\"userId\":\"641f1acb-16b8-42d1-8726-df52979dad0e\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1500,\"sociable_id\":143,\"provider_user_id\":\"0052g000003frelAAA\",\"expires\":null,\"refresh_token_expires\":null,\"provider\":\"salesforce\",\"state\":\"full-refresh\",\"auth_scope\":\"refresh_token web api\",\"retry_after\":null,\"created_at\":\"2026-02-06 08:39:03\",\"updated_at\":\"2026-04-14 07:30:27\"}}} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:23] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"salesforce\",\"crm_owner\":143,\"team_id\":1} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:23] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:23] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:23] local.ERROR: Failed to set service context for google: Your Salesforce account has become disconnected. Please login to Jiminny to reconnect. {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:23] local.INFO: [Sync Mailbox] Sync complete {\"inbox_id\":212} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:27] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.INFO: [HubSpot Journal Polling] Service ending {\"runtime_seconds\":57,\"total_cycles\":5,\"files_downloaded\":0,\"empty_files\":0,\"other_portal_skipped\":0,\"total_events\":0,\"events_per_file\":0,\"avg_api_ms\":225.6,\"avg_download_ms\":0.0,\"avg_transform_ms\":0.0,\"avg_process_ms\":0.0,\"peak_memory_mb\":99.75} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.INFO: [HubSpot Journal Polling] Released polling lock {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:17:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d35216d4-bfac-4a85-8439-ae16a498e6c2\",\"trace_id\":\"07e527c2-57c8-4666-9c37-99465345b80c\"}\n[2026-04-14 10:17:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"d35216d4-bfac-4a85-8439-ae16a498e6c2\",\"trace_id\":\"07e527c2-57c8-4666-9c37-99465345b80c\"}\n[2026-04-14 10:17:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d35216d4-bfac-4a85-8439-ae16a498e6c2\",\"trace_id\":\"07e527c2-57c8-4666-9c37-99465345b80c\"}\n[2026-04-14 10:17:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ea85c092-3221-4e3c-aacc-8a835d847f22\",\"trace_id\":\"8d11a8bc-2b02-42b3-90c0-fc90665005a7\"}\n[2026-04-14 10:17:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ea85c092-3221-4e3c-aacc-8a835d847f22\",\"trace_id\":\"8d11a8bc-2b02-42b3-90c0-fc90665005a7\"}\n[2026-04-14 10:17:08] local.NOTICE: Monitoring start {\"correlation_id\":\"34d15cf0-1ccf-4611-902f-a11639d0e019\",\"trace_id\":\"c77cdb06-ca30-4672-bcd0-9bda2d2194a6\"}\n[2026-04-14 10:17:08] local.NOTICE: Monitoring end {\"correlation_id\":\"34d15cf0-1ccf-4611-902f-a11639d0e019\",\"trace_id\":\"c77cdb06-ca30-4672-bcd0-9bda2d2194a6\"}\n[2026-04-14 10:17:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"0811d737-c92b-4025-bb1c-590513e7451f\",\"trace_id\":\"70c60fa9-7b1f-4d6c-aa67-6a82d9c54d92\"}\n[2026-04-14 10:17:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"0811d737-c92b-4025-bb1c-590513e7451f\",\"trace_id\":\"70c60fa9-7b1f-4d6c-aa67-6a82d9c54d92\"}\n[2026-04-14 10:17:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"20f0dd3b-e5b5-47ca-a7a9-08c1acddb5a0\",\"trace_id\":\"0328a9c8-4f0e-42c2-9f04-81d72323b686\"}\n[2026-04-14 10:17:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"20f0dd3b-e5b5-47ca-a7a9-08c1acddb5a0\",\"trace_id\":\"0328a9c8-4f0e-42c2-9f04-81d72323b686\"}\n[2026-04-14 10:17:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"20f0dd3b-e5b5-47ca-a7a9-08c1acddb5a0\",\"trace_id\":\"0328a9c8-4f0e-42c2-9f04-81d72323b686\"}\n[2026-04-14 10:17:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"20f0dd3b-e5b5-47ca-a7a9-08c1acddb5a0\",\"trace_id\":\"0328a9c8-4f0e-42c2-9f04-81d72323b686\"}\n[2026-04-14 10:17:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"76173fa3-4233-4356-b6c0-5918aa4164e9\",\"trace_id\":\"6638f7ac-05d8-4280-99af-3a5f9dd0b86e\"}\n[2026-04-14 10:17:14] local.INFO: [EmailSchedule] STARTING batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"76173fa3-4233-4356-b6c0-5918aa4164e9\",\"trace_id\":\"6638f7ac-05d8-4280-99af-3a5f9dd0b86e\"}\n[2026-04-14 10:17:14] local.INFO: [EmailSchedule] FINISHED batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"76173fa3-4233-4356-b6c0-5918aa4164e9\",\"trace_id\":\"6638f7ac-05d8-4280-99af-3a5f9dd0b86e\"}\n[2026-04-14 10:17:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"76173fa3-4233-4356-b6c0-5918aa4164e9\",\"trace_id\":\"6638f7ac-05d8-4280-99af-3a5f9dd0b86e\"}\n[2026-04-14 10:17:17] local.INFO: [Jiminny\\Jobs\\Mailbox\\CreateBatches] processed 0 inboxes and created 0 batches {\"userId\":null,\"batchSize\":30,\"maxBatches\":1000} {\"correlation_id\":\"4a42d036-a82a-432d-8441-94812bf476d5\",\"trace_id\":\"6638f7ac-05d8-4280-99af-3a5f9dd0b86e\"}\n[2026-04-14 10:18:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3b071414-3bf6-4a42-9300-f79f89520e38\",\"trace_id\":\"88906f9c-80fc-4aca-a7a0-9c63f372da98\"}\n[2026-04-14 10:18:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"3b071414-3bf6-4a42-9300-f79f89520e38\",\"trace_id\":\"88906f9c-80fc-4aca-a7a0-9c63f372da98\"}\n[2026-04-14 10:18:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3b071414-3bf6-4a42-9300-f79f89520e38\",\"trace_id\":\"88906f9c-80fc-4aca-a7a0-9c63f372da98\"}\n[2026-04-14 10:18:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3da4d912-5c07-47de-bf15-981b3bb6e518\",\"trace_id\":\"448e6c0f-a217-418e-bd4d-32c6b4fe7ac8\"}\n[2026-04-14 10:18:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3da4d912-5c07-47de-bf15-981b3bb6e518\",\"trace_id\":\"448e6c0f-a217-418e-bd4d-32c6b4fe7ac8\"}\n[2026-04-14 10:18:08] local.NOTICE: Monitoring start {\"correlation_id\":\"9f200425-0d8e-4346-a6c8-517df5b5d55b\",\"trace_id\":\"49252ef9-62c1-4791-af81-da79d68b23d0\"}\n[2026-04-14 10:18:08] local.NOTICE: Monitoring end {\"correlation_id\":\"9f200425-0d8e-4346-a6c8-517df5b5d55b\",\"trace_id\":\"49252ef9-62c1-4791-af81-da79d68b23d0\"}\n[2026-04-14 10:18:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"f78cd133-1b15-43f6-9c16-e0e772523363\",\"trace_id\":\"31814799-af31-4551-9212-09f20d6b5b15\"}\n[2026-04-14 10:18:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"f78cd133-1b15-43f6-9c16-e0e772523363\",\"trace_id\":\"31814799-af31-4551-9212-09f20d6b5b15\"}\n[2026-04-14 10:18:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2875eda8-02c2-47ff-8957-987f9ccfed4a\",\"trace_id\":\"290c567a-365c-4874-9388-6ae856c4a29e\"}\n[2026-04-14 10:18:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"2875eda8-02c2-47ff-8957-987f9ccfed4a\",\"trace_id\":\"290c567a-365c-4874-9388-6ae856c4a29e\"}\n[2026-04-14 10:18:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"2875eda8-02c2-47ff-8957-987f9ccfed4a\",\"trace_id\":\"290c567a-365c-4874-9388-6ae856c4a29e\"}\n[2026-04-14 10:18:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2875eda8-02c2-47ff-8957-987f9ccfed4a\",\"trace_id\":\"290c567a-365c-4874-9388-6ae856c4a29e\"}\n[2026-04-14 10:18:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"259f2dbf-42df-4635-860a-11fe9c4ce3de\",\"trace_id\":\"e09c3d83-63d2-4bc6-a9f4-9434cc2c4795\"}\n[2026-04-14 10:18:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:16:00, 2026-04-14 10:18:00] {\"correlation_id\":\"259f2dbf-42df-4635-860a-11fe9c4ce3de\",\"trace_id\":\"e09c3d83-63d2-4bc6-a9f4-9434cc2c4795\"}\n[2026-04-14 10:18:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:16:00, 2026-04-14 10:18:00] {\"correlation_id\":\"259f2dbf-42df-4635-860a-11fe9c4ce3de\",\"trace_id\":\"e09c3d83-63d2-4bc6-a9f4-9434cc2c4795\"}\n[2026-04-14 10:18:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"259f2dbf-42df-4635-860a-11fe9c4ce3de\",\"trace_id\":\"e09c3d83-63d2-4bc6-a9f4-9434cc2c4795\"}\n[2026-04-14 10:18:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"12f429e9-7142-4c67-9b7f-ab576f600bd3\",\"trace_id\":\"eca121a3-0052-4f22-9820-44c0009591ab\"}\n[2026-04-14 10:18:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"12f429e9-7142-4c67-9b7f-ab576f600bd3\",\"trace_id\":\"eca121a3-0052-4f22-9820-44c0009591ab\"}\n[2026-04-14 10:19:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"bbfdab8a-af86-48c2-bd0e-e59e38d2cb7e\",\"trace_id\":\"563ef3c4-776b-4445-a65d-0a20ffdd44a5\"}\n[2026-04-14 10:19:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"bbfdab8a-af86-48c2-bd0e-e59e38d2cb7e\",\"trace_id\":\"563ef3c4-776b-4445-a65d-0a20ffdd44a5\"}\n[2026-04-14 10:19:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"bbfdab8a-af86-48c2-bd0e-e59e38d2cb7e\",\"trace_id\":\"563ef3c4-776b-4445-a65d-0a20ffdd44a5\"}\n[2026-04-14 10:19:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"20ee7c1b-2a8d-4c28-960c-7fd2692965a0\",\"trace_id\":\"e9bd336f-400e-4821-9759-f789c7f46f01\"}\n[2026-04-14 10:19:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"20ee7c1b-2a8d-4c28-960c-7fd2692965a0\",\"trace_id\":\"e9bd336f-400e-4821-9759-f789c7f46f01\"}\n[2026-04-14 10:19:09] local.NOTICE: Monitoring start {\"correlation_id\":\"f50066e0-d6fc-4cd4-ac5d-c9cba0729232\",\"trace_id\":\"5be77157-158c-4825-bbe1-2dd4b46fcf87\"}\n[2026-04-14 10:19:09] local.NOTICE: Monitoring end {\"correlation_id\":\"f50066e0-d6fc-4cd4-ac5d-c9cba0729232\",\"trace_id\":\"5be77157-158c-4825-bbe1-2dd4b46fcf87\"}\n[2026-04-14 10:19:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"c8bd605e-3081-4d1e-986c-ad4a8af3c44f\",\"trace_id\":\"55d06260-a630-4021-be67-d26c5472d38b\"}\n[2026-04-14 10:19:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"c8bd605e-3081-4d1e-986c-ad4a8af3c44f\",\"trace_id\":\"55d06260-a630-4021-be67-d26c5472d38b\"}\n[2026-04-14 10:19:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"5f0600be-5c90-4200-a4e3-6bcb17d9fb1a\",\"trace_id\":\"4b3a8062-7310-47e4-97f0-0caa927d0171\"}\n[2026-04-14 10:19:13] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"5f0600be-5c90-4200-a4e3-6bcb17d9fb1a\",\"trace_id\":\"4b3a8062-7310-47e4-97f0-0caa927d0171\"}\n[2026-04-14 10:19:13] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"5f0600be-5c90-4200-a4e3-6bcb17d9fb1a\",\"trace_id\":\"4b3a8062-7310-47e4-97f0-0caa927d0171\"}\n[2026-04-14 10:19:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"5f0600be-5c90-4200-a4e3-6bcb17d9fb1a\",\"trace_id\":\"4b3a8062-7310-47e4-97f0-0caa927d0171\"}\n[2026-04-14 10:20:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"49b10fcc-82b9-4f72-aa4a-fc90a3b32a67\",\"trace_id\":\"a3f352dd-490e-4d81-a68a-3491d12b2dec\"}\n[2026-04-14 10:20:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"49b10fcc-82b9-4f72-aa4a-fc90a3b32a67\",\"trace_id\":\"a3f352dd-490e-4d81-a68a-3491d12b2dec\"}\n[2026-04-14 10:20:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"49b10fcc-82b9-4f72-aa4a-fc90a3b32a67\",\"trace_id\":\"a3f352dd-490e-4d81-a68a-3491d12b2dec\"}\n[2026-04-14 10:20:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8658c495-f035-4d10-9a4f-67cd34dba765\",\"trace_id\":\"52e6b4db-baa3-44b9-9c16-b68690dfaffd\"}\n[2026-04-14 10:20:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8658c495-f035-4d10-9a4f-67cd34dba765\",\"trace_id\":\"52e6b4db-baa3-44b9-9c16-b68690dfaffd\"}\n[2026-04-14 10:20:09] local.NOTICE: Monitoring start {\"correlation_id\":\"7e12cae7-11d4-42ac-aa5f-8b83d569103c\",\"trace_id\":\"5bfd2f87-1d5e-4fe7-aa70-bd4b80240e65\"}\n[2026-04-14 10:20:09] local.NOTICE: Monitoring end {\"correlation_id\":\"7e12cae7-11d4-42ac-aa5f-8b83d569103c\",\"trace_id\":\"5bfd2f87-1d5e-4fe7-aa70-bd4b80240e65\"}\n[2026-04-14 10:20:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ff44f010-a7b5-4429-87e4-2dee3174ec71\",\"trace_id\":\"bf737ad6-1706-456f-9ddc-4ab7d25fd897\"}\n[2026-04-14 10:20:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ff44f010-a7b5-4429-87e4-2dee3174ec71\",\"trace_id\":\"bf737ad6-1706-456f-9ddc-4ab7d25fd897\"}\n[2026-04-14 10:20:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ac5f0008-7378-49a3-a1f4-178ff019bba3\",\"trace_id\":\"0437f9f2-d5e3-4fe5-8810-08e1dfd88fd5\"}\n[2026-04-14 10:20:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"ac5f0008-7378-49a3-a1f4-178ff019bba3\",\"trace_id\":\"0437f9f2-d5e3-4fe5-8810-08e1dfd88fd5\"}\n[2026-04-14 10:20:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"ac5f0008-7378-49a3-a1f4-178ff019bba3\",\"trace_id\":\"0437f9f2-d5e3-4fe5-8810-08e1dfd88fd5\"}\n[2026-04-14 10:20:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ac5f0008-7378-49a3-a1f4-178ff019bba3\",\"trace_id\":\"0437f9f2-d5e3-4fe5-8810-08e1dfd88fd5\"}\n[2026-04-14 10:20:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"bc166df0-72af-4784-be78-59ea128ebf54\",\"trace_id\":\"1253a4b0-504c-47cd-b0e9-dccbc9ec4443\"}\n[2026-04-14 10:20:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:18:00, 2026-04-14 10:20:00] {\"correlation_id\":\"bc166df0-72af-4784-be78-59ea128ebf54\",\"trace_id\":\"1253a4b0-504c-47cd-b0e9-dccbc9ec4443\"}\n[2026-04-14 10:20:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:18:00, 2026-04-14 10:20:00] {\"correlation_id\":\"bc166df0-72af-4784-be78-59ea128ebf54\",\"trace_id\":\"1253a4b0-504c-47cd-b0e9-dccbc9ec4443\"}\n[2026-04-14 10:20:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"bc166df0-72af-4784-be78-59ea128ebf54\",\"trace_id\":\"1253a4b0-504c-47cd-b0e9-dccbc9ec4443\"}\n[2026-04-14 10:20:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b9269388-ff12-4bb7-aa45-9b3367e19b9c\",\"trace_id\":\"7653c5d4-a15c-4c74-9269-3f692e5e0282\"}\n[2026-04-14 10:20:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b9269388-ff12-4bb7-aa45-9b3367e19b9c\",\"trace_id\":\"7653c5d4-a15c-4c74-9269-3f692e5e0282\"}\n[2026-04-14 10:20:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"36e841aa-09ce-4887-bf0d-88cdf637ef1b\",\"trace_id\":\"12d3af16-6083-4328-b02f-7fdad76d4e72\"}\n[2026-04-14 10:20:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"36e841aa-09ce-4887-bf0d-88cdf637ef1b\",\"trace_id\":\"12d3af16-6083-4328-b02f-7fdad76d4e72\"}\n[2026-04-14 10:20:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"35103276-6d8f-4398-8023-78b7902ff2b3\",\"trace_id\":\"2070f567-c2c0-4f10-b79e-0daca7ab30d1\"}\n[2026-04-14 10:20:20] local.INFO: Running pre-meeting notification command {\"correlation_id\":\"35103276-6d8f-4398-8023-78b7902ff2b3\",\"trace_id\":\"2070f567-c2c0-4f10-b79e-0daca7ab30d1\"}\n[2026-04-14 10:20:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"35103276-6d8f-4398-8023-78b7902ff2b3\",\"trace_id\":\"2070f567-c2c0-4f10-b79e-0daca7ab30d1\"}\n[2026-04-14 10:20:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"c3ad5e2b-8290-4bd9-aec1-d441f06442d5\",\"trace_id\":\"581699a1-91cf-490f-b4d9-ce3286747b66\"}\n[2026-04-14 10:20:22] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 10:10:00, 2026-04-14 10:15:00] {\"correlation_id\":\"c3ad5e2b-8290-4bd9-aec1-d441f06442d5\",\"trace_id\":\"581699a1-91cf-490f-b4d9-ce3286747b66\"}\n[2026-04-14 10:20:22] local.INFO: [conference:monitor:start] No activities found in (2026-04-14 10:10:00, 2026-04-14 10:15:00] {\"correlation_id\":\"c3ad5e2b-8290-4bd9-aec1-d441f06442d5\",\"trace_id\":\"581699a1-91cf-490f-b4d9-ce3286747b66\"}\n[2026-04-14 10:20:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"c3ad5e2b-8290-4bd9-aec1-d441f06442d5\",\"trace_id\":\"581699a1-91cf-490f-b4d9-ce3286747b66\"}\n[2026-04-14 10:20:24] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b7139a98-8562-495c-856d-d6175ac4b481\",\"trace_id\":\"fa8cd7d4-f859-4005-8bcb-d1c2f7b0b54f\"}\n[2026-04-14 10:20:24] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesEnded {\"from\":\"10:15\",\"to\":\"10:20\"} {\"correlation_id\":\"b7139a98-8562-495c-856d-d6175ac4b481\",\"trace_id\":\"fa8cd7d4-f859-4005-8bcb-d1c2f7b0b54f\"}\n[2026-04-14 10:20:24] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {\"from\":\"00:10\",\"to\":\"00:15\"} {\"correlation_id\":\"b7139a98-8562-495c-856d-d6175ac4b481\",\"trace_id\":\"fa8cd7d4-f859-4005-8bcb-d1c2f7b0b54f\"}\n[2026-04-14 10:20:24] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b7139a98-8562-495c-856d-d6175ac4b481\",\"trace_id\":\"fa8cd7d4-f859-4005-8bcb-d1c2f7b0b54f\"}\n[2026-04-14 10:20:27] local.NOTICE: Repairing HubSpot tokens start {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:27] local.INFO: Trying to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:27] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:27] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":59,\"provider\":\"hubspot\",\"refreshToken\":\"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.ERROR: Failed to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: Trying to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":306,\"provider\":\"hubspot\",\"refreshToken\":\"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.ERROR: Failed to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: Trying to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1372,\"provider\":\"hubspot\",\"refreshToken\":\"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:29] local.ERROR: Failed to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:29] local.NOTICE: Repairing HubSpot tokens end {\"total\":3,\"fixed\":0,\"failed\":3} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:31] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"jiminny:transcription:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"98f0a05b-5930-45f0-9a22-69ff45b3a2de\",\"trace_id\":\"2b98f3ff-a706-4edd-8201-aa3578346369\"}\n[2026-04-14 10:20:31] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3d3a0687-831f-4143-a6ed-b70d7d150006\",\"trace_id\":\"d159044c-6c7a-400d-903e-c49aa852830f\"}\n[2026-04-14 10:20:32] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"jiminny:transcription:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"98f0a05b-5930-45f0-9a22-69ff45b3a2de\",\"trace_id\":\"2b98f3ff-a706-4edd-8201-aa3578346369\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Command] Starting polling service {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Polling] Service starting {\"memory_limit\":\"256M\",\"max_execution_time\":\"0\",\"initial_memory_mb\":62.0} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Polling] Acquired polling lock {\"expires_at\":\"2026-04-14T10:22:32.175408Z\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3d3a0687-831f-4143-a6ed-b70d7d150006\",\"trace_id\":\"d159044c-6c7a-400d-903e-c49aa852830f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:36] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:reset-governor\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a44adcab-3209-472c-bb8b-d282633a967f\",\"trace_id\":\"d91779a5-ac75-4a27-b91e-f7a86e4f92e4\"}\n[2026-04-14 10:20:36] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:reset-governor\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a44adcab-3209-472c-bb8b-d282633a967f\",\"trace_id\":\"d91779a5-ac75-4a27-b91e-f7a86e4f92e4\"}\n[2026-04-14 10:20:37] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:37] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:37] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:38] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d1af3755-8f7f-4f60-9107-a1fac3eb49a7\",\"trace_id\":\"9704b2b2-b436-4dfe-8ec7-55a1d508f659\"}\n[2026-04-14 10:20:38] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d1af3755-8f7f-4f60-9107-a1fac3eb49a7\",\"trace_id\":\"9704b2b2-b436-4dfe-8ec7-55a1d508f659\"}\n[2026-04-14 10:20:42] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:42] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:42] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:57] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:57] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:58] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e7ba9c62-51b9-4dc2-a17a-3f2b14f5d752\",\"trace_id\":\"243dac4e-3e38-4ac6-8f75-f8159cc071c1\"}\n[2026-04-14 10:21:06] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"e7ba9c62-51b9-4dc2-a17a-3f2b14f5d752\",\"trace_id\":\"243dac4e-3e38-4ac6-8f75-f8159cc071c1\"}\n[2026-04-14 10:21:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e7ba9c62-51b9-4dc2-a17a-3f2b14f5d752\",\"trace_id\":\"243dac4e-3e38-4ac6-8f75-f8159cc071c1\"}\n[2026-04-14 10:21:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"9b6045b4-039a-43f8-aadc-389ecbf03df8\",\"trace_id\":\"8f2b2b86-e248-48de-845c-197974c3f404\"}\n[2026-04-14 10:21:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"9b6045b4-039a-43f8-aadc-389ecbf03df8\",\"trace_id\":\"8f2b2b86-e248-48de-845c-197974c3f404\"}\n[2026-04-14 10:21:13] local.NOTICE: Monitoring start {\"correlation_id\":\"c3c56c8f-20c5-4522-8090-e28150dbe6f3\",\"trace_id\":\"e8921765-8d27-49d5-928d-1b6b69964a1e\"}\n[2026-04-14 10:21:13] local.NOTICE: Monitoring end {\"correlation_id\":\"c3c56c8f-20c5-4522-8090-e28150dbe6f3\",\"trace_id\":\"e8921765-8d27-49d5-928d-1b6b69964a1e\"}\n[2026-04-14 10:21:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3bb80ed7-08d2-4bea-9aae-655106fe7e49\",\"trace_id\":\"f9a3cb0c-4620-40ef-92cf-b1a627ce5711\"}\n[2026-04-14 10:21:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3bb80ed7-08d2-4bea-9aae-655106fe7e49\",\"trace_id\":\"f9a3cb0c-4620-40ef-92cf-b1a627ce5711\"}\n[2026-04-14 10:21:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"568a3ee9-b2a9-4b65-acdc-e6b3a067465a\",\"trace_id\":\"39c1b238-1d21-495c-886a-59695f4d2ca3\"}\n[2026-04-14 10:21:18] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"568a3ee9-b2a9-4b65-acdc-e6b3a067465a\",\"trace_id\":\"39c1b238-1d21-495c-886a-59695f4d2ca3\"}\n[2026-04-14 10:21:18] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"568a3ee9-b2a9-4b65-acdc-e6b3a067465a\",\"trace_id\":\"39c1b238-1d21-495c-886a-59695f4d2ca3\"}\n[2026-04-14 10:21:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"568a3ee9-b2a9-4b65-acdc-e6b3a067465a\",\"trace_id\":\"39c1b238-1d21-495c-886a-59695f4d2ca3\"}\n[2026-04-14 10:21:28] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.INFO: [HubSpot Journal Polling] Service ending {\"runtime_seconds\":56,\"total_cycles\":5,\"files_downloaded\":0,\"empty_files\":0,\"other_portal_skipped\":0,\"total_events\":0,\"events_per_file\":0,\"avg_api_ms\":179.7,\"avg_download_ms\":0.0,\"avg_transform_ms\":0.0,\"avg_process_ms\":0.0,\"peak_memory_mb\":99.75} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.INFO: [HubSpot Journal Polling] Released polling lock {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:22:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e628b4b5-a260-4f1b-9772-c3fb8f959dcd\",\"trace_id\":\"a87cb34e-8ac3-49b6-b84d-5ec1b0f51c10\"}\n[2026-04-14 10:22:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"e628b4b5-a260-4f1b-9772-c3fb8f959dcd\",\"trace_id\":\"a87cb34e-8ac3-49b6-b84d-5ec1b0f51c10\"}\n[2026-04-14 10:22:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e628b4b5-a260-4f1b-9772-c3fb8f959dcd\",\"trace_id\":\"a87cb34e-8ac3-49b6-b84d-5ec1b0f51c10\"}\n[2026-04-14 10:22:08] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"154e4eab-6419-4d09-abbb-f2ae58f56ab9\",\"trace_id\":\"e6bf0f5c-b87f-4176-914c-e3915c704ecb\"}\n[2026-04-14 10:22:08] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"154e4eab-6419-4d09-abbb-f2ae58f56ab9\",\"trace_id\":\"e6bf0f5c-b87f-4176-914c-e3915c704ecb\"}\n[2026-04-14 10:22:10] local.NOTICE: Monitoring start {\"correlation_id\":\"bb373bb8-3b49-4c56-a262-e3c7eb494ba6\",\"trace_id\":\"b9294323-05f8-449a-a71d-ed8bb5b7a3f1\"}\n[2026-04-14 10:22:10] local.NOTICE: Monitoring end {\"correlation_id\":\"bb373bb8-3b49-4c56-a262-e3c7eb494ba6\",\"trace_id\":\"b9294323-05f8-449a-a71d-ed8bb5b7a3f1\"}\n[2026-04-14 10:22:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"92f4ab5d-c946-4203-92ab-3f40c73cf99e\",\"trace_id\":\"8e0d62c0-6e4a-46de-9a32-5e63920c6df0\"}\n[2026-04-14 10:22:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"92f4ab5d-c946-4203-92ab-3f40c73cf99e\",\"trace_id\":\"8e0d62c0-6e4a-46de-9a32-5e63920c6df0\"}\n[2026-04-14 10:22:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"84863ceb-b1f2-4e81-af5d-05a6c48367b8\",\"trace_id\":\"22775477-ff69-4f66-b7a5-29a8c11b5cc4\"}\n[2026-04-14 10:22:13] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"84863ceb-b1f2-4e81-af5d-05a6c48367b8\",\"trace_id\":\"22775477-ff69-4f66-b7a5-29a8c11b5cc4\"}\n[2026-04-14 10:22:13] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"84863ceb-b1f2-4e81-af5d-05a6c48367b8\",\"trace_id\":\"22775477-ff69-4f66-b7a5-29a8c11b5cc4\"}\n[2026-04-14 10:22:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"84863ceb-b1f2-4e81-af5d-05a6c48367b8\",\"trace_id\":\"22775477-ff69-4f66-b7a5-29a8c11b5cc4\"}\n[2026-04-14 10:22:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"67c43faf-702a-4c9f-bb88-5f4e85686c7b\",\"trace_id\":\"e4a6848c-4f4c-416e-a3a8-f05b0b21a887\"}\n[2026-04-14 10:22:15] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:20:00, 2026-04-14 10:22:00] {\"correlation_id\":\"67c43faf-702a-4c9f-bb88-5f4e85686c7b\",\"trace_id\":\"e4a6848c-4f4c-416e-a3a8-f05b0b21a887\"}\n[2026-04-14 10:22:15] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:20:00, 2026-04-14 10:22:00] {\"correlation_id\":\"67c43faf-702a-4c9f-bb88-5f4e85686c7b\",\"trace_id\":\"e4a6848c-4f4c-416e-a3a8-f05b0b21a887\"}\n[2026-04-14 10:22:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"67c43faf-702a-4c9f-bb88-5f4e85686c7b\",\"trace_id\":\"e4a6848c-4f4c-416e-a3a8-f05b0b21a887\"}\n[2026-04-14 10:22:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3e410b67-7611-41cf-a0e3-834e0f68d818\",\"trace_id\":\"e8767b80-d335-439b-8d22-1dca8e8bc8eb\"}\n[2026-04-14 10:22:17] local.INFO: [EmailSchedule] STARTING batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"3e410b67-7611-41cf-a0e3-834e0f68d818\",\"trace_id\":\"e8767b80-d335-439b-8d22-1dca8e8bc8eb\"}\n[2026-04-14 10:22:17] local.INFO: [EmailSchedule] FINISHED batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"3e410b67-7611-41cf-a0e3-834e0f68d818\",\"trace_id\":\"e8767b80-d335-439b-8d22-1dca8e8bc8eb\"}\n[2026-04-14 10:22:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3e410b67-7611-41cf-a0e3-834e0f68d818\",\"trace_id\":\"e8767b80-d335-439b-8d22-1dca8e8bc8eb\"}\n[2026-04-14 10:22:18] local.INFO: [Jiminny\\Jobs\\Mailbox\\CreateBatches] processed 0 inboxes and created 0 batches {\"userId\":null,\"batchSize\":30,\"maxBatches\":1000} {\"correlation_id\":\"0e5a049a-1999-4887-a8e7-7889599c214c\",\"trace_id\":\"e8767b80-d335-439b-8d22-1dca8e8bc8eb\"}\n[2026-04-14 10:22:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8dc561a9-cdd8-4e38-b023-0ab20205eb86\",\"trace_id\":\"34991402-ce26-41a0-a900-dae545b432eb\"}\n[2026-04-14 10:22:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8dc561a9-cdd8-4e38-b023-0ab20205eb86\",\"trace_id\":\"34991402-ce26-41a0-a900-dae545b432eb\"}\n[2026-04-14 10:22:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"twilio:recover-tracks\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"0f68167e-2333-49b1-b390-ea1a49b7cac3\",\"trace_id\":\"0ee52e66-a4e9-449f-893e-80ebc4b18ed8\"}\n[2026-04-14 10:22:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"twilio:recover-tracks\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"0f68167e-2333-49b1-b390-ea1a49b7cac3\",\"trace_id\":\"0ee52e66-a4e9-449f-893e-80ebc4b18ed8\"}\n[2026-04-14 10:22:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:sync-users\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:22] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"connect-and-sell\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:22] local.INFO: Start user synchronisation {\"provider\":\"justcall\",\"teams_count\":1} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:22] local.INFO: Synchronising team {\"provider\":\"justcall\",\"team_id\":1} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:22] local.WARNING: [Salesforce] Account not connected for user {\"userId\":\"cdf9285a-8ded-4a8b-bd7d-ec68c398f2f9\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1367,\"sociable_id\":1071,\"provider_user_id\":\"005O4000003s5c7IAA\",\"expires\":null,\"refresh_token_expires\":null,\"provider\":\"salesforce\",\"state\":\"full-refresh\",\"auth_scope\":\"refresh_token web api\",\"retry_after\":null,\"created_at\":\"2024-09-10 07:05:21\",\"updated_at\":\"2026-01-14 07:00:58\"}}} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"salesforce\",\"crm_owner\":1071,\"team_id\":1} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.WARNING: Failed to sync external users {\"message\":\"Your Salesforce account has become disconnected. Please login to Jiminny to reconnect.\",\"provider\":\"justcall\",\"team_id\":1,\"team\":\"jiminny\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"ringcentral\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"avaya\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"telus\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"salesloft\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"talkdesk\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"vonage\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Done {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:sync-users\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:23:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8ce8c33f-c700-41d3-8bda-6e110e611a1a\",\"trace_id\":\"19452bae-f98b-4af5-878f-b40d8a8f1258\"}\n[2026-04-14 10:23:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"8ce8c33f-c700-41d3-8bda-6e110e611a1a\",\"trace_id\":\"19452bae-f98b-4af5-878f-b40d8a8f1258\"}\n[2026-04-14 10:23:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8ce8c33f-c700-41d3-8bda-6e110e611a1a\",\"trace_id\":\"19452bae-f98b-4af5-878f-b40d8a8f1258\"}\n[2026-04-14 10:23:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"6b3be9cc-381f-4c17-8f4e-2caa683edc61\",\"trace_id\":\"3f18971a-08b1-4972-ba4d-d22295790688\"}\n[2026-04-14 10:23:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"6b3be9cc-381f-4c17-8f4e-2caa683edc61\",\"trace_id\":\"3f18971a-08b1-4972-ba4d-d22295790688\"}\n[2026-04-14 10:23:08] local.NOTICE: Monitoring start {\"correlation_id\":\"bf906540-5d34-4691-a873-0e91d0debbb6\",\"trace_id\":\"c4b35815-ff2e-4735-9d65-dd772e1da6b2\"}\n[2026-04-14 10:23:08] local.NOTICE: Monitoring end {\"correlation_id\":\"bf906540-5d34-4691-a873-0e91d0debbb6\",\"trace_id\":\"c4b35815-ff2e-4735-9d65-dd772e1da6b2\"}\n[2026-04-14 10:23:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"7bdbd473-d7db-4197-93e1-b9b0bb3ba833\",\"trace_id\":\"a086a2f0-2533-4702-9a60-0471c3974081\"}\n[2026-04-14 10:23:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"7bdbd473-d7db-4197-93e1-b9b0bb3ba833\",\"trace_id\":\"a086a2f0-2533-4702-9a60-0471c3974081\"}\n[2026-04-14 10:23:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"98787823-e59a-47f2-9153-2f9fa0cb7a26\",\"trace_id\":\"10761287-c79c-4fa3-a90e-445cac9aae24\"}\n[2026-04-14 10:23:11] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"98787823-e59a-47f2-9153-2f9fa0cb7a26\",\"trace_id\":\"10761287-c79c-4fa3-a90e-445cac9aae24\"}\n[2026-04-14 10:23:11] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"98787823-e59a-47f2-9153-2f9fa0cb7a26\",\"trace_id\":\"10761287-c79c-4fa3-a90e-445cac9aae24\"}\n[2026-04-14 10:23:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"98787823-e59a-47f2-9153-2f9fa0cb7a26\",\"trace_id\":\"10761287-c79c-4fa3-a90e-445cac9aae24\"}\n[2026-04-14 10:23:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"690d7f65-e9e1-4508-9f9b-2f79d756fb2a\",\"trace_id\":\"e6ab1c5b-955d-4e02-914a-e143f108a5f1\"}\n[2026-04-14 10:23:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"690d7f65-e9e1-4508-9f9b-2f79d756fb2a\",\"trace_id\":\"e6ab1c5b-955d-4e02-914a-e143f108a5f1\"}\n[2026-04-14 10:23:13] local.ERROR: [integration-app] Validate team connection. SocialAccount is disconnected {\"team_id\":3143} {\"correlation_id\":\"5b00e761-7a45-418e-b069-640cc3bb1a0d\",\"trace_id\":\"1753955e-7f4d-4110-8f92-a3459ca5b81a\"}\n[2026-04-14 10:24:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"87769467-67d9-4fb9-85cc-8c4531f0134e\",\"trace_id\":\"b64603e0-591c-4eab-837d-12c2a9f93797\"}\n[2026-04-14 10:24:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"87769467-67d9-4fb9-85cc-8c4531f0134e\",\"trace_id\":\"b64603e0-591c-4eab-837d-12c2a9f93797\"}\n[2026-04-14 10:24:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"87769467-67d9-4fb9-85cc-8c4531f0134e\",\"trace_id\":\"b64603e0-591c-4eab-837d-12c2a9f93797\"}\n[2026-04-14 10:24:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"60d70644-b27b-429c-ab5d-855a94d5abc9\",\"trace_id\":\"6719dc62-67df-49c0-b389-88745f4872bf\"}\n[2026-04-14 10:24:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"60d70644-b27b-429c-ab5d-855a94d5abc9\",\"trace_id\":\"6719dc62-67df-49c0-b389-88745f4872bf\"}\n[2026-04-14 10:24:08] local.NOTICE: Monitoring start {\"correlation_id\":\"006fad04-1c48-4633-bb72-87c6347f4658\",\"trace_id\":\"6a029c1b-9125-445f-a3c4-f3b2b9a1c1a5\"}\n[2026-04-14 10:24:08] local.NOTICE: Monitoring end {\"correlation_id\":\"006fad04-1c48-4633-bb72-87c6347f4658\",\"trace_id\":\"6a029c1b-9125-445f-a3c4-f3b2b9a1c1a5\"}\n[2026-04-14 10:24:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"16fd1929-bb0d-46d2-95e5-b76fc91d8c3d\",\"trace_id\":\"d31705a1-f790-4db7-b1b8-3ad99261b620\"}\n[2026-04-14 10:24:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"16fd1929-bb0d-46d2-95e5-b76fc91d8c3d\",\"trace_id\":\"d31705a1-f790-4db7-b1b8-3ad99261b620\"}\n[2026-04-14 10:24:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ca87a1c3-2f4b-4e0f-ba98-a7d908526b89\",\"trace_id\":\"c448bb4a-7ef8-4a05-a137-9b30f2515fbf\"}\n[2026-04-14 10:24:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"ca87a1c3-2f4b-4e0f-ba98-a7d908526b89\",\"trace_id\":\"c448bb4a-7ef8-4a05-a137-9b30f2515fbf\"}\n[2026-04-14 10:24:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"ca87a1c3-2f4b-4e0f-ba98-a7d908526b89\",\"trace_id\":\"c448bb4a-7ef8-4a05-a137-9b30f2515fbf\"}\n[2026-04-14 10:24:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ca87a1c3-2f4b-4e0f-ba98-a7d908526b89\",\"trace_id\":\"c448bb4a-7ef8-4a05-a137-9b30f2515fbf\"}\n[2026-04-14 10:24:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ebba8eb5-06bf-42b8-b19a-907212a73a79\",\"trace_id\":\"f7d54925-142f-4902-a526-ab978ee2c37f\"}\n[2026-04-14 10:24:16] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:22:00, 2026-04-14 10:24:00] {\"correlation_id\":\"ebba8eb5-06bf-42b8-b19a-907212a73a79\",\"trace_id\":\"f7d54925-142f-4902-a526-ab978ee2c37f\"}\n[2026-04-14 10:24:16] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:22:00, 2026-04-14 10:24:00] {\"correlation_id\":\"ebba8eb5-06bf-42b8-b19a-907212a73a79\",\"trace_id\":\"f7d54925-142f-4902-a526-ab978ee2c37f\"}\n[2026-04-14 10:24:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ebba8eb5-06bf-42b8-b19a-907212a73a79\",\"trace_id\":\"f7d54925-142f-4902-a526-ab978ee2c37f\"}\n[2026-04-14 10:24:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:aircall:check-and-renew\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1496,\"provider\":\"aircall\"} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:19] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1496,\"provider\":\"aircall\"} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:20] local.ERROR: [Aircall] Re-activating webhooks failed {\"team_id\":1,\"reason\":\"{\\\"message\\\":\\\"Forbidden\\\"}\"} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:aircall:check-and-renew\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:22] local.INFO: [RetryFailedDownloads] Starting {\"options\":{\"from\":null,\"to\":null,\"help\":false,\"silent\":false,\"quiet\":false,\"verbose\":false,\"version\":false,\"ansi\":null,\"no-interaction\":false,\"env\":null}} {\"correlation_id\":\"c11b15ff-1036-4e32-b611-f8a3df3b8127\",\"trace_id\":\"685428df-6f1e-47b4-b2ea-521c6cbd3a85\"}\n[2026-04-14 10:25:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"c07afadb-0654-403b-8270-cfa193d8ce4f\",\"trace_id\":\"59f88c31-45e9-4243-a4dc-284e0e65602a\"}\n[2026-04-14 10:25:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"c07afadb-0654-403b-8270-cfa193d8ce4f\",\"trace_id\":\"59f88c31-45e9-4243-a4dc-284e0e65602a\"}\n[2026-04-14 10:25:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"c07afadb-0654-403b-8270-cfa193d8ce4f\",\"trace_id\":\"59f88c31-45e9-4243-a4dc-284e0e65602a\"}\n[2026-04-14 10:25:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"04359657-d8fa-4683-88ab-f41c05c65222\",\"trace_id\":\"c0a15344-1ad9-4977-b3c6-cdac7968dde4\"}\n[2026-04-14 10:25:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"04359657-d8fa-4683-88ab-f41c05c65222\",\"trace_id\":\"c0a15344-1ad9-4977-b3c6-cdac7968dde4\"}\n[2026-04-14 10:25:09] local.NOTICE: Monitoring start {\"correlation_id\":\"fedb1fd3-593c-4210-a082-f790f0aba781\",\"trace_id\":\"18f81fd2-1aa0-44a2-be9e-7c09a21a09d3\"}\n[2026-04-14 10:25:09] local.NOTICE: Monitoring end {\"correlation_id\":\"fedb1fd3-593c-4210-a082-f790f0aba781\",\"trace_id\":\"18f81fd2-1aa0-44a2-be9e-7c09a21a09d3\"}\n[2026-04-14 10:25:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2bf8ad3e-04e8-40b8-b020-97fce6ca3029\",\"trace_id\":\"1661314e-6433-47c6-afd0-1ce9cd645edd\"}\n[2026-04-14 10:25:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2bf8ad3e-04e8-40b8-b020-97fce6ca3029\",\"trace_id\":\"1661314e-6433-47c6-afd0-1ce9cd645edd\"}\n[2026-04-14 10:25:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"107e74dd-79aa-41fc-9eed-13f265a2e7e0\",\"trace_id\":\"25776c23-f7f0-42ba-9461-fd3f53dd417d\"}\n[2026-04-14 10:25:14] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"107e74dd-79aa-41fc-9eed-13f265a2e7e0\",\"trace_id\":\"25776c23-f7f0-42ba-9461-fd3f53dd417d\"}\n[2026-04-14 10:25:14] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"107e74dd-79aa-41fc-9eed-13f265a2e7e0\",\"trace_id\":\"25776c23-f7f0-42ba-9461-fd3f53dd417d\"}\n[2026-04-14 10:25:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"107e74dd-79aa-41fc-9eed-13f265a2e7e0\",\"trace_id\":\"25776c23-f7f0-42ba-9461-fd3f53dd417d\"}\n[2026-04-14 10:25:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ba5670c1-54b2-4c92-ad0f-4940e1edebed\",\"trace_id\":\"e7bf78d3-78c4-460d-91ea-b236d18092c5\"}\n[2026-04-14 10:25:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ba5670c1-54b2-4c92-ad0f-4940e1edebed\",\"trace_id\":\"e7bf78d3-78c4-460d-91ea-b236d18092c5\"}\n[2026-04-14 10:25:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"0c99a10a-93f7-4ba6-b9b1-bc4a1b49a62b\",\"trace_id\":\"ae62ca2a-dd5e-4eee-b063-f410f150d7a4\"}\n[2026-04-14 10:25:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"0c99a10a-93f7-4ba6-b9b1-bc4a1b49a62b\",\"trace_id\":\"ae62ca2a-dd5e-4eee-b063-f410f150d7a4\"}\n[2026-04-14 10:25:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d9d48905-6192-46b9-b697-8e94b16af1b3\",\"trace_id\":\"0f5793fd-8e00-4c96-8fd9-9caba00d41bc\"}\n[2026-04-14 10:25:20] local.INFO: Running pre-meeting notification command {\"correlation_id\":\"d9d48905-6192-46b9-b697-8e94b16af1b3\",\"trace_id\":\"0f5793fd-8e00-4c96-8fd9-9caba00d41bc\"}\n[2026-04-14 10:25:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d9d48905-6192-46b9-b697-8e94b16af1b3\",\"trace_id\":\"0f5793fd-8e00-4c96-8fd9-9caba00d41bc\"}\n[2026-04-14 10:25:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a0aff5c4-6fdc-4bb1-9ec5-86e561600e12\",\"trace_id\":\"bdb17642-ebef-41ac-b598-7ab48079f333\"}\n[2026-04-14 10:25:22] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 10:15:00, 2026-04-14 10:20:00] {\"correlation_id\":\"a0aff5c4-6fdc-4bb1-9ec5-86e561600e12\",\"trace_id\":\"bdb17642-ebef-41ac-b598-7ab48079f333\"}\n[2026-04-14 10:25:22] local.INFO: [conference:monitor:start] No activities found in (2026-04-14 10:15:00, 2026-04-14 10:20:00] {\"correlation_id\":\"a0aff5c4-6fdc-4bb1-9ec5-86e561600e12\",\"trace_id\":\"bdb17642-ebef-41ac-b598-7ab48079f333\"}\n[2026-04-14 10:25:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a0aff5c4-6fdc-4bb1-9ec5-86e561600e12\",\"trace_id\":\"bdb17642-ebef-41ac-b598-7ab48079f333\"}\n[2026-04-14 10:25:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3f28aa59-2038-437b-b3f8-71dfcf92a66a\",\"trace_id\":\"2f8398d9-c13c-4292-8cd9-ec84535c749f\"}\n[2026-04-14 10:25:23] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesEnded {\"from\":\"10:20\",\"to\":\"10:25\"} {\"correlation_id\":\"3f28aa59-2038-437b-b3f8-71dfcf92a66a\",\"trace_id\":\"2f8398d9-c13c-4292-8cd9-ec84535c749f\"}\n[2026-04-14 10:25:23] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {\"from\":\"00:15\",\"to\":\"00:20\"} {\"correlation_id\":\"3f28aa59-2038-437b-b3f8-71dfcf92a66a\",\"trace_id\":\"2f8398d9-c13c-4292-8cd9-ec84535c749f\"}\n[2026-04-14 10:25:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3f28aa59-2038-437b-b3f8-71dfcf92a66a\",\"trace_id\":\"2f8398d9-c13c-4292-8cd9-ec84535c749f\"}\n[2026-04-14 10:25:25] local.NOTICE: Repairing HubSpot tokens start {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:25] local.INFO: Trying to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:25] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:25] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":59,\"provider\":\"hubspot\",\"refreshToken\":\"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":306,\"provider\":\"hubspot\",\"refreshToken\":\"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1372,\"provider\":\"hubspot\",\"refreshToken\":\"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.NOTICE: Repairing HubSpot tokens end {\"total\":3,\"fixed\":0,\"failed\":3} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:28] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"55bc4313-7c66-4136-9f5d-8e1fc1225670\",\"trace_id\":\"359c0125-96fc-46c4-8d19-89088b060aff\"}\n[2026-04-14 10:25:28] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"4447c4f7-17a4-4301-ab7b-eb90053f940f\",\"trace_id\":\"a31edfc1-4e06-41f1-96de-e69abed9b404\"}\n[2026-04-14 10:25:28] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"4447c4f7-17a4-4301-ab7b-eb90053f940f\",\"trace_id\":\"a31edfc1-4e06-41f1-96de-e69abed9b404\"}\n[2026-04-14 10:25:28] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:28] local.INFO: [HubSpot Journal Command] Starting polling service {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:28] local.INFO: [HubSpot Journal Polling] Service starting {\"memory_limit\":\"256M\",\"max_execution_time\":\"0\",\"initial_memory_mb\":62.0} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:29] local.INFO: [HubSpot Journal Polling] Acquired polling lock {\"expires_at\":\"2026-04-14T10:27:28.996306Z\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:29] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:29] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:29] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"55bc4313-7c66-4136-9f5d-8e1fc1225670\",\"trace_id\":\"359c0125-96fc-46c4-8d19-89088b060aff\"}\n[2026-04-14 10:25:29] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:34] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:34] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:34] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:39] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:39] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:39] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:54] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:54] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:54] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ec2b6ab8-433d-4988-9fc4-39aa9e6f7d76\",\"trace_id\":\"d2ff3c29-0c48-4449-859d-4fd503b2811b\"}\n[2026-04-14 10:26:07] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"ec2b6ab8-433d-4988-9fc4-39aa9e6f7d76\",\"trace_id\":\"d2ff3c29-0c48-4449-859d-4fd503b2811b\"}\n[2026-04-14 10:26:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ec2b6ab8-433d-4988-9fc4-39aa9e6f7d76\",\"trace_id\":\"d2ff3c29-0c48-4449-859d-4fd503b2811b\"}\n[2026-04-14 10:26:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e8a78ad9-2c5b-48b3-af42-4fd16f1b3b95\",\"trace_id\":\"208430f6-334c-4edc-ad22-426bc66f2ca0\"}\n[2026-04-14 10:26:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e8a78ad9-2c5b-48b3-af42-4fd16f1b3b95\",\"trace_id\":\"208430f6-334c-4edc-ad22-426bc66f2ca0\"}\n[2026-04-14 10:26:14] local.NOTICE: Monitoring start {\"correlation_id\":\"6abc61c5-47aa-40f4-9504-214a85f90c80\",\"trace_id\":\"5979c806-c10b-458b-a634-036caa06b921\"}\n[2026-04-14 10:26:14] local.NOTICE: Monitoring end {\"correlation_id\":\"6abc61c5-47aa-40f4-9504-214a85f90c80\",\"trace_id\":\"5979c806-c10b-458b-a634-036caa06b921\"}\n[2026-04-14 10:26:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b03b90de-df73-4a74-b7bc-c2210f641951\",\"trace_id\":\"e6761c94-ea37-41d1-a88a-079ec53b2ec8\"}\n[2026-04-14 10:26:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b03b90de-df73-4a74-b7bc-c2210f641951\",\"trace_id\":\"e6761c94-ea37-41d1-a88a-079ec53b2ec8\"}\n[2026-04-14 10:26:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"6d9d5fba-7219-46d2-9298-d2c71421a694\",\"trace_id\":\"dcd4d636-234d-4605-86b5-1992156cce8b\"}\n[2026-04-14 10:26:21] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"6d9d5fba-7219-46d2-9298-d2c71421a694\",\"trace_id\":\"dcd4d636-234d-4605-86b5-1992156cce8b\"}\n[2026-04-14 10:26:21] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"6d9d5fba-7219-46d2-9298-d2c71421a694\",\"trace_id\":\"dcd4d636-234d-4605-86b5-1992156cce8b\"}\n[2026-04-14 10:26:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"6d9d5fba-7219-46d2-9298-d2c71421a694\",\"trace_id\":\"dcd4d636-234d-4605-86b5-1992156cce8b\"}\n[2026-04-14 10:26:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"640dfd99-289e-4464-898e-f10bd05d7c1c\",\"trace_id\":\"a61f1d24-3e02-46cf-b339-dda3c9347237\"}\n[2026-04-14 10:26:23] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:24:00, 2026-04-14 10:26:00] {\"correlation_id\":\"640dfd99-289e-4464-898e-f10bd05d7c1c\",\"trace_id\":\"a61f1d24-3e02-46cf-b339-dda3c9347237\"}\n[2026-04-14 10:26:23] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:24:00, 2026-04-14 10:26:00] {\"correlation_id\":\"640dfd99-289e-4464-898e-f10bd05d7c1c\",\"trace_id\":\"a61f1d24-3e02-46cf-b339-dda3c9347237\"}\n[2026-04-14 10:26:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"640dfd99-289e-4464-898e-f10bd05d7c1c\",\"trace_id\":\"a61f1d24-3e02-46cf-b339-dda3c9347237\"}\n[2026-04-14 10:26:25] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.INFO: [HubSpot Journal Polling] Service ending {\"runtime_seconds\":57,\"total_cycles\":5,\"files_downloaded\":0,\"empty_files\":0,\"other_portal_skipped\":0,\"total_events\":0,\"events_per_file\":0,\"avg_api_ms\":176.8,\"avg_download_ms\":0.0,\"avg_transform_ms\":0.0,\"avg_process_ms\":0.0,\"peak_memory_mb\":99.75} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.INFO: [HubSpot Journal Polling] Released polling lock {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:26] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e32bab70-484f-463b-9fe9-ceb556655fe6\",\"trace_id\":\"efff9002-89e1-4f8f-80e0-8134ad07ec36\"}\n[2026-04-14 10:26:27] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e32bab70-484f-463b-9fe9-ceb556655fe6\",\"trace_id\":\"efff9002-89e1-4f8f-80e0-8134ad07ec36\"}\n[2026-04-14 10:26:33] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"4bad17e3-4d02-4827-93ef-4b7963d39627\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:33] local.INFO: [EmailSchedule] STARTING Inbox Sync {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"4bad17e3-4d02-4827-93ef-4b7963d39627\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:34] local.INFO: [EmailSchedule] FINISHED Inbox Sync {\"host\":\"docker_lamp_1\",\"events\":1} {\"correlation_id\":\"4bad17e3-4d02-4827-93ef-4b7963d39627\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"4bad17e3-4d02-4827-93ef-4b7963d39627\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:35] local.INFO: [Sync Mailbox] Sync start {\"inbox_id\":59} {\"correlation_id\":\"d941de3d-4c89-4d94-a3a3-48a90e525f9e\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:35] local.INFO: [Inbox service] Skipping METADATA SYNC for inbox 59 due to unauthorized access to the mailbox {\"correlation_id\":\"d941de3d-4c89-4d94-a3a3-48a90e525f9e\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:35] local.INFO: [Sync Mailbox] Sync complete {\"inbox_id\":59} {\"correlation_id\":\"d941de3d-4c89-4d94-a3a3-48a90e525f9e\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:27:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"59c59788-bb08-4659-8792-75c738056638\",\"trace_id\":\"ccfc98c0-3577-45eb-b2ea-3793f3614a03\"}\n[2026-04-14 10:27:19] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"59c59788-bb08-4659-8792-75c738056638\",\"trace_id\":\"ccfc98c0-3577-45eb-b2ea-3793f3614a03\"}\n[2026-04-14 10:27:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"59c59788-bb08-4659-8792-75c738056638\",\"trace_id\":\"ccfc98c0-3577-45eb-b2ea-3793f3614a03\"}\n[2026-04-14 10:27:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"fd89ff27-9f90-4ca5-8a1b-07fdb2318bf8\",\"trace_id\":\"1a652459-8d6e-40ec-b302-2421e2e290d2\"}\n[2026-04-14 10:27:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"fd89ff27-9f90-4ca5-8a1b-07fdb2318bf8\",\"trace_id\":\"1a652459-8d6e-40ec-b302-2421e2e290d2\"}\n[2026-04-14 10:27:23] local.NOTICE: Monitoring start {\"correlation_id\":\"1326ca30-351f-4a04-9e17-0eb197f7a97a\",\"trace_id\":\"dd0fd46b-204d-480f-b13c-cf070053ff83\"}\n[2026-04-14 10:27:23] local.NOTICE: Monitoring end {\"correlation_id\":\"1326ca30-351f-4a04-9e17-0eb197f7a97a\",\"trace_id\":\"dd0fd46b-204d-480f-b13c-cf070053ff83\"}","depth":4,"bounds":{"left":0.38867188,"top":0.14930555,"width":0.6113281,"height":0.8506944},"value":"[2026-04-14 10:05:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"9756bfa7-c8e1-4b17-bc55-9f224d2af2e3\",\"trace_id\":\"9e5fa115-9cf5-45d6-a1da-109e154cfae7\"}\n[2026-04-14 10:05:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"9756bfa7-c8e1-4b17-bc55-9f224d2af2e3\",\"trace_id\":\"9e5fa115-9cf5-45d6-a1da-109e154cfae7\"}\n[2026-04-14 10:05:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d9d68876-323b-42bd-9953-635da8008f2e\",\"trace_id\":\"6c00ce4c-f2df-4ccb-908d-4862de973096\"}\n[2026-04-14 10:05:23] local.INFO: Running pre-meeting notification command {\"correlation_id\":\"d9d68876-323b-42bd-9953-635da8008f2e\",\"trace_id\":\"6c00ce4c-f2df-4ccb-908d-4862de973096\"}\n[2026-04-14 10:05:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d9d68876-323b-42bd-9953-635da8008f2e\",\"trace_id\":\"6c00ce4c-f2df-4ccb-908d-4862de973096\"}\n[2026-04-14 10:05:26] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"27d73fea-a8cb-4757-9bbb-fbe7222e6943\",\"trace_id\":\"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e\"}\n[2026-04-14 10:05:26] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 09:55:00, 2026-04-14 10:00:00] {\"correlation_id\":\"27d73fea-a8cb-4757-9bbb-fbe7222e6943\",\"trace_id\":\"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e\"}\n[2026-04-14 10:05:26] local.INFO: [conference:monitor:start] start ok {\"activity_id\":407307} {\"correlation_id\":\"27d73fea-a8cb-4757-9bbb-fbe7222e6943\",\"trace_id\":\"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e\"}\n[2026-04-14 10:05:26] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"27d73fea-a8cb-4757-9bbb-fbe7222e6943\",\"trace_id\":\"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e\"}\n[2026-04-14 10:05:28] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"588bae45-3998-4b86-b056-51aaf8b6882f\",\"trace_id\":\"8f716a65-7768-44c5-b0e4-02a859f329e5\"}\n[2026-04-14 10:05:28] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesEnded {\"from\":\"10:00\",\"to\":\"10:05\"} {\"correlation_id\":\"588bae45-3998-4b86-b056-51aaf8b6882f\",\"trace_id\":\"8f716a65-7768-44c5-b0e4-02a859f329e5\"}\n[2026-04-14 10:05:28] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {\"from\":\"23:55\",\"to\":\"00:00\"} {\"correlation_id\":\"588bae45-3998-4b86-b056-51aaf8b6882f\",\"trace_id\":\"8f716a65-7768-44c5-b0e4-02a859f329e5\"}\n[2026-04-14 10:05:28] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"588bae45-3998-4b86-b056-51aaf8b6882f\",\"trace_id\":\"8f716a65-7768-44c5-b0e4-02a859f329e5\"}\n[2026-04-14 10:05:30] local.NOTICE: Repairing HubSpot tokens start {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:30] local.INFO: Trying to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:30] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:30] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":59,\"provider\":\"hubspot\",\"refreshToken\":\"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: Trying to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":306,\"provider\":\"hubspot\",\"refreshToken\":\"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: Trying to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1372,\"provider\":\"hubspot\",\"refreshToken\":\"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:31] local.NOTICE: Repairing HubSpot tokens end {\"total\":3,\"fixed\":0,\"failed\":3} {\"correlation_id\":\"da835e46-68f6-4d4c-bf42-aa41de2e599d\",\"trace_id\":\"7d96dad0-2325-4190-bff6-a2d83f01c4e1\"}\n[2026-04-14 10:05:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2b2ca83a-1263-4a7c-a5d7-86dc15ea7aec\",\"trace_id\":\"fbf48d3d-4e50-4442-b14f-d2ae5e6e70bd\"}\n[2026-04-14 10:05:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"73b127c9-c033-4fa7-a8ed-2e28077ba970\",\"trace_id\":\"fd1cf3c5-d4ce-41d6-a19d-5e67fd544d9e\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"73b127c9-c033-4fa7-a8ed-2e28077ba970\",\"trace_id\":\"fd1cf3c5-d4ce-41d6-a19d-5e67fd544d9e\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Command] Starting polling service {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Service starting {\"memory_limit\":\"256M\",\"max_execution_time\":\"0\",\"initial_memory_mb\":62.0} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Acquired polling lock {\"expires_at\":\"2026-04-14T10:07:34.196472Z\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2b2ca83a-1263-4a7c-a5d7-86dc15ea7aec\",\"trace_id\":\"fbf48d3d-4e50-4442-b14f-d2ae5e6e70bd\"}\n[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:39] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:39] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:39] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:44] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:44] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:44] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:59] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:05:59] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:00] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a\",\"trace_id\":\"b4c87c8d-120d-48fb-b13c-aee84323f3e2\"}\n[2026-04-14 10:06:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a\",\"trace_id\":\"b4c87c8d-120d-48fb-b13c-aee84323f3e2\"}\n[2026-04-14 10:06:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a\",\"trace_id\":\"b4c87c8d-120d-48fb-b13c-aee84323f3e2\"}\n[2026-04-14 10:06:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8403c1e4-b5b6-41f9-9280-ff666beed28b\",\"trace_id\":\"3f631f60-6d14-44f5-b6c3-b401999867f9\"}\n[2026-04-14 10:06:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8403c1e4-b5b6-41f9-9280-ff666beed28b\",\"trace_id\":\"3f631f60-6d14-44f5-b6c3-b401999867f9\"}\n[2026-04-14 10:06:08] local.NOTICE: Monitoring start {\"correlation_id\":\"0d51eb08-f2f1-4322-97d0-268700856a99\",\"trace_id\":\"92b45b9a-b6e8-40c8-a783-193cf1a4eea2\"}\n[2026-04-14 10:06:08] local.NOTICE: Monitoring end {\"correlation_id\":\"0d51eb08-f2f1-4322-97d0-268700856a99\",\"trace_id\":\"92b45b9a-b6e8-40c8-a783-193cf1a4eea2\"}\n[2026-04-14 10:06:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"0566c59b-bf67-49eb-970a-a6b955ddd756\",\"trace_id\":\"724c5f5e-cd88-41fb-9b7e-74315e131024\"}\n[2026-04-14 10:06:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"0566c59b-bf67-49eb-970a-a6b955ddd756\",\"trace_id\":\"724c5f5e-cd88-41fb-9b7e-74315e131024\"}\n[2026-04-14 10:06:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"33d190d4-0abb-4e63-af52-95faa913e7a1\",\"trace_id\":\"703aaa4d-a551-4ed1-8a4a-609d373e2fc0\"}\n[2026-04-14 10:06:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"33d190d4-0abb-4e63-af52-95faa913e7a1\",\"trace_id\":\"703aaa4d-a551-4ed1-8a4a-609d373e2fc0\"}\n[2026-04-14 10:06:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"33d190d4-0abb-4e63-af52-95faa913e7a1\",\"trace_id\":\"703aaa4d-a551-4ed1-8a4a-609d373e2fc0\"}\n[2026-04-14 10:06:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"33d190d4-0abb-4e63-af52-95faa913e7a1\",\"trace_id\":\"703aaa4d-a551-4ed1-8a4a-609d373e2fc0\"}\n[2026-04-14 10:06:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"da41d77d-46d9-41ae-90b7-f8418b05fb9a\",\"trace_id\":\"47329a55-e6f4-406b-8730-e72d69737f09\"}\n[2026-04-14 10:06:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:04:00, 2026-04-14 10:06:00] {\"correlation_id\":\"da41d77d-46d9-41ae-90b7-f8418b05fb9a\",\"trace_id\":\"47329a55-e6f4-406b-8730-e72d69737f09\"}\n[2026-04-14 10:06:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:04:00, 2026-04-14 10:06:00] {\"correlation_id\":\"da41d77d-46d9-41ae-90b7-f8418b05fb9a\",\"trace_id\":\"47329a55-e6f4-406b-8730-e72d69737f09\"}\n[2026-04-14 10:06:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"da41d77d-46d9-41ae-90b7-f8418b05fb9a\",\"trace_id\":\"47329a55-e6f4-406b-8730-e72d69737f09\"}\n[2026-04-14 10:06:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"310e7e99-6de4-4f93-967e-37c78e9ec826\",\"trace_id\":\"2a1fdf0a-be0e-4e5a-a677-fa16ddc33e9e\"}\n[2026-04-14 10:06:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"310e7e99-6de4-4f93-967e-37c78e9ec826\",\"trace_id\":\"2a1fdf0a-be0e-4e5a-a677-fa16ddc33e9e\"}\n[2026-04-14 10:06:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"de8430ad-f242-4536-bebe-e165320b6b26\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:19] local.INFO: [EmailSchedule] STARTING Inbox Sync {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"de8430ad-f242-4536-bebe-e165320b6b26\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:19] local.INFO: [EmailSchedule] FINISHED Inbox Sync {\"host\":\"docker_lamp_1\",\"events\":1} {\"correlation_id\":\"de8430ad-f242-4536-bebe-e165320b6b26\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"de8430ad-f242-4536-bebe-e165320b6b26\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:22] local.INFO: [Sync Mailbox] Sync start {\"inbox_id\":59} {\"correlation_id\":\"eb46c86e-5c80-48b1-a4ee-ac425f197754\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:22] local.INFO: [Inbox service] Skipping METADATA SYNC for inbox 59 due to unauthorized access to the mailbox {\"correlation_id\":\"eb46c86e-5c80-48b1-a4ee-ac425f197754\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:22] local.INFO: [Sync Mailbox] Sync complete {\"inbox_id\":59} {\"correlation_id\":\"eb46c86e-5c80-48b1-a4ee-ac425f197754\",\"trace_id\":\"75f83d2f-4e5e-4086-b062-7c1d24b5b74c\"}\n[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Service ending {\"runtime_seconds\":56,\"total_cycles\":5,\"files_downloaded\":0,\"empty_files\":0,\"other_portal_skipped\":0,\"total_events\":0,\"events_per_file\":0,\"avg_api_ms\":169.9,\"avg_download_ms\":0.0,\"avg_transform_ms\":0.0,\"avg_process_ms\":0.0,\"peak_memory_mb\":99.75} {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Released polling lock {\"correlation_id\":\"8dfaefe8-60b1-4846-bfa3-eb703c71deb8\",\"trace_id\":\"186e2ff6-96dc-4ae6-a31b-0c3849678f7b\"}\n[2026-04-14 10:07:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"53329974-bdd6-4cd2-a022-0d565b0a5cf4\",\"trace_id\":\"08246763-f961-45fb-b262-51378bdbc955\"}\n[2026-04-14 10:07:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"53329974-bdd6-4cd2-a022-0d565b0a5cf4\",\"trace_id\":\"08246763-f961-45fb-b262-51378bdbc955\"}\n[2026-04-14 10:07:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"53329974-bdd6-4cd2-a022-0d565b0a5cf4\",\"trace_id\":\"08246763-f961-45fb-b262-51378bdbc955\"}\n[2026-04-14 10:07:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2b6586f0-419e-4422-8800-e4b7619c43d6\",\"trace_id\":\"221c682d-c45f-4e4a-a793-ed11006dc6a1\"}\n[2026-04-14 10:07:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2b6586f0-419e-4422-8800-e4b7619c43d6\",\"trace_id\":\"221c682d-c45f-4e4a-a793-ed11006dc6a1\"}\n[2026-04-14 10:07:08] local.NOTICE: Monitoring start {\"correlation_id\":\"9ba692ee-5286-41ca-abf0-86f6e1167a8e\",\"trace_id\":\"d58ab8ad-7737-4d7c-91c0-81733c21e709\"}\n[2026-04-14 10:07:08] local.NOTICE: Monitoring end {\"correlation_id\":\"9ba692ee-5286-41ca-abf0-86f6e1167a8e\",\"trace_id\":\"d58ab8ad-7737-4d7c-91c0-81733c21e709\"}\n[2026-04-14 10:07:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"28e708ed-74ee-4417-a8da-c1a9ae0cd745\",\"trace_id\":\"bd848201-9700-40bf-8fa4-9df13ae88f6e\"}\n[2026-04-14 10:07:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"28e708ed-74ee-4417-a8da-c1a9ae0cd745\",\"trace_id\":\"bd848201-9700-40bf-8fa4-9df13ae88f6e\"}\n[2026-04-14 10:07:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"95326c5a-7b17-475d-9245-634d15d51bfe\",\"trace_id\":\"31b36f9d-93cc-4917-bc7b-6b6a3da139e7\"}\n[2026-04-14 10:07:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"95326c5a-7b17-475d-9245-634d15d51bfe\",\"trace_id\":\"31b36f9d-93cc-4917-bc7b-6b6a3da139e7\"}\n[2026-04-14 10:07:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"95326c5a-7b17-475d-9245-634d15d51bfe\",\"trace_id\":\"31b36f9d-93cc-4917-bc7b-6b6a3da139e7\"}\n[2026-04-14 10:07:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"95326c5a-7b17-475d-9245-634d15d51bfe\",\"trace_id\":\"31b36f9d-93cc-4917-bc7b-6b6a3da139e7\"}\n[2026-04-14 10:07:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"f4f68165-0bcc-4e79-89e5-81f9c627e4dc\",\"trace_id\":\"5766aab2-0316-400f-aa89-168ea0579941\"}\n[2026-04-14 10:07:14] local.INFO: [EmailSchedule] STARTING batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"f4f68165-0bcc-4e79-89e5-81f9c627e4dc\",\"trace_id\":\"5766aab2-0316-400f-aa89-168ea0579941\"}\n[2026-04-14 10:07:14] local.INFO: [EmailSchedule] FINISHED batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"f4f68165-0bcc-4e79-89e5-81f9c627e4dc\",\"trace_id\":\"5766aab2-0316-400f-aa89-168ea0579941\"}\n[2026-04-14 10:07:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"f4f68165-0bcc-4e79-89e5-81f9c627e4dc\",\"trace_id\":\"5766aab2-0316-400f-aa89-168ea0579941\"}\n[2026-04-14 10:07:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a7d5580f-8b90-4ff6-91e8-de94514f8ca1\",\"trace_id\":\"fc40909d-86c1-4e45-bd51-96e2bd8c4556\"}\n[2026-04-14 10:07:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a7d5580f-8b90-4ff6-91e8-de94514f8ca1\",\"trace_id\":\"fc40909d-86c1-4e45-bd51-96e2bd8c4556\"}\n[2026-04-14 10:07:16] local.INFO: [Jiminny\\Jobs\\Mailbox\\CreateBatches] processed 0 inboxes and created 0 batches {\"userId\":null,\"batchSize\":30,\"maxBatches\":1000} {\"correlation_id\":\"df4d1442-bcd6-4b63-8513-802ae90993e6\",\"trace_id\":\"5766aab2-0316-400f-aa89-168ea0579941\"}\n[2026-04-14 10:08:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"43299ccb-af86-42b1-b793-4ede57e2b91d\",\"trace_id\":\"2f919b69-9d68-488c-89fa-2aade6ef8519\"}\n[2026-04-14 10:08:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"43299ccb-af86-42b1-b793-4ede57e2b91d\",\"trace_id\":\"2f919b69-9d68-488c-89fa-2aade6ef8519\"}\n[2026-04-14 10:08:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"43299ccb-af86-42b1-b793-4ede57e2b91d\",\"trace_id\":\"2f919b69-9d68-488c-89fa-2aade6ef8519\"}\n[2026-04-14 10:08:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"cde80757-333e-4268-a902-892c031b2373\",\"trace_id\":\"36e932e0-8362-432f-9e36-d819f902d49e\"}\n[2026-04-14 10:08:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"cde80757-333e-4268-a902-892c031b2373\",\"trace_id\":\"36e932e0-8362-432f-9e36-d819f902d49e\"}\n[2026-04-14 10:08:07] local.NOTICE: Monitoring start {\"correlation_id\":\"146390f8-e91a-4e5c-b282-0c83b4947101\",\"trace_id\":\"fb689e40-c867-4fc5-9847-c223835da80e\"}\n[2026-04-14 10:08:07] local.NOTICE: Monitoring end {\"correlation_id\":\"146390f8-e91a-4e5c-b282-0c83b4947101\",\"trace_id\":\"fb689e40-c867-4fc5-9847-c223835da80e\"}\n[2026-04-14 10:08:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"58e23da5-8f3f-4836-aac7-315ab32f74a3\",\"trace_id\":\"c71267c4-b5fe-42ad-9bcd-76f6299c1538\"}\n[2026-04-14 10:08:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"58e23da5-8f3f-4836-aac7-315ab32f74a3\",\"trace_id\":\"c71267c4-b5fe-42ad-9bcd-76f6299c1538\"}\n[2026-04-14 10:08:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"9158bb6f-c165-495a-9b6e-8077d8343c87\",\"trace_id\":\"df378af8-cacb-41ea-b030-b8f53144fddd\"}\n[2026-04-14 10:08:13] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"9158bb6f-c165-495a-9b6e-8077d8343c87\",\"trace_id\":\"df378af8-cacb-41ea-b030-b8f53144fddd\"}\n[2026-04-14 10:08:13] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"9158bb6f-c165-495a-9b6e-8077d8343c87\",\"trace_id\":\"df378af8-cacb-41ea-b030-b8f53144fddd\"}\n[2026-04-14 10:08:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"9158bb6f-c165-495a-9b6e-8077d8343c87\",\"trace_id\":\"df378af8-cacb-41ea-b030-b8f53144fddd\"}\n[2026-04-14 10:08:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"35774df7-e046-49ec-835f-45f9dc1ec025\",\"trace_id\":\"45c5e102-6b65-4d23-9edd-684ca996316c\"}\n[2026-04-14 10:08:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:06:00, 2026-04-14 10:08:00] {\"correlation_id\":\"35774df7-e046-49ec-835f-45f9dc1ec025\",\"trace_id\":\"45c5e102-6b65-4d23-9edd-684ca996316c\"}\n[2026-04-14 10:08:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:06:00, 2026-04-14 10:08:00] {\"correlation_id\":\"35774df7-e046-49ec-835f-45f9dc1ec025\",\"trace_id\":\"45c5e102-6b65-4d23-9edd-684ca996316c\"}\n[2026-04-14 10:08:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"35774df7-e046-49ec-835f-45f9dc1ec025\",\"trace_id\":\"45c5e102-6b65-4d23-9edd-684ca996316c\"}\n[2026-04-14 10:08:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d4dc4b3b-8dc8-4665-aec7-139be0df2306\",\"trace_id\":\"853f2210-e804-40aa-a1d8-4457c60f4993\"}\n[2026-04-14 10:08:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d4dc4b3b-8dc8-4665-aec7-139be0df2306\",\"trace_id\":\"853f2210-e804-40aa-a1d8-4457c60f4993\"}\n[2026-04-14 10:09:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8052fb2f-5876-4e2c-8f64-c770d9fe37fe\",\"trace_id\":\"63249c19-bf59-4e52-9096-156d537a9786\"}\n[2026-04-14 10:09:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"8052fb2f-5876-4e2c-8f64-c770d9fe37fe\",\"trace_id\":\"63249c19-bf59-4e52-9096-156d537a9786\"}\n[2026-04-14 10:09:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8052fb2f-5876-4e2c-8f64-c770d9fe37fe\",\"trace_id\":\"63249c19-bf59-4e52-9096-156d537a9786\"}\n[2026-04-14 10:09:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"1dd274b4-f71d-486e-b6c4-aaf106304102\",\"trace_id\":\"1d55139c-a58d-4456-801a-9bcb3bf9b024\"}\n[2026-04-14 10:09:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"1dd274b4-f71d-486e-b6c4-aaf106304102\",\"trace_id\":\"1d55139c-a58d-4456-801a-9bcb3bf9b024\"}\n[2026-04-14 10:09:10] local.NOTICE: Monitoring start {\"correlation_id\":\"09dc762e-2b78-4dbb-a880-5c8f1cbfc4ad\",\"trace_id\":\"8e60392d-4ea4-41f2-be2f-a01853c7a1ab\"}\n[2026-04-14 10:09:10] local.NOTICE: Monitoring end {\"correlation_id\":\"09dc762e-2b78-4dbb-a880-5c8f1cbfc4ad\",\"trace_id\":\"8e60392d-4ea4-41f2-be2f-a01853c7a1ab\"}\n[2026-04-14 10:09:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2de9f84e-2691-459d-adfd-f5f6746501d0\",\"trace_id\":\"418ad958-86c0-4477-b0fb-e487768d6fa1\"}\n[2026-04-14 10:09:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2de9f84e-2691-459d-adfd-f5f6746501d0\",\"trace_id\":\"418ad958-86c0-4477-b0fb-e487768d6fa1\"}\n[2026-04-14 10:09:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"1be8488c-ae59-4f42-8475-c426905c3ca6\",\"trace_id\":\"aeb8b412-635e-4929-915f-fb3fe5786eae\"}\n[2026-04-14 10:09:16] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"1be8488c-ae59-4f42-8475-c426905c3ca6\",\"trace_id\":\"aeb8b412-635e-4929-915f-fb3fe5786eae\"}\n[2026-04-14 10:09:16] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"1be8488c-ae59-4f42-8475-c426905c3ca6\",\"trace_id\":\"aeb8b412-635e-4929-915f-fb3fe5786eae\"}\n[2026-04-14 10:09:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"1be8488c-ae59-4f42-8475-c426905c3ca6\",\"trace_id\":\"aeb8b412-635e-4929-915f-fb3fe5786eae\"}\n[2026-04-14 10:09:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:aircall:check-and-renew\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:18] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1496,\"provider\":\"aircall\"} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:18] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1496,\"provider\":\"aircall\"} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:18] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:18] local.ERROR: [Aircall] Re-activating webhooks failed {\"team_id\":1,\"reason\":\"{\\\"message\\\":\\\"Forbidden\\\"}\"} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:aircall:check-and-renew\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b3d1b688-309f-4df0-9dcd-9a733c87f597\",\"trace_id\":\"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c\"}\n[2026-04-14 10:09:21] local.INFO: [RetryFailedDownloads] Starting {\"options\":{\"from\":null,\"to\":null,\"help\":false,\"silent\":false,\"quiet\":false,\"verbose\":false,\"version\":false,\"ansi\":null,\"no-interaction\":false,\"env\":null}} {\"correlation_id\":\"c7aba065-c8f1-473d-b8b5-4797245873bf\",\"trace_id\":\"48f587f9-dd77-4634-9ad9-1137b029b5f5\"}\n[2026-04-14 10:10:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"7310aae5-3829-4d5c-bbc9-f6550a35f539\",\"trace_id\":\"6099cf10-45e2-4b82-9649-649e2f8a1209\"}\n[2026-04-14 10:10:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"7310aae5-3829-4d5c-bbc9-f6550a35f539\",\"trace_id\":\"6099cf10-45e2-4b82-9649-649e2f8a1209\"}\n[2026-04-14 10:10:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"7310aae5-3829-4d5c-bbc9-f6550a35f539\",\"trace_id\":\"6099cf10-45e2-4b82-9649-649e2f8a1209\"}\n[2026-04-14 10:10:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"5119d94e-0c61-4312-a740-2b569388cc9f\",\"trace_id\":\"6a412a32-3bc3-46a4-af7c-24ad560a4e41\"}\n[2026-04-14 10:10:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"5119d94e-0c61-4312-a740-2b569388cc9f\",\"trace_id\":\"6a412a32-3bc3-46a4-af7c-24ad560a4e41\"}\n[2026-04-14 10:10:08] local.NOTICE: Monitoring start {\"correlation_id\":\"95cdb3b7-b356-4325-be28-20663ece6aa0\",\"trace_id\":\"e64a75a4-2493-4f35-ba46-ccd002e6b7b7\"}\n[2026-04-14 10:10:08] local.NOTICE: Monitoring end {\"correlation_id\":\"95cdb3b7-b356-4325-be28-20663ece6aa0\",\"trace_id\":\"e64a75a4-2493-4f35-ba46-ccd002e6b7b7\"}\n[2026-04-14 10:10:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"6460dd5f-4b94-4cd1-867e-53304d785744\",\"trace_id\":\"683b103d-2dfc-4266-84a2-d5cd799b133f\"}\n[2026-04-14 10:10:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"6460dd5f-4b94-4cd1-867e-53304d785744\",\"trace_id\":\"683b103d-2dfc-4266-84a2-d5cd799b133f\"}\n[2026-04-14 10:10:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"5a59007d-2a12-4977-8a5a-59c678aa12ee\",\"trace_id\":\"bc3a2ad5-9f13-4728-adaa-529da75cf011\"}\n[2026-04-14 10:10:11] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"5a59007d-2a12-4977-8a5a-59c678aa12ee\",\"trace_id\":\"bc3a2ad5-9f13-4728-adaa-529da75cf011\"}\n[2026-04-14 10:10:11] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"5a59007d-2a12-4977-8a5a-59c678aa12ee\",\"trace_id\":\"bc3a2ad5-9f13-4728-adaa-529da75cf011\"}\n[2026-04-14 10:10:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"5a59007d-2a12-4977-8a5a-59c678aa12ee\",\"trace_id\":\"bc3a2ad5-9f13-4728-adaa-529da75cf011\"}\n[2026-04-14 10:10:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"afe2ff6b-1b9e-4485-bdad-a758d873a782\",\"trace_id\":\"d507becf-55d6-4fda-8831-e981f95b85c8\"}\n[2026-04-14 10:10:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:08:00, 2026-04-14 10:10:00] {\"correlation_id\":\"afe2ff6b-1b9e-4485-bdad-a758d873a782\",\"trace_id\":\"d507becf-55d6-4fda-8831-e981f95b85c8\"}\n[2026-04-14 10:10:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:08:00, 2026-04-14 10:10:00] {\"correlation_id\":\"afe2ff6b-1b9e-4485-bdad-a758d873a782\",\"trace_id\":\"d507becf-55d6-4fda-8831-e981f95b85c8\"}\n[2026-04-14 10:10:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"afe2ff6b-1b9e-4485-bdad-a758d873a782\",\"trace_id\":\"d507becf-55d6-4fda-8831-e981f95b85c8\"}\n[2026-04-14 10:10:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ebe2ad2b-df9a-48d7-b78f-d52b7489c6f0\",\"trace_id\":\"05b44216-d5ac-44cd-b74b-3e92567b192d\"}\n[2026-04-14 10:10:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ebe2ad2b-df9a-48d7-b78f-d52b7489c6f0\",\"trace_id\":\"05b44216-d5ac-44cd-b74b-3e92567b192d\"}\n[2026-04-14 10:10:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d76b00ee-6271-4df7-ba45-769738bbb7ae\",\"trace_id\":\"92384790-9588-452d-abea-cdd25a2fe7ff\"}\n[2026-04-14 10:10:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d76b00ee-6271-4df7-ba45-769738bbb7ae\",\"trace_id\":\"92384790-9588-452d-abea-cdd25a2fe7ff\"}\n[2026-04-14 10:10:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"c8f3b5c1-bef5-4584-b9d8-0c10578fefac\",\"trace_id\":\"b700f03d-b02b-495e-b505-1598c7a9ea4b\"}\n[2026-04-14 10:10:20] local.INFO: Running pre-meeting notification command {\"correlation_id\":\"c8f3b5c1-bef5-4584-b9d8-0c10578fefac\",\"trace_id\":\"b700f03d-b02b-495e-b505-1598c7a9ea4b\"}\n[2026-04-14 10:10:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"c8f3b5c1-bef5-4584-b9d8-0c10578fefac\",\"trace_id\":\"b700f03d-b02b-495e-b505-1598c7a9ea4b\"}\n[2026-04-14 10:10:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d7b97fbb-00b9-47c2-ae81-dda03fd8b253\",\"trace_id\":\"54447306-49bf-4629-8de0-bb191c61cce2\"}\n[2026-04-14 10:10:22] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 10:00:00, 2026-04-14 10:05:00] {\"correlation_id\":\"d7b97fbb-00b9-47c2-ae81-dda03fd8b253\",\"trace_id\":\"54447306-49bf-4629-8de0-bb191c61cce2\"}\n[2026-04-14 10:10:22] local.INFO: [conference:monitor:start] No activities found in (2026-04-14 10:00:00, 2026-04-14 10:05:00] {\"correlation_id\":\"d7b97fbb-00b9-47c2-ae81-dda03fd8b253\",\"trace_id\":\"54447306-49bf-4629-8de0-bb191c61cce2\"}\n[2026-04-14 10:10:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d7b97fbb-00b9-47c2-ae81-dda03fd8b253\",\"trace_id\":\"54447306-49bf-4629-8de0-bb191c61cce2\"}\n[2026-04-14 10:10:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"07665538-664f-421e-af9b-97152a688b68\",\"trace_id\":\"d116813e-2d96-4a3d-ae04-6e53d69ca565\"}\n[2026-04-14 10:10:23] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesEnded {\"from\":\"10:05\",\"to\":\"10:10\"} {\"correlation_id\":\"07665538-664f-421e-af9b-97152a688b68\",\"trace_id\":\"d116813e-2d96-4a3d-ae04-6e53d69ca565\"}\n[2026-04-14 10:10:23] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {\"from\":\"00:00\",\"to\":\"00:05\"} {\"correlation_id\":\"07665538-664f-421e-af9b-97152a688b68\",\"trace_id\":\"d116813e-2d96-4a3d-ae04-6e53d69ca565\"}\n[2026-04-14 10:10:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"07665538-664f-421e-af9b-97152a688b68\",\"trace_id\":\"d116813e-2d96-4a3d-ae04-6e53d69ca565\"}\n[2026-04-14 10:10:25] local.NOTICE: Repairing HubSpot tokens start {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:25] local.INFO: Trying to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:25] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:25] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":59,\"provider\":\"hubspot\",\"refreshToken\":\"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":306,\"provider\":\"hubspot\",\"refreshToken\":\"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1372,\"provider\":\"hubspot\",\"refreshToken\":\"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:27] local.ERROR: Failed to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:27] local.NOTICE: Repairing HubSpot tokens end {\"total\":3,\"fixed\":0,\"failed\":3} {\"correlation_id\":\"d269668d-cb18-4aeb-9a05-13a9e53195ed\",\"trace_id\":\"ecbe2fde-809f-4720-8113-609eda111b53\"}\n[2026-04-14 10:10:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"cba13635-8dbf-4423-ad70-69f2d927c6ff\",\"trace_id\":\"cca585f7-e8b4-4cbd-b63f-8d9be90960a6\"}\n[2026-04-14 10:10:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"jiminny:transcription:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8d29e53b-638b-4e55-8ee6-70567699b366\",\"trace_id\":\"ac17c380-0e7e-4425-bbc9-9e292ed99ea5\"}\n[2026-04-14 10:10:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"jiminny:transcription:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8d29e53b-638b-4e55-8ee6-70567699b366\",\"trace_id\":\"ac17c380-0e7e-4425-bbc9-9e292ed99ea5\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Command] Starting polling service {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Polling] Service starting {\"memory_limit\":\"256M\",\"max_execution_time\":\"0\",\"initial_memory_mb\":62.0} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Polling] Acquired polling lock {\"expires_at\":\"2026-04-14T10:12:30.407181Z\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"cba13635-8dbf-4423-ad70-69f2d927c6ff\",\"trace_id\":\"cca585f7-e8b4-4cbd-b63f-8d9be90960a6\"}\n[2026-04-14 10:10:30] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:32] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:reset-governor\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"4943604a-02ac-42cd-82ee-524a684c9d07\",\"trace_id\":\"dea56e3f-9697-4054-8b54-7db752a8613f\"}\n[2026-04-14 10:10:32] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:reset-governor\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"4943604a-02ac-42cd-82ee-524a684c9d07\",\"trace_id\":\"dea56e3f-9697-4054-8b54-7db752a8613f\"}\n[2026-04-14 10:10:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"7ae1dc8e-0ce6-461b-a054-be59c56de0b5\",\"trace_id\":\"8892af7b-37c9-4892-82fd-aa4596edc512\"}\n[2026-04-14 10:10:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"7ae1dc8e-0ce6-461b-a054-be59c56de0b5\",\"trace_id\":\"8892af7b-37c9-4892-82fd-aa4596edc512\"}\n[2026-04-14 10:10:35] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:35] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:35] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:40] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:40] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:41] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:56] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:56] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:10:56] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"79c8dc9b-058f-4f0e-9e9a-2e34a66209a7\",\"trace_id\":\"c6894787-c096-4c96-96cf-8ed81e40aa59\"}\n[2026-04-14 10:11:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"79c8dc9b-058f-4f0e-9e9a-2e34a66209a7\",\"trace_id\":\"c6894787-c096-4c96-96cf-8ed81e40aa59\"}\n[2026-04-14 10:11:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"79c8dc9b-058f-4f0e-9e9a-2e34a66209a7\",\"trace_id\":\"c6894787-c096-4c96-96cf-8ed81e40aa59\"}\n[2026-04-14 10:11:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d52d55c7-74a3-409b-b458-fecfd8990f5a\",\"trace_id\":\"407ded8c-1b50-4ba7-8190-f3e84814124e\"}\n[2026-04-14 10:11:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d52d55c7-74a3-409b-b458-fecfd8990f5a\",\"trace_id\":\"407ded8c-1b50-4ba7-8190-f3e84814124e\"}\n[2026-04-14 10:11:08] local.NOTICE: Monitoring start {\"correlation_id\":\"296fc7a0-329d-43bf-8c98-547c407c447c\",\"trace_id\":\"d2bbc8a9-18cb-408f-98a9-f87d6a2e4cb9\"}\n[2026-04-14 10:11:08] local.NOTICE: Monitoring end {\"correlation_id\":\"296fc7a0-329d-43bf-8c98-547c407c447c\",\"trace_id\":\"d2bbc8a9-18cb-408f-98a9-f87d6a2e4cb9\"}\n[2026-04-14 10:11:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"4aaf62d1-0d46-4f16-af0e-0617eb460382\",\"trace_id\":\"7bcc5249-9d16-44e5-a83c-3a613e00c860\"}\n[2026-04-14 10:11:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"4aaf62d1-0d46-4f16-af0e-0617eb460382\",\"trace_id\":\"7bcc5249-9d16-44e5-a83c-3a613e00c860\"}\n[2026-04-14 10:11:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"19290448-0263-4849-93fc-f09885da0c1f\",\"trace_id\":\"1483761c-464c-4374-994f-121758fcd534\"}\n[2026-04-14 10:11:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"19290448-0263-4849-93fc-f09885da0c1f\",\"trace_id\":\"1483761c-464c-4374-994f-121758fcd534\"}\n[2026-04-14 10:11:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"19290448-0263-4849-93fc-f09885da0c1f\",\"trace_id\":\"1483761c-464c-4374-994f-121758fcd534\"}\n[2026-04-14 10:11:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"19290448-0263-4849-93fc-f09885da0c1f\",\"trace_id\":\"1483761c-464c-4374-994f-121758fcd534\"}\n[2026-04-14 10:11:26] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.INFO: [HubSpot Journal Polling] Service ending {\"runtime_seconds\":56,\"total_cycles\":5,\"files_downloaded\":0,\"empty_files\":0,\"other_portal_skipped\":0,\"total_events\":0,\"events_per_file\":0,\"avg_api_ms\":252.2,\"avg_download_ms\":0.0,\"avg_transform_ms\":0.0,\"avg_process_ms\":0.0,\"peak_memory_mb\":99.75} {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:11:26] local.INFO: [HubSpot Journal Polling] Released polling lock {\"correlation_id\":\"f896bee6-1a5b-4790-8dd6-af38522db495\",\"trace_id\":\"6ba6c565-e21f-41ef-9f42-301c78a24f31\"}\n[2026-04-14 10:12:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"74ad5a14-81b2-48f4-bb37-2d2ac73c5059\",\"trace_id\":\"6d6d809e-3d77-400c-a351-ac4db72cf3fc\"}\n[2026-04-14 10:12:07] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"74ad5a14-81b2-48f4-bb37-2d2ac73c5059\",\"trace_id\":\"6d6d809e-3d77-400c-a351-ac4db72cf3fc\"}\n[2026-04-14 10:12:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"74ad5a14-81b2-48f4-bb37-2d2ac73c5059\",\"trace_id\":\"6d6d809e-3d77-400c-a351-ac4db72cf3fc\"}\n[2026-04-14 10:12:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3671d2e5-29f6-43db-8f1a-4a0bf5ff669b\",\"trace_id\":\"1295351d-9c37-47db-bad6-dbccb4c6466f\"}\n[2026-04-14 10:12:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3671d2e5-29f6-43db-8f1a-4a0bf5ff669b\",\"trace_id\":\"1295351d-9c37-47db-bad6-dbccb4c6466f\"}\n[2026-04-14 10:12:11] local.NOTICE: Monitoring start {\"correlation_id\":\"f2d467c8-e822-4691-9920-cac071f14877\",\"trace_id\":\"4d67db65-374a-4eb2-9cc6-8c60dc9ebabc\"}\n[2026-04-14 10:12:11] local.NOTICE: Monitoring end {\"correlation_id\":\"f2d467c8-e822-4691-9920-cac071f14877\",\"trace_id\":\"4d67db65-374a-4eb2-9cc6-8c60dc9ebabc\"}\n[2026-04-14 10:12:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"04d8a469-317c-40e1-a163-ad747408f9e3\",\"trace_id\":\"bafa4d05-7e55-4524-b0a5-1764ecb964fe\"}\n[2026-04-14 10:12:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"04d8a469-317c-40e1-a163-ad747408f9e3\",\"trace_id\":\"bafa4d05-7e55-4524-b0a5-1764ecb964fe\"}\n[2026-04-14 10:12:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3cd3a658-bd65-4253-9c8d-b94cdd2f3c4d\",\"trace_id\":\"5ae25493-7098-481f-84f4-225c6595b140\"}\n[2026-04-14 10:12:20] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"3cd3a658-bd65-4253-9c8d-b94cdd2f3c4d\",\"trace_id\":\"5ae25493-7098-481f-84f4-225c6595b140\"}\n[2026-04-14 10:12:20] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"3cd3a658-bd65-4253-9c8d-b94cdd2f3c4d\",\"trace_id\":\"5ae25493-7098-481f-84f4-225c6595b140\"}\n[2026-04-14 10:12:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3cd3a658-bd65-4253-9c8d-b94cdd2f3c4d\",\"trace_id\":\"5ae25493-7098-481f-84f4-225c6595b140\"}\n[2026-04-14 10:12:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"4cabe4c8-81a7-4405-958c-783cc42dc31a\",\"trace_id\":\"844b27d2-1727-4f1a-bb9a-a3ad44d9d37a\"}\n[2026-04-14 10:12:22] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:10:00, 2026-04-14 10:12:00] {\"correlation_id\":\"4cabe4c8-81a7-4405-958c-783cc42dc31a\",\"trace_id\":\"844b27d2-1727-4f1a-bb9a-a3ad44d9d37a\"}\n[2026-04-14 10:12:22] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:10:00, 2026-04-14 10:12:00] {\"correlation_id\":\"4cabe4c8-81a7-4405-958c-783cc42dc31a\",\"trace_id\":\"844b27d2-1727-4f1a-bb9a-a3ad44d9d37a\"}\n[2026-04-14 10:12:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"4cabe4c8-81a7-4405-958c-783cc42dc31a\",\"trace_id\":\"844b27d2-1727-4f1a-bb9a-a3ad44d9d37a\"}\n[2026-04-14 10:12:25] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b573f9e3-5771-4b03-9fd9-1ff7d571916d\",\"trace_id\":\"e76af6ed-1fff-4aef-8b17-a8288121b37a\"}\n[2026-04-14 10:12:25] local.INFO: [EmailSchedule] STARTING batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"b573f9e3-5771-4b03-9fd9-1ff7d571916d\",\"trace_id\":\"e76af6ed-1fff-4aef-8b17-a8288121b37a\"}\n[2026-04-14 10:12:25] local.INFO: [EmailSchedule] FINISHED batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"b573f9e3-5771-4b03-9fd9-1ff7d571916d\",\"trace_id\":\"e76af6ed-1fff-4aef-8b17-a8288121b37a\"}\n[2026-04-14 10:12:25] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b573f9e3-5771-4b03-9fd9-1ff7d571916d\",\"trace_id\":\"e76af6ed-1fff-4aef-8b17-a8288121b37a\"}\n[2026-04-14 10:12:27] local.INFO: [Jiminny\\Jobs\\Mailbox\\CreateBatches] processed 0 inboxes and created 0 batches {\"userId\":null,\"batchSize\":30,\"maxBatches\":1000} {\"correlation_id\":\"ad382f07-8ff8-450f-b38c-fba577285d06\",\"trace_id\":\"e76af6ed-1fff-4aef-8b17-a8288121b37a\"}\n[2026-04-14 10:13:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"24a30c58-6ce4-427b-972e-87df2b1f0d31\",\"trace_id\":\"30809930-a6a8-49bb-9c61-f4dcca23683a\"}\n[2026-04-14 10:13:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"24a30c58-6ce4-427b-972e-87df2b1f0d31\",\"trace_id\":\"30809930-a6a8-49bb-9c61-f4dcca23683a\"}\n[2026-04-14 10:13:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"24a30c58-6ce4-427b-972e-87df2b1f0d31\",\"trace_id\":\"30809930-a6a8-49bb-9c61-f4dcca23683a\"}\n[2026-04-14 10:13:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"db368cd5-b4ea-4f77-8169-24ff5403199d\",\"trace_id\":\"0bd7332d-c4c1-44b6-b204-e68b8ec6217a\"}\n[2026-04-14 10:13:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"db368cd5-b4ea-4f77-8169-24ff5403199d\",\"trace_id\":\"0bd7332d-c4c1-44b6-b204-e68b8ec6217a\"}\n[2026-04-14 10:13:08] local.NOTICE: Monitoring start {\"correlation_id\":\"98628e85-9d56-4088-8ddb-5a33768305d6\",\"trace_id\":\"138288e6-6342-4250-9c1e-46921c407423\"}\n[2026-04-14 10:13:08] local.NOTICE: Monitoring end {\"correlation_id\":\"98628e85-9d56-4088-8ddb-5a33768305d6\",\"trace_id\":\"138288e6-6342-4250-9c1e-46921c407423\"}\n[2026-04-14 10:13:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"191fc76f-8aee-4891-810a-9844b5c123e4\",\"trace_id\":\"de876f70-8b00-416a-9ef4-dc20ca777b2b\"}\n[2026-04-14 10:13:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"191fc76f-8aee-4891-810a-9844b5c123e4\",\"trace_id\":\"de876f70-8b00-416a-9ef4-dc20ca777b2b\"}\n[2026-04-14 10:13:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3a813447-0014-4324-97a7-8822d7421613\",\"trace_id\":\"bf64c0c0-add2-496f-8abc-688f5b875ba3\"}\n[2026-04-14 10:13:13] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"3a813447-0014-4324-97a7-8822d7421613\",\"trace_id\":\"bf64c0c0-add2-496f-8abc-688f5b875ba3\"}\n[2026-04-14 10:13:13] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"3a813447-0014-4324-97a7-8822d7421613\",\"trace_id\":\"bf64c0c0-add2-496f-8abc-688f5b875ba3\"}\n[2026-04-14 10:13:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3a813447-0014-4324-97a7-8822d7421613\",\"trace_id\":\"bf64c0c0-add2-496f-8abc-688f5b875ba3\"}\n[2026-04-14 10:13:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"calendar:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"916686b7-6af9-48a2-95ef-2c9d7d13e032\",\"trace_id\":\"95ff9408-a142-42fc-b246-65098def557d\"}\n[2026-04-14 10:13:15] local.NOTICE: Calendar sync start {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"916686b7-6af9-48a2-95ef-2c9d7d13e032\",\"trace_id\":\"95ff9408-a142-42fc-b246-65098def557d\"}\n[2026-04-14 10:13:15] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1393,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:15] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1393,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:15] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:15] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1393,\"provider\":\"google\",\"refreshToken\":\"5aa7e2d96b53201cd16fca5d2e4ef3ad03320971fc064781d18aee3ae7b99fbf\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1393,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Account has been deleted\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1393,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1387,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1387,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1387,\"provider\":\"google\",\"refreshToken\":\"8157ac6de94842937194009e9c50e459253600f799dacf6a40755ffdbeb5bba6\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1387,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Account has been deleted\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1387,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1348,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1348,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1348,\"provider\":\"google\",\"refreshToken\":\"9e7d13d3032d0cb1b79d8e95aef01383e8e91eb52ff8ee960c8a0b6b95cd8c73\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1348,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1348,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1361,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1361,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1361,\"provider\":\"google\",\"refreshToken\":\"6c843da199c2b9907445329304fcc4ec5057a4ee748d8299641764395c08e1fd\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1361,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Account has been deleted\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1361,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1310,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1310,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1310,\"provider\":\"google\",\"refreshToken\":\"e34818922c2830a660813a63f6169a4a9a992ae2cccd7dc8dd7796cfdb470ef1\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1310,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1310,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1333,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1333,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:16] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1333,\"provider\":\"google\",\"refreshToken\":\"6c902986546d8e8da1dc539b046cdc1d458f519acc972e5b5f1d6a1a295165e0\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1333,\"provider\":\"google\",\"responseBody\":{\"error\":\"unauthorized_client\",\"error_description\":\"Unauthorized\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1333,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1368,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1368,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1368,\"provider\":\"google\",\"refreshToken\":\"d2f128898ff8543bd16b69cfae37896ab85119b0f5ed2b431d739593bb600333\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1368,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1368,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1365,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1365,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1365,\"provider\":\"google\",\"refreshToken\":\"7676e4a9afcd082b413248ab5ec6e487021fec6a9bdf315860a59cefad9caad8\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1365,\"provider\":\"google\",\"responseBody\":{\"error\":\"unauthorized_client\",\"error_description\":\"Unauthorized\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1365,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1364,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1364,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1364,\"provider\":\"google\",\"refreshToken\":\"dd5882ebce76e645292ce33ae74238abbb77c0a4ecc6a2bfe723cad82e72ba8e\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1364,\"provider\":\"google\",\"responseBody\":{\"error\":\"unauthorized_client\",\"error_description\":\"Unauthorized\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1364,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1370,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1370,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:17] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1370,\"provider\":\"office\",\"refreshToken\":\"b7ee8035306d0043cea6e00e7c4fe14f745e44074a1194db62a31cdf8b70af3e\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1370,\"provider\":\"office\",\"responseBody\":\"{\\\"error\\\":\\\"invalid_client\\\",\\\"error_description\\\":\\\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: a0c9f2b7-cb01-4abd-bacf-45d9e5680400 Correlation ID: 9a0f522e-1b07-4873-b073-d968cd65c74b Timestamp: 2026-04-14 10:13:18Z\\\",\\\"error_codes\\\":[7000215],\\\"timestamp\\\":\\\"2026-04-14 10:13:18Z\\\",\\\"trace_id\\\":\\\"a0c9f2b7-cb01-4abd-bacf-45d9e5680400\\\",\\\"correlation_id\\\":\\\"9a0f522e-1b07-4873-b073-d968cd65c74b\\\",\\\"error_uri\\\":\\\"https://login.microsoftonline.com/error?code=7000215\\\"}\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1370,\"provider\":\"office\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1202,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1202,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1202,\"provider\":\"office\",\"refreshToken\":\"b458799ccc29b21a6e2eb5260fdb63e49ccba21bf942a3973fb63799bd7f0afe\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1202,\"provider\":\"office\",\"responseBody\":\"{\\\"error\\\":\\\"invalid_client\\\",\\\"error_description\\\":\\\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 5fa1c342-7a85-4360-a1e3-44a1c6370000 Correlation ID: 10659d65-6337-4391-917e-475a77864114 Timestamp: 2026-04-14 10:13:18Z\\\",\\\"error_codes\\\":[7000215],\\\"timestamp\\\":\\\"2026-04-14 10:13:18Z\\\",\\\"trace_id\\\":\\\"5fa1c342-7a85-4360-a1e3-44a1c6370000\\\",\\\"correlation_id\\\":\\\"10659d65-6337-4391-917e-475a77864114\\\",\\\"error_uri\\\":\\\"https://login.microsoftonline.com/error?code=7000215\\\"}\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1202,\"provider\":\"office\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1413,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1413,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:18] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1413,\"provider\":\"google\",\"refreshToken\":\"6a7e45d818a56cd2bd3910c52eaa9acd00553369b353f8b7527fa82d3e319ce5\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1413,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1413,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1300,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1300,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1300,\"provider\":\"google\",\"refreshToken\":\"4b811db0725fd9602a95943519a7da935e2a5065da7d9ebfcb170752e3e1ddb8\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1300,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Account has been deleted\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1300,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1409,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1409,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1409,\"provider\":\"google\",\"refreshToken\":\"e2a3f2d06894894eed1ee87d9db1ace77d4d42ee6e1288a8940ad2c10333b0c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1409,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1409,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1352,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1352,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1352,\"provider\":\"google\",\"refreshToken\":\"dd4b16b00fdc1216da6b717c02338c073636e29162826b2de6db3f064fc029eb\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1352,\"provider\":\"google\",\"responseBody\":{\"error\":\"unauthorized_client\",\"error_description\":\"Unauthorized\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1352,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1296,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1296,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:19] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1296,\"provider\":\"office\",\"refreshToken\":\"011ae723c9d800c674e0b4be76f49fc046dac7d501b66c59ef0d9549cfa56ae5\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1296,\"provider\":\"office\",\"responseBody\":\"{\\\"error\\\":\\\"invalid_client\\\",\\\"error_description\\\":\\\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 18225c04-d579-4feb-87cc-c77995f60000 Correlation ID: 561c3e60-8cb1-4ded-a828-9d9910fc2906 Timestamp: 2026-04-14 10:13:20Z\\\",\\\"error_codes\\\":[7000215],\\\"timestamp\\\":\\\"2026-04-14 10:13:20Z\\\",\\\"trace_id\\\":\\\"18225c04-d579-4feb-87cc-c77995f60000\\\",\\\"correlation_id\\\":\\\"561c3e60-8cb1-4ded-a828-9d9910fc2906\\\",\\\"error_uri\\\":\\\"https://login.microsoftonline.com/error?code=7000215\\\"}\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1296,\"provider\":\"office\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":391,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":391,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:20] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":391,\"provider\":\"office\",\"refreshToken\":\"00045eebae0f39b34887c6d53f92ae78064f7145e1f4b67754aebd03cfb2d881\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":391,\"provider\":\"office\",\"responseBody\":\"{\\\"error\\\":\\\"invalid_client\\\",\\\"error_description\\\":\\\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: ad87e582-d425-4a80-a031-e4e93c450d00 Correlation ID: 0f0dc5e5-577a-488b-8b3c-aa0496be85ed Timestamp: 2026-04-14 10:13:21Z\\\",\\\"error_codes\\\":[7000215],\\\"timestamp\\\":\\\"2026-04-14 10:13:21Z\\\",\\\"trace_id\\\":\\\"ad87e582-d425-4a80-a031-e4e93c450d00\\\",\\\"correlation_id\\\":\\\"0f0dc5e5-577a-488b-8b3c-aa0496be85ed\\\",\\\"error_uri\\\":\\\"https://login.microsoftonline.com/error?code=7000215\\\"}\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":391,\"provider\":\"office\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1271,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1271,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1271,\"provider\":\"office\",\"refreshToken\":\"118cde2c06993147b07ccaec4cbcd5026a819dea6c71081166a492933e392afb\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1271,\"provider\":\"office\",\"responseBody\":\"{\\\"error\\\":\\\"invalid_client\\\",\\\"error_description\\\":\\\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 6a87850e-2a13-4112-bde4-d6cab8f36000 Correlation ID: d3c34a80-e297-4c8f-a878-98e7c645b200 Timestamp: 2026-04-14 10:13:21Z\\\",\\\"error_codes\\\":[7000215],\\\"timestamp\\\":\\\"2026-04-14 10:13:21Z\\\",\\\"trace_id\\\":\\\"6a87850e-2a13-4112-bde4-d6cab8f36000\\\",\\\"correlation_id\\\":\\\"d3c34a80-e297-4c8f-a878-98e7c645b200\\\",\\\"error_uri\\\":\\\"https://login.microsoftonline.com/error?code=7000215\\\"}\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1271,\"provider\":\"office\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1351,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1351,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1351,\"provider\":\"google\",\"refreshToken\":\"4271d15b9e60a606439caddc68337f783e472c85b03dacff14d1b6dfded9051c\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1351,\"provider\":\"google\",\"responseBody\":{\"error\":\"unauthorized_client\",\"error_description\":\"Unauthorized\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1351,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1366,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1366,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:21] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1366,\"provider\":\"google\",\"refreshToken\":\"ae21385059b2eebfd43f68aecd56eccd702a1aabb6598f1f7ab594ed8af491b4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1366,\"provider\":\"google\",\"responseBody\":{\"error\":\"invalid_grant\",\"error_description\":\"Bad Request\"}} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.ERROR: [SocialAccountService] Failed to refresh token {\"socialAccountId\":1366,\"provider\":\"google\",\"reason\":\"Flow refresh required.\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1115,\"provider\":\"google\",\"refreshToken\":\"356b60f12e262a5e24d3042386ef47d6a6cfe3074c242f4426edcec8646192b1\",\"state\":\"connected\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountObserver] Access token was modified, encrypting {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Token refreshed {\"socialAccountId\":1115,\"provider\":\"google\",\"state\":\"connected\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: Calendar sync job dispatched {\"calendar_id\":378} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1421,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1421,\"provider\":\"office\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: Calendar sync job dispatched {\"calendar_id\":504} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.NOTICE: Calendar sync end {\"retrieved_calendars\":31,\"processed_calendars\":2} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"calendar:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"48c4fb92-8067-4621-940a-ea4be76cae0c\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [Calendar] Processing sync {\"calendarId\":\"2676cb6d-f86c-427e-bf78-591e388e3c1e\",\"from\":null,\"to\":null,\"delta\":\"CJ_x49O3jpIDEJ_x49O3jpIDGAUgw67KlwMow67KlwM=\",\"last_sync\":\"2026-01-19 07:48:40\",\"dateMode\":\"daily\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.WARNING: [Pipedrive] Account not connected for user {\"userId\":\"e6538737-e7b4-455f-a37a-3e79b665a220\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1116,\"sociable_id\":241,\"provider_user_id\":\"19555731\",\"expires\":1775683749,\"refresh_token_expires\":null,\"provider\":\"pipedrive\",\"state\":\"full-refresh\",\"auth_scope\":\"base,deals:full,activities:full,contacts:full,search:read\",\"retry_after\":null,\"created_at\":\"2023-09-08 09:44:29\",\"updated_at\":\"2026-04-08 22:58:34\"}}} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"pipedrive\",\"crm_owner\":241,\"team_id\":19} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":19} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":19} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.WARNING: [Calendar] CRM disconnected for user so events will not be matched {\"provider\":\"pipedrive\",\"user_id\":241,\"message\":\"Your Pipedrive account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1115,\"provider\":\"google\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:22] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [Google Calendar] Failed to watch channel for calendar {\"calendarId\":\"2676cb6d-f86c-427e-bf78-591e388e3c1e\",\"code\":400,\"reason\":\"{\n \\\"error\\\": {\n \\\"errors\\\": [\n {\n \\\"domain\\\": \\\"global\\\",\n \\\"reason\\\": \\\"push.webhookUrlNotHttps\\\",\n \\\"message\\\": \\\"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\\\"\n }\n ],\n \\\"code\\\": 400,\n \\\"message\\\": \\\"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\\\"\n }\n}\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.WARNING: [Calendar] Sync failed {\"calendarId\":\"2676cb6d-f86c-427e-bf78-591e388e3c1e\",\"code\":400,\"reason\":\"{\n \\\"error\\\": {\n \\\"errors\\\": [\n {\n \\\"domain\\\": \\\"global\\\",\n \\\"reason\\\": \\\"push.webhookUrlNotHttps\\\",\n \\\"message\\\": \\\"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\\\"\n }\n ],\n \\\"code\\\": 400,\n \\\"message\\\": \\\"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\\\"\n }\n}\"} {\"correlation_id\":\"03062f37-ea16-470d-a4b1-84853ab03431\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1421,\"provider\":\"office\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1421,\"provider\":\"office\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [Calendar] Processing sync {\"calendarId\":\"9e8b1a2c-1a8f-42bd-b161-810fc0baf540\",\"from\":null,\"to\":null,\"delta\":\"R0usmcdvmMuZCBYV0hguCMHsFO7eXNtxttzHbAJYhgEjS-R5DVVf-Qpiu1x1abSCjPi_6GyNNQkAr6QzlfYX5QQIViPlr6xQ6kMLGlYI2NcZng5dyOiPW7mVfNOMIyZjDQYC7N0dvAv975y9HBR7trnsCgpcjUtywYMZi-MeDGx3IKjUasrhRSTPdU9Udf7hbiTNTjFz4g-6cLtts5V1gQ.XmNrgOrsWLt3kS8T-h2qY30RyIR1RkKRDu2s9zO7qbM\",\"last_sync\":\"2026-04-14 07:13:35\",\"dateMode\":\"daily\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1499,\"provider\":\"hubspot\",\"refreshToken\":\"96f94c623a404e02ebdbf07f1b75707bb6cdbf848cbf45d418baf608c41a8d86\",\"state\":\"connected\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:23] local.INFO: [SocialAccountObserver] Access token was modified, encrypting {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:24] local.INFO: [SocialAccountService] Token refreshed {\"socialAccountId\":1499,\"provider\":\"hubspot\",\"state\":\"connected\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:24] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {\"crm_provider\":\"hubspot\",\"crm_owner\":89,\"team_id\":2} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:13:24] local.INFO: [MS Office Calendar] Skipping delta sync for daily mode {\"calendarId\":\"9e8b1a2c-1a8f-42bd-b161-810fc0baf540\"} {\"correlation_id\":\"9ec1cb79-102a-4275-9160-139951be1f50\",\"trace_id\":\"79bf680b-c623-42fa-b03d-34793d30ae1c\"}\n[2026-04-14 10:14:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"23ff3b18-7bba-4873-959b-5c3532813e26\",\"trace_id\":\"d6d3dcad-e5d1-4163-ab65-73a98767c1aa\"}\n[2026-04-14 10:14:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"23ff3b18-7bba-4873-959b-5c3532813e26\",\"trace_id\":\"d6d3dcad-e5d1-4163-ab65-73a98767c1aa\"}\n[2026-04-14 10:14:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"23ff3b18-7bba-4873-959b-5c3532813e26\",\"trace_id\":\"d6d3dcad-e5d1-4163-ab65-73a98767c1aa\"}\n[2026-04-14 10:14:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"f5505af8-fb38-405b-9c1b-de850a180c73\",\"trace_id\":\"b835b97b-0484-4c9e-b4ca-612d4f405f44\"}\n[2026-04-14 10:14:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"f5505af8-fb38-405b-9c1b-de850a180c73\",\"trace_id\":\"b835b97b-0484-4c9e-b4ca-612d4f405f44\"}\n[2026-04-14 10:14:09] local.NOTICE: Monitoring start {\"correlation_id\":\"ed4451ac-578d-4eff-a8d8-cc1fb5399c66\",\"trace_id\":\"8158b54f-1007-4fcc-a65f-548b82d202fc\"}\n[2026-04-14 10:14:09] local.NOTICE: Monitoring end {\"correlation_id\":\"ed4451ac-578d-4eff-a8d8-cc1fb5399c66\",\"trace_id\":\"8158b54f-1007-4fcc-a65f-548b82d202fc\"}\n[2026-04-14 10:14:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"5babadac-2755-4261-be70-29870ac2944f\",\"trace_id\":\"a701097c-9a8a-4b93-b4e9-de5a5fb34120\"}\n[2026-04-14 10:14:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"5babadac-2755-4261-be70-29870ac2944f\",\"trace_id\":\"a701097c-9a8a-4b93-b4e9-de5a5fb34120\"}\n[2026-04-14 10:14:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"81f604c5-13fc-485a-86ad-627a69a74529\",\"trace_id\":\"213caa28-79e7-4b24-94a4-f8b06c656dbd\"}\n[2026-04-14 10:14:13] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"81f604c5-13fc-485a-86ad-627a69a74529\",\"trace_id\":\"213caa28-79e7-4b24-94a4-f8b06c656dbd\"}\n[2026-04-14 10:14:13] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"81f604c5-13fc-485a-86ad-627a69a74529\",\"trace_id\":\"213caa28-79e7-4b24-94a4-f8b06c656dbd\"}\n[2026-04-14 10:14:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"81f604c5-13fc-485a-86ad-627a69a74529\",\"trace_id\":\"213caa28-79e7-4b24-94a4-f8b06c656dbd\"}\n[2026-04-14 10:14:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2151c2f9-66a9-4a4b-9b6e-724c4d607ef3\",\"trace_id\":\"38ddbbde-549d-477e-a4b7-08d53c6f48c8\"}\n[2026-04-14 10:14:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:12:00, 2026-04-14 10:14:00] {\"correlation_id\":\"2151c2f9-66a9-4a4b-9b6e-724c4d607ef3\",\"trace_id\":\"38ddbbde-549d-477e-a4b7-08d53c6f48c8\"}\n[2026-04-14 10:14:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:12:00, 2026-04-14 10:14:00] {\"correlation_id\":\"2151c2f9-66a9-4a4b-9b6e-724c4d607ef3\",\"trace_id\":\"38ddbbde-549d-477e-a4b7-08d53c6f48c8\"}\n[2026-04-14 10:14:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2151c2f9-66a9-4a4b-9b6e-724c4d607ef3\",\"trace_id\":\"38ddbbde-549d-477e-a4b7-08d53c6f48c8\"}\n[2026-04-14 10:14:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:sync-objects\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"27e589e1-40a2-405b-9a73-11b15079a387\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:16] local.ERROR: Call to a member function getAttribute() on null {\"exception\":\"[object] (Error(code: 0): Call to a member function getAttribute() on null at /home/jiminny/app/Console/Commands/Crm/SyncObjects.php:42)\n[stacktrace]\n#0 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Jiminny\\\\Console\\\\Commands\\\\Crm\\\\SyncObjects->handle()\n#1 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\\\Container\\\\BoundMethod::Illuminate\\\\Container\\\\{closure}()\n#2 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\\\\Container\\\\Util::unwrapIfClosure(Object(Closure))\n#3 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\\\Container\\\\BoundMethod::callBoundMethod(Object(Illuminate\\\\Foundation\\\\Application), Array, Object(Closure))\n#4 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Illuminate\\\\Container\\\\BoundMethod::call(Object(Illuminate\\\\Foundation\\\\Application), Array, Array, NULL)\n#5 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\\\Container\\\\Container->call(Array)\n#6 /home/jiminny/vendor/symfony/console/Command/Command.php(341): Illuminate\\\\Console\\\\Command->execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Illuminate\\\\Console\\\\OutputStyle))\n#7 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\\\Component\\\\Console\\\\Command\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Illuminate\\\\Console\\\\OutputStyle))\n#8 /home/jiminny/app/Console/Commands/Command.php(41): Illuminate\\\\Console\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#9 /home/jiminny/vendor/symfony/console/Application.php(1117): Jiminny\\\\Console\\\\Commands\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#10 /home/jiminny/vendor/symfony/console/Application.php(356): Symfony\\\\Component\\\\Console\\\\Application->doRunCommand(Object(Jiminny\\\\Console\\\\Commands\\\\Crm\\\\SyncObjects), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#11 /home/jiminny/vendor/symfony/console/Application.php(195): Symfony\\\\Component\\\\Console\\\\Application->doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#12 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\\\\Component\\\\Console\\\\Application->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#13 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\\\\Foundation\\\\Console\\\\Kernel->handle(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#14 /home/jiminny/artisan(13): Illuminate\\\\Foundation\\\\Application->handleCommand(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput))\n#15 {main}\n\"} {\"correlation_id\":\"27e589e1-40a2-405b-9a73-11b15079a387\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:16] local.ERROR: Scheduled command ['/usr/local/bin/php' 'artisan' crm:sync-objects] failed with exit code [1]. {\"exception\":\"[object] (Exception(code: 0): Scheduled command ['/usr/local/bin/php' 'artisan' crm:sync-objects] failed with exit code [1]. at /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207)\n[stacktrace]\n#0 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(41): Illuminate\\\\Console\\\\Scheduling\\\\ScheduleRunCommand->Illuminate\\\\Console\\\\Scheduling\\\\{closure}()\n#1 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php(59): Illuminate\\\\Console\\\\View\\\\Components\\\\Task->render('<fg=gray>2026-0...', Object(Closure))\n#2 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(191): Illuminate\\\\Console\\\\View\\\\Components\\\\Factory->__call('task', Array)\n#3 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(162): Illuminate\\\\Console\\\\Scheduling\\\\ScheduleRunCommand->runEvent(Object(Illuminate\\\\Console\\\\Scheduling\\\\Event))\n#4 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(132): Illuminate\\\\Console\\\\Scheduling\\\\ScheduleRunCommand->runSingleServerEvent(Object(Illuminate\\\\Console\\\\Scheduling\\\\Event))\n#5 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\\\Console\\\\Scheduling\\\\ScheduleRunCommand->handle(Object(Illuminate\\\\Console\\\\Scheduling\\\\Schedule), Object(Illuminate\\\\Events\\\\Dispatcher), Object(Illuminate\\\\Cache\\\\Repository), Object(NunoMaduro\\\\Collision\\\\Adapters\\\\Laravel\\\\ExceptionHandler))\n#6 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\\\Container\\\\BoundMethod::Illuminate\\\\Container\\\\{closure}()\n#7 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\\\\Container\\\\Util::unwrapIfClosure(Object(Closure))\n#8 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\\\Container\\\\BoundMethod::callBoundMethod(Object(Illuminate\\\\Foundation\\\\Application), Array, Object(Closure))\n#9 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Illuminate\\\\Container\\\\BoundMethod::call(Object(Illuminate\\\\Foundation\\\\Application), Array, Array, NULL)\n#10 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\\\Container\\\\Container->call(Array)\n#11 /home/jiminny/vendor/symfony/console/Command/Command.php(341): Illuminate\\\\Console\\\\Command->execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Illuminate\\\\Console\\\\OutputStyle))\n#12 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\\\Component\\\\Console\\\\Command\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Illuminate\\\\Console\\\\OutputStyle))\n#13 /home/jiminny/vendor/symfony/console/Application.php(1117): Illuminate\\\\Console\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#14 /home/jiminny/vendor/symfony/console/Application.php(356): Symfony\\\\Component\\\\Console\\\\Application->doRunCommand(Object(Illuminate\\\\Console\\\\Scheduling\\\\ScheduleRunCommand), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#15 /home/jiminny/vendor/symfony/console/Application.php(195): Symfony\\\\Component\\\\Console\\\\Application->doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#16 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\\\\Component\\\\Console\\\\Application->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#17 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\\\\Foundation\\\\Console\\\\Kernel->handle(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\n#18 /home/jiminny/artisan(13): Illuminate\\\\Foundation\\\\Application->handleCommand(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput))\n#19 {main}\n\"} {\"correlation_id\":\"7e825220-4803-460c-b32f-205701428575\",\"trace_id\":\"d4471232-e49d-4ed6-9fa9-7ce5ef181ad6\"}\n[2026-04-14 10:14:17] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"6473c918-d8db-4ded-a52b-4febfd7b7c02\",\"usage\":25081832,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [Salesforce] Account not connected for user {\"userId\":\"641f1acb-16b8-42d1-8726-df52979dad0e\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1500,\"sociable_id\":143,\"provider_user_id\":\"0052g000003frelAAA\",\"expires\":null,\"refresh_token_expires\":null,\"provider\":\"salesforce\",\"state\":\"full-refresh\",\"auth_scope\":\"refresh_token web api\",\"retry_after\":null,\"created_at\":\"2026-02-06 08:39:03\",\"updated_at\":\"2026-04-14 07:30:27\"}}} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"salesforce\",\"crm_owner\":143,\"team_id\":1} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"6473c918-d8db-4ded-a52b-4febfd7b7c02\",\"reason\":\"Your Salesforce account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"2af4cad9-d59f-440b-ad0e-4c298b20ec2f\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"abae74b8-bfa8-4383-9a7f-89f4bf2bdbb4\",\"usage\":25121320,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {\"crm_provider\":\"hubspot\",\"crm_owner\":148,\"team_id\":2} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [HubSpot] Syncing opportunities using strategy: lastModified {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [Hubspot] Pagination completed {\"team_id\":2,\"endpoint\":\"https://api.hubapi.com/crm/v3/objects/deals/search\",\"total_requests\":1,\"total_records_fetched\":0,\"total_elapsed_seconds\":0.55,\"average_seconds_per_request\":0.55} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [HubSpot] Synced opportunities {\"team\":2,\"sync_count\":0,\"total\":0,\"last_synced_id\":null} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [SyncObjects] After memory usage: {\"team\":\"abae74b8-bfa8-4383-9a7f-89f4bf2bdbb4\",\"usage\":25243264,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"7214c71f-ea92-4c2d-81b3-1fb8bdbeb7f3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"51467630-d89d-480b-be20-933e64a042f7\",\"usage\":25221224,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [Pipedrive] Account not connected for user {\"userId\":\"e6538737-e7b4-455f-a37a-3e79b665a220\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1116,\"sociable_id\":241,\"provider_user_id\":\"19555731\",\"expires\":1775683749,\"refresh_token_expires\":null,\"provider\":\"pipedrive\",\"state\":\"full-refresh\",\"auth_scope\":\"base,deals:full,activities:full,contacts:full,search:read\",\"retry_after\":null,\"created_at\":\"2023-09-08 09:44:29\",\"updated_at\":\"2026-04-08 22:58:34\"}}} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"pipedrive\",\"crm_owner\":241,\"team_id\":19} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":19} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":19} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:17] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"51467630-d89d-480b-be20-933e64a042f7\",\"reason\":\"Your Pipedrive account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"d9ad9947-f804-4826-a347-e0873d59697d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:18] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"396ed57c-e3c4-49be-8290-37c32955f7c7\",\"usage\":25187072,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"18dafbf8-372a-4c4e-91a2-6150b517f8d9\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:18] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"18dafbf8-372a-4c4e-91a2-6150b517f8d9\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:18] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {\"crm_provider\":\"copper\",\"crm_owner\":333,\"team_id\":27} {\"correlation_id\":\"18dafbf8-372a-4c4e-91a2-6150b517f8d9\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:18] local.NOTICE: Leads unavailable {\"method\":\"POST\",\"endpoint\":\"leads/search\",\"options\":[],\"body\":{\"minimum_modified_date\":1776159855,\"sort_by\":\"date_modified\",\"page_number\":1},\"status_code\":403,\"error\":\"{\\\"success\\\":false,\\\"status\\\":403,\\\"message\\\":\\\"Feature not enabled\\\"}\"} {\"correlation_id\":\"18dafbf8-372a-4c4e-91a2-6150b517f8d9\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SyncObjects] After memory usage: {\"team\":\"396ed57c-e3c4-49be-8290-37c32955f7c7\",\"usage\":25160664,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"18dafbf8-372a-4c4e-91a2-6150b517f8d9\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"fda3cbdf-1117-4ba5-86f8-775f548b3a28\",\"usage\":25198328,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [Pipedrive] Account not connected for user {\"userId\":\"e6538737-e7b4-455f-a37a-3e79b665a220\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1116,\"sociable_id\":241,\"provider_user_id\":\"19555731\",\"expires\":1775683749,\"refresh_token_expires\":null,\"provider\":\"pipedrive\",\"state\":\"full-refresh\",\"auth_scope\":\"base,deals:full,activities:full,contacts:full,search:read\",\"retry_after\":null,\"created_at\":\"2023-09-08 09:44:29\",\"updated_at\":\"2026-04-08 22:58:34\"}}} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"pipedrive\",\"crm_owner\":241,\"team_id\":28} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":28} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"pipedrive\",\"team_id\":28} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"fda3cbdf-1117-4ba5-86f8-775f548b3a28\",\"reason\":\"Your Pipedrive account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"5615ca9c-01d4-4595-b3f8-851105bb8ac3\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"b2b115eb-93ce-4d1b-929c-173757df8fba\",\"usage\":25201312,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [HubSpot] Account not connected for user {\"userId\":\"33e34a7a-1c02-4f04-87ac-22c3a385e6e3\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":306,\"sociable_id\":109,\"provider_user_id\":\"11348452\",\"expires\":1701077403,\"refresh_token_expires\":null,\"provider\":\"hubspot\",\"state\":\"full-refresh\",\"auth_scope\":null,\"retry_after\":null,\"created_at\":\"2020-09-01 16:59:04\",\"updated_at\":\"2023-11-27 09:30:03\"}}} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"hubspot\",\"crm_owner\":109,\"team_id\":29} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":29} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":29} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"b2b115eb-93ce-4d1b-929c-173757df8fba\",\"reason\":\"Your HubSpot account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"38a6e1ad-3eb7-4202-b1b9-321f44dd2103\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"3ff5a02a-86fb-4357-b1d6-a04e26c38602\",\"usage\":25172888,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1219,\"provider\":\"close\"} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1219,\"provider\":\"close\"} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:19] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {\"crm_provider\":\"close\",\"crm_owner\":257,\"team_id\":31} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [SyncObjects] After memory usage: {\"team\":\"3ff5a02a-86fb-4357-b1d6-a04e26c38602\",\"usage\":25194400,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"004b5459-f57f-4a9e-9e83-019509784c2c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"1640a0ac-19da-4c3b-90f7-87525f07a6d2\",\"usage\":25172928,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [Bullhorn] Account not connected for user {\"userId\":\"941d12a6-e84f-4c3a-a4c8-2ef433792095\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":348,\"sociable_id\":121,\"provider_user_id\":null,\"expires\":1733727508,\"refresh_token_expires\":null,\"provider\":\"bullhorn\",\"state\":\"full-refresh\",\"auth_scope\":null,\"retry_after\":null,\"created_at\":\"2021-04-06 11:07:26\",\"updated_at\":\"2024-12-09 15:10:40\"}}} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"bullhorn\",\"crm_owner\":121,\"team_id\":36} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"bullhorn\",\"team_id\":36} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"bullhorn\",\"team_id\":36} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"1640a0ac-19da-4c3b-90f7-87525f07a6d2\",\"reason\":\"Your Bullhorn account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"0e58e2ab-a82f-4361-b182-07a301a3df0d\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"b2d49a54-b645-4637-a7ae-a86cfce6e8e4\",\"usage\":25132824,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [HubSpot] Account not connected for user {\"userId\":\"2ac0447f-3c8c-4ce0-baeb-b63ddb76fa9b\",\"account\":null} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"hubspot\",\"crm_owner\":130,\"team_id\":42} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":42} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":42} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"b2d49a54-b645-4637-a7ae-a86cfce6e8e4\",\"reason\":\"Social account for HubSpot cannot be found. Please login to Jiminny to connect.\"} {\"correlation_id\":\"79f28db1-5c4b-4557-b90d-01e8f34f11cc\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"c6b9d6b0-b48d-4832-a68c-a57d60651888\",\"usage\":25129088,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [HubSpot] Account not connected for user {\"userId\":\"71e3aac5-fb66-47c5-a236-2d051ae3e319\",\"account\":null} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"hubspot\",\"crm_owner\":256,\"team_id\":49} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":49} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"hubspot\",\"team_id\":49} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"c6b9d6b0-b48d-4832-a68c-a57d60651888\",\"reason\":\"Social account for HubSpot cannot be found. Please login to Jiminny to connect.\"} {\"correlation_id\":\"6debcc13-992d-4265-bd29-1014dfaa4660\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [SyncObjects] Before memory usage: {\"team\":\"0c33bf2d-1c77-4200-8ed6-6147ad444c30\",\"usage\":25156328,\"real_usage\":65011712,\"pid\":37754} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SqsVisibilityControl] Receipt handle cannot be found {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [Salesforce] Account not connected for user {\"userId\":\"ed89227b-e364-4dfb-b4bf-343f154bf21e\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1360,\"sociable_id\":245,\"provider_user_id\":\"0052g000003frZNAAY\",\"expires\":null,\"refresh_token_expires\":null,\"provider\":\"salesforce\",\"state\":\"full-refresh\",\"auth_scope\":\"refresh_token web api\",\"retry_after\":null,\"created_at\":\"2024-09-02 06:11:55\",\"updated_at\":\"2024-12-11 08:50:23\"}}} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"salesforce\",\"crm_owner\":245,\"team_id\":59} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":59} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":59} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:14:20] local.WARNING: [SyncObjects] Account disconnected {\"team\":\"0c33bf2d-1c77-4200-8ed6-6147ad444c30\",\"reason\":\"Your Salesforce account has become disconnected. Please login to Jiminny to reconnect.\"} {\"correlation_id\":\"a81cc061-ba0a-4400-89c5-c1b2cada9d1c\",\"trace_id\":\"c8043155-93cb-4d1b-a6c2-5f5d2cc6a7a2\"}\n[2026-04-14 10:15:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b19787b8-89e4-4174-ac22-b53fa1965abc\",\"trace_id\":\"dc14a5bc-9648-469d-b68d-b2bff1651ecb\"}\n[2026-04-14 10:15:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"b19787b8-89e4-4174-ac22-b53fa1965abc\",\"trace_id\":\"dc14a5bc-9648-469d-b68d-b2bff1651ecb\"}\n[2026-04-14 10:15:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b19787b8-89e4-4174-ac22-b53fa1965abc\",\"trace_id\":\"dc14a5bc-9648-469d-b68d-b2bff1651ecb\"}\n[2026-04-14 10:15:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a333f21b-ae53-4915-b93a-596f1f2c926f\",\"trace_id\":\"3abd63e6-e174-458e-8400-f9c99f5742eb\"}\n[2026-04-14 10:15:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a333f21b-ae53-4915-b93a-596f1f2c926f\",\"trace_id\":\"3abd63e6-e174-458e-8400-f9c99f5742eb\"}\n[2026-04-14 10:15:08] local.NOTICE: Monitoring start {\"correlation_id\":\"0f075891-bb6c-4641-87a4-3994c5a043df\",\"trace_id\":\"ec5d699a-57af-41bc-bfb7-69e8d51dd17d\"}\n[2026-04-14 10:15:08] local.NOTICE: Monitoring end {\"correlation_id\":\"0f075891-bb6c-4641-87a4-3994c5a043df\",\"trace_id\":\"ec5d699a-57af-41bc-bfb7-69e8d51dd17d\"}\n[2026-04-14 10:15:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a616bfd0-6015-449d-8884-91dab87399b4\",\"trace_id\":\"b75643dc-0cbf-4c5b-8532-8fe5dbceaa3d\"}\n[2026-04-14 10:15:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a616bfd0-6015-449d-8884-91dab87399b4\",\"trace_id\":\"b75643dc-0cbf-4c5b-8532-8fe5dbceaa3d\"}\n[2026-04-14 10:15:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"32ced909-720e-4e0e-ae5a-477b57c0dec7\",\"trace_id\":\"2e6abd1f-94ba-4952-ba0d-d1de924f1663\"}\n[2026-04-14 10:15:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"32ced909-720e-4e0e-ae5a-477b57c0dec7\",\"trace_id\":\"2e6abd1f-94ba-4952-ba0d-d1de924f1663\"}\n[2026-04-14 10:15:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"32ced909-720e-4e0e-ae5a-477b57c0dec7\",\"trace_id\":\"2e6abd1f-94ba-4952-ba0d-d1de924f1663\"}\n[2026-04-14 10:15:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"32ced909-720e-4e0e-ae5a-477b57c0dec7\",\"trace_id\":\"2e6abd1f-94ba-4952-ba0d-d1de924f1663\"}\n[2026-04-14 10:15:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"96ed84f0-73cf-4aa3-9e6a-2793ccb7de49\",\"trace_id\":\"5d779593-3208-4ee5-b6b0-4b2b3bbf8408\"}\n[2026-04-14 10:15:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"96ed84f0-73cf-4aa3-9e6a-2793ccb7de49\",\"trace_id\":\"5d779593-3208-4ee5-b6b0-4b2b3bbf8408\"}\n[2026-04-14 10:15:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e39bb7cc-dc21-4cc6-b357-35563a63bff3\",\"trace_id\":\"3832e8c1-00ea-4493-a05b-c380bde7eef5\"}\n[2026-04-14 10:15:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e39bb7cc-dc21-4cc6-b357-35563a63bff3\",\"trace_id\":\"3832e8c1-00ea-4493-a05b-c380bde7eef5\"}\n[2026-04-14 10:15:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"931d521d-a375-4d69-b364-442247092f72\",\"trace_id\":\"a641da20-da66-4ff5-bf13-0da516259f3d\"}\n[2026-04-14 10:15:18] local.INFO: Running pre-meeting notification command {\"correlation_id\":\"931d521d-a375-4d69-b364-442247092f72\",\"trace_id\":\"a641da20-da66-4ff5-bf13-0da516259f3d\"}\n[2026-04-14 10:15:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"931d521d-a375-4d69-b364-442247092f72\",\"trace_id\":\"a641da20-da66-4ff5-bf13-0da516259f3d\"}\n[2026-04-14 10:15:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"74b81e6e-9b30-47c5-9ca2-3d986e2ed849\",\"trace_id\":\"71067e6a-a87b-4178-b96b-56c0f3eb11a9\"}\n[2026-04-14 10:15:21] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 10:05:00, 2026-04-14 10:10:00] {\"correlation_id\":\"74b81e6e-9b30-47c5-9ca2-3d986e2ed849\",\"trace_id\":\"71067e6a-a87b-4178-b96b-56c0f3eb11a9\"}\n[2026-04-14 10:15:21] local.INFO: [conference:monitor:start] No activities found in (2026-04-14 10:05:00, 2026-04-14 10:10:00] {\"correlation_id\":\"74b81e6e-9b30-47c5-9ca2-3d986e2ed849\",\"trace_id\":\"71067e6a-a87b-4178-b96b-56c0f3eb11a9\"}\n[2026-04-14 10:15:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"74b81e6e-9b30-47c5-9ca2-3d986e2ed849\",\"trace_id\":\"71067e6a-a87b-4178-b96b-56c0f3eb11a9\"}\n[2026-04-14 10:15:24] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e53334dc-6e3c-43dd-9475-0dede7bf0456\",\"trace_id\":\"4a038f09-2fdb-4f91-b0d8-da295cf1db09\"}\n[2026-04-14 10:15:24] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesEnded {\"from\":\"10:10\",\"to\":\"10:15\"} {\"correlation_id\":\"e53334dc-6e3c-43dd-9475-0dede7bf0456\",\"trace_id\":\"4a038f09-2fdb-4f91-b0d8-da295cf1db09\"}\n[2026-04-14 10:15:24] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {\"from\":\"00:05\",\"to\":\"00:10\"} {\"correlation_id\":\"e53334dc-6e3c-43dd-9475-0dede7bf0456\",\"trace_id\":\"4a038f09-2fdb-4f91-b0d8-da295cf1db09\"}\n[2026-04-14 10:15:24] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e53334dc-6e3c-43dd-9475-0dede7bf0456\",\"trace_id\":\"4a038f09-2fdb-4f91-b0d8-da295cf1db09\"}\n[2026-04-14 10:15:25] local.NOTICE: Repairing HubSpot tokens start {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:25] local.INFO: Trying to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:25] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:25] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":59,\"provider\":\"hubspot\",\"refreshToken\":\"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":306,\"provider\":\"hubspot\",\"refreshToken\":\"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1372,\"provider\":\"hubspot\",\"refreshToken\":\"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:26] local.NOTICE: Repairing HubSpot tokens end {\"total\":3,\"fixed\":0,\"failed\":3} {\"correlation_id\":\"4b84b1a0-a7b8-48e5-a1bf-3c52f22dad7e\",\"trace_id\":\"b20892fe-bfcf-4b14-9a59-06100cb96ca3\"}\n[2026-04-14 10:15:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"89e8fd3c-557e-4b5f-badd-8954b2f66bb8\",\"trace_id\":\"f2421ea8-4c6d-4180-aa46-7027d7fa4f3f\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Command] Starting polling service {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Polling] Service starting {\"memory_limit\":\"256M\",\"max_execution_time\":\"0\",\"initial_memory_mb\":62.0} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Polling] Acquired polling lock {\"expires_at\":\"2026-04-14T10:17:30.794235Z\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: [HubSpot Journal Auth] Requesting new client credentials token {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:30] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"89e8fd3c-557e-4b5f-badd-8954b2f66bb8\",\"trace_id\":\"f2421ea8-4c6d-4180-aa46-7027d7fa4f3f\"}\n[2026-04-14 10:15:31] local.INFO: [HubSpot Journal Auth] Successfully obtained new access token {\"expires_in\":1800,\"cached_for\":1500} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:31] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:32] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810039,\"provider\":\"twilio-flex\",\"team\":\"jiminny\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810040,\"provider\":\"xant\",\"team\":\"jiminny\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810041,\"provider\":\"apollo\",\"team\":\"jiminny\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810042,\"provider\":\"groove\",\"team\":\"jiminny\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810043,\"provider\":\"twilio-video\",\"team\":\"jiminny\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Dispatching activity sync job {\"import_id\":810044,\"provider\":\"hubspot\",\"team\":\"hubspot\"} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:33] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"9da0035d-8cb5-412f-a207-1b79f099f796\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.WARNING: [Salesforce] Account not connected for user {\"userId\":\"cdf8b554-d951-4758-bc2b-c1b85d1cd0b9\",\"account\":null} {\"correlation_id\":\"9b4a64ea-7083-4242-92fc-e22a39f3ccae\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"salesforce\",\"crm_owner\":3,\"team_id\":1} {\"correlation_id\":\"9b4a64ea-7083-4242-92fc-e22a39f3ccae\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"9b4a64ea-7083-4242-92fc-e22a39f3ccae\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"9b4a64ea-7083-4242-92fc-e22a39f3ccae\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.ALERT: [SyncActivity] Failed {\"import_id\":810039,\"provider\":\"twilio-flex\",\"provider_id\":317,\"team\":\"jiminny\",\"team_id\":1,\"reason\":\"Social account for Salesforce cannot be found. Please login to Jiminny to connect.\",\"file\":\"/home/jiminny/app/Services/Crm/BaseService.php\",\"line\":697} {\"correlation_id\":\"9b4a64ea-7083-4242-92fc-e22a39f3ccae\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"76f54fe3-c385-490f-adb7-97d3b8b6af8e\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"76f54fe3-c385-490f-adb7-97d3b8b6af8e\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:34] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"76f54fe3-c385-490f-adb7-97d3b8b6af8e\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.ALERT: [SyncActivity] Failed {\"import_id\":810040,\"provider\":\"xant\",\"provider_id\":161,\"team\":\"jiminny\",\"team_id\":1,\"reason\":\"Activity Provider account not connected.\",\"file\":\"/home/jiminny/app/Services/Activity/ActivityProviderService.php\",\"line\":174} {\"correlation_id\":\"76f54fe3-c385-490f-adb7-97d3b8b6af8e\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"8ab1362f-6630-42b0-a062-3c13b74aa200\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"8ab1362f-6630-42b0-a062-3c13b74aa200\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"8ab1362f-6630-42b0-a062-3c13b74aa200\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"cf1d258f-25eb-4dd9-96a7-bd33c25b2132\",\"trace_id\":\"f827347d-5c75-40d9-b343-210ac4e6f3be\"}\n[2026-04-14 10:15:35] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"cf1d258f-25eb-4dd9-96a7-bd33c25b2132\",\"trace_id\":\"f827347d-5c75-40d9-b343-210ac4e6f3be\"}\n[2026-04-14 10:15:35] local.ALERT: [SyncActivity] Failed {\"import_id\":810041,\"provider\":\"apollo\",\"provider_id\":441,\"team\":\"jiminny\",\"team_id\":1,\"reason\":\"Activity Provider account not connected.\",\"file\":\"/home/jiminny/app/Services/Activity/ActivityProviderService.php\",\"line\":174} {\"correlation_id\":\"8ab1362f-6630-42b0-a062-3c13b74aa200\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"747e064b-723f-4612-b61e-e4f6581ba972\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"747e064b-723f-4612-b61e-e4f6581ba972\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:35] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"747e064b-723f-4612-b61e-e4f6581ba972\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.ALERT: [SyncActivity] Failed {\"import_id\":810042,\"provider\":\"groove\",\"provider_id\":228,\"team\":\"jiminny\",\"team_id\":1,\"reason\":\"Activity Provider account not connected.\",\"file\":\"/home/jiminny/app/Services/Activity/ActivityProviderService.php\",\"line\":174} {\"correlation_id\":\"747e064b-723f-4612-b61e-e4f6581ba972\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"928573f1-075b-4c7a-b320-c1f059325f10\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1173,\"provider\":\"salesforce\"} {\"correlation_id\":\"928573f1-075b-4c7a-b320-c1f059325f10\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"928573f1-075b-4c7a-b320-c1f059325f10\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:36] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:36] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:36] local.ALERT: [SyncActivity] Failed {\"import_id\":810043,\"provider\":\"twilio-video\",\"provider_id\":243,\"team\":\"jiminny\",\"team_id\":1,\"reason\":\"Activity Provider account not connected.\",\"file\":\"/home/jiminny/app/Services/Activity/ActivityProviderService.php\",\"line\":174} {\"correlation_id\":\"928573f1-075b-4c7a-b320-c1f059325f10\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1499,\"provider\":\"hubspot\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {\"crm_provider\":\"hubspot\",\"crm_owner\":89,\"team_id\":2} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":408,\"provider\":\"hubspot\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Token needs refreshing {\"socialAccountId\":408,\"provider\":\"hubspot\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":408,\"provider\":\"hubspot\",\"refreshToken\":\"de4e47eb985578f4218833e763e31059e88b562e87e10749b3389be2328f0aa7\",\"state\":\"connected\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountObserver] Saving model {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:36] local.INFO: [SocialAccountObserver] Access token was modified, encrypting {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:37] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"nudges:send\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"67eff9ce-d3c1-484d-a3d7-11b715d43da9\",\"trace_id\":\"3142085a-2cef-4ffe-9ad5-4d9b4769fa85\"}\n[2026-04-14 10:15:37] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"nudges:send\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"67eff9ce-d3c1-484d-a3d7-11b715d43da9\",\"trace_id\":\"3142085a-2cef-4ffe-9ad5-4d9b4769fa85\"}\n[2026-04-14 10:15:37] local.INFO: [SocialAccountService] Token refreshed {\"socialAccountId\":408,\"provider\":\"hubspot\",\"state\":\"connected\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:37] local.INFO: [SyncActivity] Start {\"import_id\":810044,\"provider\":\"hubspot\",\"provider_id\":31,\"team\":\"hubspot\",\"team_id\":2} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:37] local.INFO: [HubSpot] Search calls for period {\"from\":\"2026-04-14 09:59:00\",\"to\":\"2026-04-14 10:15:00\"} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:37] local.INFO: [SyncActivity] End {\"import_id\":810044,\"provider\":\"hubspot\",\"provider_id\":31,\"team\":\"hubspot\",\"team_id\":2} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:37] local.INFO: [SyncActivity] Memory usage {\"import_id\":810044,\"provider\":\"hubspot\",\"provider_id\":31,\"team\":\"hubspot\",\"team_id\":2,\"memory_usage\":30998384,\"memory_real_usage\":67108864,\"pid\":37757} {\"correlation_id\":\"d3fa2e5d-8d02-454e-98ab-2fbc61749dec\",\"trace_id\":\"9c4806eb-8b9e-43a5-a68e-0ac49be04e6e\"}\n[2026-04-14 10:15:38] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"jiminny:playlists:normalize-sort\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ae160650-efe8-4f49-94a1-1821b4c424d6\",\"trace_id\":\"ff354824-7714-4f54-b759-0849e2394eec\"}\n[2026-04-14 10:15:38] local.INFO: [Jiminny\\Component\\Playlist\\Command\\NormalizeSortCommand::handle] starting. {\"playlists\":[]} {\"correlation_id\":\"ae160650-efe8-4f49-94a1-1821b4c424d6\",\"trace_id\":\"ff354824-7714-4f54-b759-0849e2394eec\"}\n[2026-04-14 10:15:38] local.INFO: [Jiminny\\Component\\Playlist\\Command\\NormalizeSortCommand::handle] finished. {\"normalizedPlaylists\":[],\"deletedPlaylists\":[]} {\"correlation_id\":\"ae160650-efe8-4f49-94a1-1821b4c424d6\",\"trace_id\":\"ff354824-7714-4f54-b759-0849e2394eec\"}\n[2026-04-14 10:15:38] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"jiminny:playlists:normalize-sort\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ae160650-efe8-4f49-94a1-1821b4c424d6\",\"trace_id\":\"ff354824-7714-4f54-b759-0849e2394eec\"}\n[2026-04-14 10:15:41] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:41] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:41] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:56] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:56] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:15:56] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8e1b8b11-79ba-4f4e-8685-b775817232fd\",\"trace_id\":\"1e128a69-7f3d-4e0f-8f62-616bcf487c5d\"}\n[2026-04-14 10:16:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"8e1b8b11-79ba-4f4e-8685-b775817232fd\",\"trace_id\":\"1e128a69-7f3d-4e0f-8f62-616bcf487c5d\"}\n[2026-04-14 10:16:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8e1b8b11-79ba-4f4e-8685-b775817232fd\",\"trace_id\":\"1e128a69-7f3d-4e0f-8f62-616bcf487c5d\"}\n[2026-04-14 10:16:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"239a9da7-f467-42b0-9e40-33794d1f2417\",\"trace_id\":\"dad528f2-05ae-4faa-a895-a0dd0087ba4d\"}\n[2026-04-14 10:16:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"239a9da7-f467-42b0-9e40-33794d1f2417\",\"trace_id\":\"dad528f2-05ae-4faa-a895-a0dd0087ba4d\"}\n[2026-04-14 10:16:08] local.NOTICE: Monitoring start {\"correlation_id\":\"739cea00-88f1-4a47-8984-06a35042de46\",\"trace_id\":\"0d843b4c-25fe-46d6-b830-07a01761e703\"}\n[2026-04-14 10:16:08] local.NOTICE: Monitoring end {\"correlation_id\":\"739cea00-88f1-4a47-8984-06a35042de46\",\"trace_id\":\"0d843b4c-25fe-46d6-b830-07a01761e703\"}\n[2026-04-14 10:16:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"29cf312e-e3ee-4a3c-ae96-728991fff96d\",\"trace_id\":\"8e554de9-60f6-411a-882c-1573407802a1\"}\n[2026-04-14 10:16:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"29cf312e-e3ee-4a3c-ae96-728991fff96d\",\"trace_id\":\"8e554de9-60f6-411a-882c-1573407802a1\"}\n[2026-04-14 10:16:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"6a0d0b68-2fe4-47db-a52f-9549f58fc8fd\",\"trace_id\":\"2e27f6a4-519c-42c5-8b3b-653b26fa8fa6\"}\n[2026-04-14 10:16:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"6a0d0b68-2fe4-47db-a52f-9549f58fc8fd\",\"trace_id\":\"2e27f6a4-519c-42c5-8b3b-653b26fa8fa6\"}\n[2026-04-14 10:16:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"6a0d0b68-2fe4-47db-a52f-9549f58fc8fd\",\"trace_id\":\"2e27f6a4-519c-42c5-8b3b-653b26fa8fa6\"}\n[2026-04-14 10:16:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"6a0d0b68-2fe4-47db-a52f-9549f58fc8fd\",\"trace_id\":\"2e27f6a4-519c-42c5-8b3b-653b26fa8fa6\"}\n[2026-04-14 10:16:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"758b4724-e445-441a-9612-23d1e87a5854\",\"trace_id\":\"c9942cf2-f503-475d-8afb-f55a26d53730\"}\n[2026-04-14 10:16:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:14:00, 2026-04-14 10:16:00] {\"correlation_id\":\"758b4724-e445-441a-9612-23d1e87a5854\",\"trace_id\":\"c9942cf2-f503-475d-8afb-f55a26d53730\"}\n[2026-04-14 10:16:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:14:00, 2026-04-14 10:16:00] {\"correlation_id\":\"758b4724-e445-441a-9612-23d1e87a5854\",\"trace_id\":\"c9942cf2-f503-475d-8afb-f55a26d53730\"}\n[2026-04-14 10:16:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"758b4724-e445-441a-9612-23d1e87a5854\",\"trace_id\":\"c9942cf2-f503-475d-8afb-f55a26d53730\"}\n[2026-04-14 10:16:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a8396e52-2e01-4a0e-9c0c-f5e0cbee4121\",\"trace_id\":\"e41cb131-16f3-4cb7-82a6-e70ab9ec3164\"}\n[2026-04-14 10:16:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a8396e52-2e01-4a0e-9c0c-f5e0cbee4121\",\"trace_id\":\"e41cb131-16f3-4cb7-82a6-e70ab9ec3164\"}\n[2026-04-14 10:16:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"7f36df61-d80b-4d46-a59d-de30a5c60135\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:20] local.INFO: [EmailSchedule] STARTING Inbox Sync {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"7f36df61-d80b-4d46-a59d-de30a5c60135\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:20] local.INFO: [EmailSchedule] FINISHED Inbox Sync {\"host\":\"docker_lamp_1\",\"events\":2} {\"correlation_id\":\"7f36df61-d80b-4d46-a59d-de30a5c60135\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"7f36df61-d80b-4d46-a59d-de30a5c60135\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:22] local.INFO: [Sync Mailbox] Sync start {\"inbox_id\":59} {\"correlation_id\":\"e5318327-0376-4d99-ae7a-9c4beede1707\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:22] local.INFO: [Inbox service] Skipping METADATA SYNC for inbox 59 due to unauthorized access to the mailbox {\"correlation_id\":\"e5318327-0376-4d99-ae7a-9c4beede1707\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:22] local.INFO: [Sync Mailbox] Sync complete {\"inbox_id\":59} {\"correlation_id\":\"e5318327-0376-4d99-ae7a-9c4beede1707\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:22] local.INFO: [Sync Mailbox] Sync start {\"inbox_id\":212} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:22] local.WARNING: [Salesforce] Account not connected for user {\"userId\":\"641f1acb-16b8-42d1-8726-df52979dad0e\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1500,\"sociable_id\":143,\"provider_user_id\":\"0052g000003frelAAA\",\"expires\":null,\"refresh_token_expires\":null,\"provider\":\"salesforce\",\"state\":\"full-refresh\",\"auth_scope\":\"refresh_token web api\",\"retry_after\":null,\"created_at\":\"2026-02-06 08:39:03\",\"updated_at\":\"2026-04-14 07:30:27\"}}} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:23] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"salesforce\",\"crm_owner\":143,\"team_id\":1} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:23] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:23] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:23] local.ERROR: Failed to set service context for google: Your Salesforce account has become disconnected. Please login to Jiminny to reconnect. {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:23] local.INFO: [Sync Mailbox] Sync complete {\"inbox_id\":212} {\"correlation_id\":\"b4030524-e035-4b02-ae27-b19ec2dd0505\",\"trace_id\":\"60cb031b-8699-4706-bfc7-b336be8f33aa\"}\n[2026-04-14 10:16:27] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.INFO: [HubSpot Journal Polling] Service ending {\"runtime_seconds\":57,\"total_cycles\":5,\"files_downloaded\":0,\"empty_files\":0,\"other_portal_skipped\":0,\"total_events\":0,\"events_per_file\":0,\"avg_api_ms\":225.6,\"avg_download_ms\":0.0,\"avg_transform_ms\":0.0,\"avg_process_ms\":0.0,\"peak_memory_mb\":99.75} {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:16:27] local.INFO: [HubSpot Journal Polling] Released polling lock {\"correlation_id\":\"a3ba9ed0-9836-4632-9abd-e1e94a12823e\",\"trace_id\":\"2aa4d752-7404-45f6-b48a-876b94fdc325\"}\n[2026-04-14 10:17:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d35216d4-bfac-4a85-8439-ae16a498e6c2\",\"trace_id\":\"07e527c2-57c8-4666-9c37-99465345b80c\"}\n[2026-04-14 10:17:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"d35216d4-bfac-4a85-8439-ae16a498e6c2\",\"trace_id\":\"07e527c2-57c8-4666-9c37-99465345b80c\"}\n[2026-04-14 10:17:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d35216d4-bfac-4a85-8439-ae16a498e6c2\",\"trace_id\":\"07e527c2-57c8-4666-9c37-99465345b80c\"}\n[2026-04-14 10:17:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ea85c092-3221-4e3c-aacc-8a835d847f22\",\"trace_id\":\"8d11a8bc-2b02-42b3-90c0-fc90665005a7\"}\n[2026-04-14 10:17:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ea85c092-3221-4e3c-aacc-8a835d847f22\",\"trace_id\":\"8d11a8bc-2b02-42b3-90c0-fc90665005a7\"}\n[2026-04-14 10:17:08] local.NOTICE: Monitoring start {\"correlation_id\":\"34d15cf0-1ccf-4611-902f-a11639d0e019\",\"trace_id\":\"c77cdb06-ca30-4672-bcd0-9bda2d2194a6\"}\n[2026-04-14 10:17:08] local.NOTICE: Monitoring end {\"correlation_id\":\"34d15cf0-1ccf-4611-902f-a11639d0e019\",\"trace_id\":\"c77cdb06-ca30-4672-bcd0-9bda2d2194a6\"}\n[2026-04-14 10:17:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"0811d737-c92b-4025-bb1c-590513e7451f\",\"trace_id\":\"70c60fa9-7b1f-4d6c-aa67-6a82d9c54d92\"}\n[2026-04-14 10:17:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"0811d737-c92b-4025-bb1c-590513e7451f\",\"trace_id\":\"70c60fa9-7b1f-4d6c-aa67-6a82d9c54d92\"}\n[2026-04-14 10:17:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"20f0dd3b-e5b5-47ca-a7a9-08c1acddb5a0\",\"trace_id\":\"0328a9c8-4f0e-42c2-9f04-81d72323b686\"}\n[2026-04-14 10:17:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"20f0dd3b-e5b5-47ca-a7a9-08c1acddb5a0\",\"trace_id\":\"0328a9c8-4f0e-42c2-9f04-81d72323b686\"}\n[2026-04-14 10:17:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"20f0dd3b-e5b5-47ca-a7a9-08c1acddb5a0\",\"trace_id\":\"0328a9c8-4f0e-42c2-9f04-81d72323b686\"}\n[2026-04-14 10:17:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"20f0dd3b-e5b5-47ca-a7a9-08c1acddb5a0\",\"trace_id\":\"0328a9c8-4f0e-42c2-9f04-81d72323b686\"}\n[2026-04-14 10:17:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"76173fa3-4233-4356-b6c0-5918aa4164e9\",\"trace_id\":\"6638f7ac-05d8-4280-99af-3a5f9dd0b86e\"}\n[2026-04-14 10:17:14] local.INFO: [EmailSchedule] STARTING batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"76173fa3-4233-4356-b6c0-5918aa4164e9\",\"trace_id\":\"6638f7ac-05d8-4280-99af-3a5f9dd0b86e\"}\n[2026-04-14 10:17:14] local.INFO: [EmailSchedule] FINISHED batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"76173fa3-4233-4356-b6c0-5918aa4164e9\",\"trace_id\":\"6638f7ac-05d8-4280-99af-3a5f9dd0b86e\"}\n[2026-04-14 10:17:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"76173fa3-4233-4356-b6c0-5918aa4164e9\",\"trace_id\":\"6638f7ac-05d8-4280-99af-3a5f9dd0b86e\"}\n[2026-04-14 10:17:17] local.INFO: [Jiminny\\Jobs\\Mailbox\\CreateBatches] processed 0 inboxes and created 0 batches {\"userId\":null,\"batchSize\":30,\"maxBatches\":1000} {\"correlation_id\":\"4a42d036-a82a-432d-8441-94812bf476d5\",\"trace_id\":\"6638f7ac-05d8-4280-99af-3a5f9dd0b86e\"}\n[2026-04-14 10:18:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3b071414-3bf6-4a42-9300-f79f89520e38\",\"trace_id\":\"88906f9c-80fc-4aca-a7a0-9c63f372da98\"}\n[2026-04-14 10:18:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"3b071414-3bf6-4a42-9300-f79f89520e38\",\"trace_id\":\"88906f9c-80fc-4aca-a7a0-9c63f372da98\"}\n[2026-04-14 10:18:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3b071414-3bf6-4a42-9300-f79f89520e38\",\"trace_id\":\"88906f9c-80fc-4aca-a7a0-9c63f372da98\"}\n[2026-04-14 10:18:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3da4d912-5c07-47de-bf15-981b3bb6e518\",\"trace_id\":\"448e6c0f-a217-418e-bd4d-32c6b4fe7ac8\"}\n[2026-04-14 10:18:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3da4d912-5c07-47de-bf15-981b3bb6e518\",\"trace_id\":\"448e6c0f-a217-418e-bd4d-32c6b4fe7ac8\"}\n[2026-04-14 10:18:08] local.NOTICE: Monitoring start {\"correlation_id\":\"9f200425-0d8e-4346-a6c8-517df5b5d55b\",\"trace_id\":\"49252ef9-62c1-4791-af81-da79d68b23d0\"}\n[2026-04-14 10:18:08] local.NOTICE: Monitoring end {\"correlation_id\":\"9f200425-0d8e-4346-a6c8-517df5b5d55b\",\"trace_id\":\"49252ef9-62c1-4791-af81-da79d68b23d0\"}\n[2026-04-14 10:18:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"f78cd133-1b15-43f6-9c16-e0e772523363\",\"trace_id\":\"31814799-af31-4551-9212-09f20d6b5b15\"}\n[2026-04-14 10:18:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"f78cd133-1b15-43f6-9c16-e0e772523363\",\"trace_id\":\"31814799-af31-4551-9212-09f20d6b5b15\"}\n[2026-04-14 10:18:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2875eda8-02c2-47ff-8957-987f9ccfed4a\",\"trace_id\":\"290c567a-365c-4874-9388-6ae856c4a29e\"}\n[2026-04-14 10:18:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"2875eda8-02c2-47ff-8957-987f9ccfed4a\",\"trace_id\":\"290c567a-365c-4874-9388-6ae856c4a29e\"}\n[2026-04-14 10:18:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"2875eda8-02c2-47ff-8957-987f9ccfed4a\",\"trace_id\":\"290c567a-365c-4874-9388-6ae856c4a29e\"}\n[2026-04-14 10:18:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2875eda8-02c2-47ff-8957-987f9ccfed4a\",\"trace_id\":\"290c567a-365c-4874-9388-6ae856c4a29e\"}\n[2026-04-14 10:18:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"259f2dbf-42df-4635-860a-11fe9c4ce3de\",\"trace_id\":\"e09c3d83-63d2-4bc6-a9f4-9434cc2c4795\"}\n[2026-04-14 10:18:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:16:00, 2026-04-14 10:18:00] {\"correlation_id\":\"259f2dbf-42df-4635-860a-11fe9c4ce3de\",\"trace_id\":\"e09c3d83-63d2-4bc6-a9f4-9434cc2c4795\"}\n[2026-04-14 10:18:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:16:00, 2026-04-14 10:18:00] {\"correlation_id\":\"259f2dbf-42df-4635-860a-11fe9c4ce3de\",\"trace_id\":\"e09c3d83-63d2-4bc6-a9f4-9434cc2c4795\"}\n[2026-04-14 10:18:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"259f2dbf-42df-4635-860a-11fe9c4ce3de\",\"trace_id\":\"e09c3d83-63d2-4bc6-a9f4-9434cc2c4795\"}\n[2026-04-14 10:18:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"12f429e9-7142-4c67-9b7f-ab576f600bd3\",\"trace_id\":\"eca121a3-0052-4f22-9820-44c0009591ab\"}\n[2026-04-14 10:18:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"12f429e9-7142-4c67-9b7f-ab576f600bd3\",\"trace_id\":\"eca121a3-0052-4f22-9820-44c0009591ab\"}\n[2026-04-14 10:19:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"bbfdab8a-af86-48c2-bd0e-e59e38d2cb7e\",\"trace_id\":\"563ef3c4-776b-4445-a65d-0a20ffdd44a5\"}\n[2026-04-14 10:19:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"bbfdab8a-af86-48c2-bd0e-e59e38d2cb7e\",\"trace_id\":\"563ef3c4-776b-4445-a65d-0a20ffdd44a5\"}\n[2026-04-14 10:19:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"bbfdab8a-af86-48c2-bd0e-e59e38d2cb7e\",\"trace_id\":\"563ef3c4-776b-4445-a65d-0a20ffdd44a5\"}\n[2026-04-14 10:19:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"20ee7c1b-2a8d-4c28-960c-7fd2692965a0\",\"trace_id\":\"e9bd336f-400e-4821-9759-f789c7f46f01\"}\n[2026-04-14 10:19:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"20ee7c1b-2a8d-4c28-960c-7fd2692965a0\",\"trace_id\":\"e9bd336f-400e-4821-9759-f789c7f46f01\"}\n[2026-04-14 10:19:09] local.NOTICE: Monitoring start {\"correlation_id\":\"f50066e0-d6fc-4cd4-ac5d-c9cba0729232\",\"trace_id\":\"5be77157-158c-4825-bbe1-2dd4b46fcf87\"}\n[2026-04-14 10:19:09] local.NOTICE: Monitoring end {\"correlation_id\":\"f50066e0-d6fc-4cd4-ac5d-c9cba0729232\",\"trace_id\":\"5be77157-158c-4825-bbe1-2dd4b46fcf87\"}\n[2026-04-14 10:19:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"c8bd605e-3081-4d1e-986c-ad4a8af3c44f\",\"trace_id\":\"55d06260-a630-4021-be67-d26c5472d38b\"}\n[2026-04-14 10:19:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"c8bd605e-3081-4d1e-986c-ad4a8af3c44f\",\"trace_id\":\"55d06260-a630-4021-be67-d26c5472d38b\"}\n[2026-04-14 10:19:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"5f0600be-5c90-4200-a4e3-6bcb17d9fb1a\",\"trace_id\":\"4b3a8062-7310-47e4-97f0-0caa927d0171\"}\n[2026-04-14 10:19:13] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"5f0600be-5c90-4200-a4e3-6bcb17d9fb1a\",\"trace_id\":\"4b3a8062-7310-47e4-97f0-0caa927d0171\"}\n[2026-04-14 10:19:13] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"5f0600be-5c90-4200-a4e3-6bcb17d9fb1a\",\"trace_id\":\"4b3a8062-7310-47e4-97f0-0caa927d0171\"}\n[2026-04-14 10:19:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"5f0600be-5c90-4200-a4e3-6bcb17d9fb1a\",\"trace_id\":\"4b3a8062-7310-47e4-97f0-0caa927d0171\"}\n[2026-04-14 10:20:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"49b10fcc-82b9-4f72-aa4a-fc90a3b32a67\",\"trace_id\":\"a3f352dd-490e-4d81-a68a-3491d12b2dec\"}\n[2026-04-14 10:20:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"49b10fcc-82b9-4f72-aa4a-fc90a3b32a67\",\"trace_id\":\"a3f352dd-490e-4d81-a68a-3491d12b2dec\"}\n[2026-04-14 10:20:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"49b10fcc-82b9-4f72-aa4a-fc90a3b32a67\",\"trace_id\":\"a3f352dd-490e-4d81-a68a-3491d12b2dec\"}\n[2026-04-14 10:20:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8658c495-f035-4d10-9a4f-67cd34dba765\",\"trace_id\":\"52e6b4db-baa3-44b9-9c16-b68690dfaffd\"}\n[2026-04-14 10:20:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8658c495-f035-4d10-9a4f-67cd34dba765\",\"trace_id\":\"52e6b4db-baa3-44b9-9c16-b68690dfaffd\"}\n[2026-04-14 10:20:09] local.NOTICE: Monitoring start {\"correlation_id\":\"7e12cae7-11d4-42ac-aa5f-8b83d569103c\",\"trace_id\":\"5bfd2f87-1d5e-4fe7-aa70-bd4b80240e65\"}\n[2026-04-14 10:20:09] local.NOTICE: Monitoring end {\"correlation_id\":\"7e12cae7-11d4-42ac-aa5f-8b83d569103c\",\"trace_id\":\"5bfd2f87-1d5e-4fe7-aa70-bd4b80240e65\"}\n[2026-04-14 10:20:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ff44f010-a7b5-4429-87e4-2dee3174ec71\",\"trace_id\":\"bf737ad6-1706-456f-9ddc-4ab7d25fd897\"}\n[2026-04-14 10:20:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ff44f010-a7b5-4429-87e4-2dee3174ec71\",\"trace_id\":\"bf737ad6-1706-456f-9ddc-4ab7d25fd897\"}\n[2026-04-14 10:20:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ac5f0008-7378-49a3-a1f4-178ff019bba3\",\"trace_id\":\"0437f9f2-d5e3-4fe5-8810-08e1dfd88fd5\"}\n[2026-04-14 10:20:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"ac5f0008-7378-49a3-a1f4-178ff019bba3\",\"trace_id\":\"0437f9f2-d5e3-4fe5-8810-08e1dfd88fd5\"}\n[2026-04-14 10:20:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"ac5f0008-7378-49a3-a1f4-178ff019bba3\",\"trace_id\":\"0437f9f2-d5e3-4fe5-8810-08e1dfd88fd5\"}\n[2026-04-14 10:20:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ac5f0008-7378-49a3-a1f4-178ff019bba3\",\"trace_id\":\"0437f9f2-d5e3-4fe5-8810-08e1dfd88fd5\"}\n[2026-04-14 10:20:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"bc166df0-72af-4784-be78-59ea128ebf54\",\"trace_id\":\"1253a4b0-504c-47cd-b0e9-dccbc9ec4443\"}\n[2026-04-14 10:20:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:18:00, 2026-04-14 10:20:00] {\"correlation_id\":\"bc166df0-72af-4784-be78-59ea128ebf54\",\"trace_id\":\"1253a4b0-504c-47cd-b0e9-dccbc9ec4443\"}\n[2026-04-14 10:20:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:18:00, 2026-04-14 10:20:00] {\"correlation_id\":\"bc166df0-72af-4784-be78-59ea128ebf54\",\"trace_id\":\"1253a4b0-504c-47cd-b0e9-dccbc9ec4443\"}\n[2026-04-14 10:20:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"bc166df0-72af-4784-be78-59ea128ebf54\",\"trace_id\":\"1253a4b0-504c-47cd-b0e9-dccbc9ec4443\"}\n[2026-04-14 10:20:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b9269388-ff12-4bb7-aa45-9b3367e19b9c\",\"trace_id\":\"7653c5d4-a15c-4c74-9269-3f692e5e0282\"}\n[2026-04-14 10:20:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b9269388-ff12-4bb7-aa45-9b3367e19b9c\",\"trace_id\":\"7653c5d4-a15c-4c74-9269-3f692e5e0282\"}\n[2026-04-14 10:20:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"36e841aa-09ce-4887-bf0d-88cdf637ef1b\",\"trace_id\":\"12d3af16-6083-4328-b02f-7fdad76d4e72\"}\n[2026-04-14 10:20:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"36e841aa-09ce-4887-bf0d-88cdf637ef1b\",\"trace_id\":\"12d3af16-6083-4328-b02f-7fdad76d4e72\"}\n[2026-04-14 10:20:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"35103276-6d8f-4398-8023-78b7902ff2b3\",\"trace_id\":\"2070f567-c2c0-4f10-b79e-0daca7ab30d1\"}\n[2026-04-14 10:20:20] local.INFO: Running pre-meeting notification command {\"correlation_id\":\"35103276-6d8f-4398-8023-78b7902ff2b3\",\"trace_id\":\"2070f567-c2c0-4f10-b79e-0daca7ab30d1\"}\n[2026-04-14 10:20:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"35103276-6d8f-4398-8023-78b7902ff2b3\",\"trace_id\":\"2070f567-c2c0-4f10-b79e-0daca7ab30d1\"}\n[2026-04-14 10:20:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"c3ad5e2b-8290-4bd9-aec1-d441f06442d5\",\"trace_id\":\"581699a1-91cf-490f-b4d9-ce3286747b66\"}\n[2026-04-14 10:20:22] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 10:10:00, 2026-04-14 10:15:00] {\"correlation_id\":\"c3ad5e2b-8290-4bd9-aec1-d441f06442d5\",\"trace_id\":\"581699a1-91cf-490f-b4d9-ce3286747b66\"}\n[2026-04-14 10:20:22] local.INFO: [conference:monitor:start] No activities found in (2026-04-14 10:10:00, 2026-04-14 10:15:00] {\"correlation_id\":\"c3ad5e2b-8290-4bd9-aec1-d441f06442d5\",\"trace_id\":\"581699a1-91cf-490f-b4d9-ce3286747b66\"}\n[2026-04-14 10:20:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"c3ad5e2b-8290-4bd9-aec1-d441f06442d5\",\"trace_id\":\"581699a1-91cf-490f-b4d9-ce3286747b66\"}\n[2026-04-14 10:20:24] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b7139a98-8562-495c-856d-d6175ac4b481\",\"trace_id\":\"fa8cd7d4-f859-4005-8bcb-d1c2f7b0b54f\"}\n[2026-04-14 10:20:24] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesEnded {\"from\":\"10:15\",\"to\":\"10:20\"} {\"correlation_id\":\"b7139a98-8562-495c-856d-d6175ac4b481\",\"trace_id\":\"fa8cd7d4-f859-4005-8bcb-d1c2f7b0b54f\"}\n[2026-04-14 10:20:24] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {\"from\":\"00:10\",\"to\":\"00:15\"} {\"correlation_id\":\"b7139a98-8562-495c-856d-d6175ac4b481\",\"trace_id\":\"fa8cd7d4-f859-4005-8bcb-d1c2f7b0b54f\"}\n[2026-04-14 10:20:24] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b7139a98-8562-495c-856d-d6175ac4b481\",\"trace_id\":\"fa8cd7d4-f859-4005-8bcb-d1c2f7b0b54f\"}\n[2026-04-14 10:20:27] local.NOTICE: Repairing HubSpot tokens start {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:27] local.INFO: Trying to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:27] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:27] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":59,\"provider\":\"hubspot\",\"refreshToken\":\"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.ERROR: Failed to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: Trying to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":306,\"provider\":\"hubspot\",\"refreshToken\":\"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.ERROR: Failed to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: Trying to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:28] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1372,\"provider\":\"hubspot\",\"refreshToken\":\"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:29] local.ERROR: Failed to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:29] local.NOTICE: Repairing HubSpot tokens end {\"total\":3,\"fixed\":0,\"failed\":3} {\"correlation_id\":\"281b4a3b-af22-4b7c-ae46-aa6d1310ff6c\",\"trace_id\":\"3018e9ff-bea6-4508-83e5-6dc4b68a0d7a\"}\n[2026-04-14 10:20:31] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"jiminny:transcription:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"98f0a05b-5930-45f0-9a22-69ff45b3a2de\",\"trace_id\":\"2b98f3ff-a706-4edd-8201-aa3578346369\"}\n[2026-04-14 10:20:31] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3d3a0687-831f-4143-a6ed-b70d7d150006\",\"trace_id\":\"d159044c-6c7a-400d-903e-c49aa852830f\"}\n[2026-04-14 10:20:32] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"jiminny:transcription:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"98f0a05b-5930-45f0-9a22-69ff45b3a2de\",\"trace_id\":\"2b98f3ff-a706-4edd-8201-aa3578346369\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Command] Starting polling service {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Polling] Service starting {\"memory_limit\":\"256M\",\"max_execution_time\":\"0\",\"initial_memory_mb\":62.0} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Polling] Acquired polling lock {\"expires_at\":\"2026-04-14T10:22:32.175408Z\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:32] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3d3a0687-831f-4143-a6ed-b70d7d150006\",\"trace_id\":\"d159044c-6c7a-400d-903e-c49aa852830f\"}\n[2026-04-14 10:20:32] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:36] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:reset-governor\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a44adcab-3209-472c-bb8b-d282633a967f\",\"trace_id\":\"d91779a5-ac75-4a27-b91e-f7a86e4f92e4\"}\n[2026-04-14 10:20:36] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:reset-governor\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a44adcab-3209-472c-bb8b-d282633a967f\",\"trace_id\":\"d91779a5-ac75-4a27-b91e-f7a86e4f92e4\"}\n[2026-04-14 10:20:37] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:37] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:37] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:38] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d1af3755-8f7f-4f60-9107-a1fac3eb49a7\",\"trace_id\":\"9704b2b2-b436-4dfe-8ec7-55a1d508f659\"}\n[2026-04-14 10:20:38] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d1af3755-8f7f-4f60-9107-a1fac3eb49a7\",\"trace_id\":\"9704b2b2-b436-4dfe-8ec7-55a1d508f659\"}\n[2026-04-14 10:20:42] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:42] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:42] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:57] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:57] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:20:58] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e7ba9c62-51b9-4dc2-a17a-3f2b14f5d752\",\"trace_id\":\"243dac4e-3e38-4ac6-8f75-f8159cc071c1\"}\n[2026-04-14 10:21:06] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"e7ba9c62-51b9-4dc2-a17a-3f2b14f5d752\",\"trace_id\":\"243dac4e-3e38-4ac6-8f75-f8159cc071c1\"}\n[2026-04-14 10:21:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e7ba9c62-51b9-4dc2-a17a-3f2b14f5d752\",\"trace_id\":\"243dac4e-3e38-4ac6-8f75-f8159cc071c1\"}\n[2026-04-14 10:21:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"9b6045b4-039a-43f8-aadc-389ecbf03df8\",\"trace_id\":\"8f2b2b86-e248-48de-845c-197974c3f404\"}\n[2026-04-14 10:21:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"9b6045b4-039a-43f8-aadc-389ecbf03df8\",\"trace_id\":\"8f2b2b86-e248-48de-845c-197974c3f404\"}\n[2026-04-14 10:21:13] local.NOTICE: Monitoring start {\"correlation_id\":\"c3c56c8f-20c5-4522-8090-e28150dbe6f3\",\"trace_id\":\"e8921765-8d27-49d5-928d-1b6b69964a1e\"}\n[2026-04-14 10:21:13] local.NOTICE: Monitoring end {\"correlation_id\":\"c3c56c8f-20c5-4522-8090-e28150dbe6f3\",\"trace_id\":\"e8921765-8d27-49d5-928d-1b6b69964a1e\"}\n[2026-04-14 10:21:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3bb80ed7-08d2-4bea-9aae-655106fe7e49\",\"trace_id\":\"f9a3cb0c-4620-40ef-92cf-b1a627ce5711\"}\n[2026-04-14 10:21:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3bb80ed7-08d2-4bea-9aae-655106fe7e49\",\"trace_id\":\"f9a3cb0c-4620-40ef-92cf-b1a627ce5711\"}\n[2026-04-14 10:21:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"568a3ee9-b2a9-4b65-acdc-e6b3a067465a\",\"trace_id\":\"39c1b238-1d21-495c-886a-59695f4d2ca3\"}\n[2026-04-14 10:21:18] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"568a3ee9-b2a9-4b65-acdc-e6b3a067465a\",\"trace_id\":\"39c1b238-1d21-495c-886a-59695f4d2ca3\"}\n[2026-04-14 10:21:18] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"568a3ee9-b2a9-4b65-acdc-e6b3a067465a\",\"trace_id\":\"39c1b238-1d21-495c-886a-59695f4d2ca3\"}\n[2026-04-14 10:21:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"568a3ee9-b2a9-4b65-acdc-e6b3a067465a\",\"trace_id\":\"39c1b238-1d21-495c-886a-59695f4d2ca3\"}\n[2026-04-14 10:21:28] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.INFO: [HubSpot Journal Polling] Service ending {\"runtime_seconds\":56,\"total_cycles\":5,\"files_downloaded\":0,\"empty_files\":0,\"other_portal_skipped\":0,\"total_events\":0,\"events_per_file\":0,\"avg_api_ms\":179.7,\"avg_download_ms\":0.0,\"avg_transform_ms\":0.0,\"avg_process_ms\":0.0,\"peak_memory_mb\":99.75} {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:21:28] local.INFO: [HubSpot Journal Polling] Released polling lock {\"correlation_id\":\"a9e5eced-9965-4374-80bb-59fd67402866\",\"trace_id\":\"6a762b54-e3b2-4606-8dc6-3a383434765f\"}\n[2026-04-14 10:22:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e628b4b5-a260-4f1b-9772-c3fb8f959dcd\",\"trace_id\":\"a87cb34e-8ac3-49b6-b84d-5ec1b0f51c10\"}\n[2026-04-14 10:22:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"e628b4b5-a260-4f1b-9772-c3fb8f959dcd\",\"trace_id\":\"a87cb34e-8ac3-49b6-b84d-5ec1b0f51c10\"}\n[2026-04-14 10:22:05] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e628b4b5-a260-4f1b-9772-c3fb8f959dcd\",\"trace_id\":\"a87cb34e-8ac3-49b6-b84d-5ec1b0f51c10\"}\n[2026-04-14 10:22:08] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"154e4eab-6419-4d09-abbb-f2ae58f56ab9\",\"trace_id\":\"e6bf0f5c-b87f-4176-914c-e3915c704ecb\"}\n[2026-04-14 10:22:08] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"154e4eab-6419-4d09-abbb-f2ae58f56ab9\",\"trace_id\":\"e6bf0f5c-b87f-4176-914c-e3915c704ecb\"}\n[2026-04-14 10:22:10] local.NOTICE: Monitoring start {\"correlation_id\":\"bb373bb8-3b49-4c56-a262-e3c7eb494ba6\",\"trace_id\":\"b9294323-05f8-449a-a71d-ed8bb5b7a3f1\"}\n[2026-04-14 10:22:10] local.NOTICE: Monitoring end {\"correlation_id\":\"bb373bb8-3b49-4c56-a262-e3c7eb494ba6\",\"trace_id\":\"b9294323-05f8-449a-a71d-ed8bb5b7a3f1\"}\n[2026-04-14 10:22:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"92f4ab5d-c946-4203-92ab-3f40c73cf99e\",\"trace_id\":\"8e0d62c0-6e4a-46de-9a32-5e63920c6df0\"}\n[2026-04-14 10:22:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"92f4ab5d-c946-4203-92ab-3f40c73cf99e\",\"trace_id\":\"8e0d62c0-6e4a-46de-9a32-5e63920c6df0\"}\n[2026-04-14 10:22:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"84863ceb-b1f2-4e81-af5d-05a6c48367b8\",\"trace_id\":\"22775477-ff69-4f66-b7a5-29a8c11b5cc4\"}\n[2026-04-14 10:22:13] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"84863ceb-b1f2-4e81-af5d-05a6c48367b8\",\"trace_id\":\"22775477-ff69-4f66-b7a5-29a8c11b5cc4\"}\n[2026-04-14 10:22:13] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"84863ceb-b1f2-4e81-af5d-05a6c48367b8\",\"trace_id\":\"22775477-ff69-4f66-b7a5-29a8c11b5cc4\"}\n[2026-04-14 10:22:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"84863ceb-b1f2-4e81-af5d-05a6c48367b8\",\"trace_id\":\"22775477-ff69-4f66-b7a5-29a8c11b5cc4\"}\n[2026-04-14 10:22:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"67c43faf-702a-4c9f-bb88-5f4e85686c7b\",\"trace_id\":\"e4a6848c-4f4c-416e-a3a8-f05b0b21a887\"}\n[2026-04-14 10:22:15] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:20:00, 2026-04-14 10:22:00] {\"correlation_id\":\"67c43faf-702a-4c9f-bb88-5f4e85686c7b\",\"trace_id\":\"e4a6848c-4f4c-416e-a3a8-f05b0b21a887\"}\n[2026-04-14 10:22:15] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:20:00, 2026-04-14 10:22:00] {\"correlation_id\":\"67c43faf-702a-4c9f-bb88-5f4e85686c7b\",\"trace_id\":\"e4a6848c-4f4c-416e-a3a8-f05b0b21a887\"}\n[2026-04-14 10:22:15] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"67c43faf-702a-4c9f-bb88-5f4e85686c7b\",\"trace_id\":\"e4a6848c-4f4c-416e-a3a8-f05b0b21a887\"}\n[2026-04-14 10:22:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3e410b67-7611-41cf-a0e3-834e0f68d818\",\"trace_id\":\"e8767b80-d335-439b-8d22-1dca8e8bc8eb\"}\n[2026-04-14 10:22:17] local.INFO: [EmailSchedule] STARTING batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"3e410b67-7611-41cf-a0e3-834e0f68d818\",\"trace_id\":\"e8767b80-d335-439b-8d22-1dca8e8bc8eb\"}\n[2026-04-14 10:22:17] local.INFO: [EmailSchedule] FINISHED batch create {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"3e410b67-7611-41cf-a0e3-834e0f68d818\",\"trace_id\":\"e8767b80-d335-439b-8d22-1dca8e8bc8eb\"}\n[2026-04-14 10:22:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:create\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3e410b67-7611-41cf-a0e3-834e0f68d818\",\"trace_id\":\"e8767b80-d335-439b-8d22-1dca8e8bc8eb\"}\n[2026-04-14 10:22:18] local.INFO: [Jiminny\\Jobs\\Mailbox\\CreateBatches] processed 0 inboxes and created 0 batches {\"userId\":null,\"batchSize\":30,\"maxBatches\":1000} {\"correlation_id\":\"0e5a049a-1999-4887-a8e7-7889599c214c\",\"trace_id\":\"e8767b80-d335-439b-8d22-1dca8e8bc8eb\"}\n[2026-04-14 10:22:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8dc561a9-cdd8-4e38-b023-0ab20205eb86\",\"trace_id\":\"34991402-ce26-41a0-a900-dae545b432eb\"}\n[2026-04-14 10:22:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8dc561a9-cdd8-4e38-b023-0ab20205eb86\",\"trace_id\":\"34991402-ce26-41a0-a900-dae545b432eb\"}\n[2026-04-14 10:22:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"twilio:recover-tracks\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"0f68167e-2333-49b1-b390-ea1a49b7cac3\",\"trace_id\":\"0ee52e66-a4e9-449f-893e-80ebc4b18ed8\"}\n[2026-04-14 10:22:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"twilio:recover-tracks\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"0f68167e-2333-49b1-b390-ea1a49b7cac3\",\"trace_id\":\"0ee52e66-a4e9-449f-893e-80ebc4b18ed8\"}\n[2026-04-14 10:22:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:sync-users\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:22] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"connect-and-sell\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:22] local.INFO: Start user synchronisation {\"provider\":\"justcall\",\"teams_count\":1} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:22] local.INFO: Synchronising team {\"provider\":\"justcall\",\"team_id\":1} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:22] local.WARNING: [Salesforce] Account not connected for user {\"userId\":\"cdf9285a-8ded-4a8b-bd7d-ec68c398f2f9\",\"account\":{\"Jiminny\\\\Models\\\\SocialAccount\":{\"id\":1367,\"sociable_id\":1071,\"provider_user_id\":\"005O4000003s5c7IAA\",\"expires\":null,\"refresh_token_expires\":null,\"provider\":\"salesforce\",\"state\":\"full-refresh\",\"auth_scope\":\"refresh_token web api\",\"retry_after\":null,\"created_at\":\"2024-09-10 07:05:21\",\"updated_at\":\"2026-01-14 07:00:58\"}}} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {\"crm_provider\":\"salesforce\",\"crm_owner\":1071,\"team_id\":1} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {\"crm_provider\":\"salesforce\",\"team_id\":1} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.WARNING: Failed to sync external users {\"message\":\"Your Salesforce account has become disconnected. Please login to Jiminny to reconnect.\",\"provider\":\"justcall\",\"team_id\":1,\"team\":\"jiminny\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"ringcentral\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"avaya\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"telus\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"salesloft\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"talkdesk\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Skip provider synchronisation, no teams found {\"provider\":\"vonage\"} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Done {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:22:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:sync-users\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"89d6d82b-e5a7-4f96-8b0c-f323a2ececad\",\"trace_id\":\"df4758f7-7f72-4d58-9db0-6733e5368563\"}\n[2026-04-14 10:23:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8ce8c33f-c700-41d3-8bda-6e110e611a1a\",\"trace_id\":\"19452bae-f98b-4af5-878f-b40d8a8f1258\"}\n[2026-04-14 10:23:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"8ce8c33f-c700-41d3-8bda-6e110e611a1a\",\"trace_id\":\"19452bae-f98b-4af5-878f-b40d8a8f1258\"}\n[2026-04-14 10:23:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8ce8c33f-c700-41d3-8bda-6e110e611a1a\",\"trace_id\":\"19452bae-f98b-4af5-878f-b40d8a8f1258\"}\n[2026-04-14 10:23:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"6b3be9cc-381f-4c17-8f4e-2caa683edc61\",\"trace_id\":\"3f18971a-08b1-4972-ba4d-d22295790688\"}\n[2026-04-14 10:23:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"6b3be9cc-381f-4c17-8f4e-2caa683edc61\",\"trace_id\":\"3f18971a-08b1-4972-ba4d-d22295790688\"}\n[2026-04-14 10:23:08] local.NOTICE: Monitoring start {\"correlation_id\":\"bf906540-5d34-4691-a873-0e91d0debbb6\",\"trace_id\":\"c4b35815-ff2e-4735-9d65-dd772e1da6b2\"}\n[2026-04-14 10:23:08] local.NOTICE: Monitoring end {\"correlation_id\":\"bf906540-5d34-4691-a873-0e91d0debbb6\",\"trace_id\":\"c4b35815-ff2e-4735-9d65-dd772e1da6b2\"}\n[2026-04-14 10:23:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"7bdbd473-d7db-4197-93e1-b9b0bb3ba833\",\"trace_id\":\"a086a2f0-2533-4702-9a60-0471c3974081\"}\n[2026-04-14 10:23:09] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"7bdbd473-d7db-4197-93e1-b9b0bb3ba833\",\"trace_id\":\"a086a2f0-2533-4702-9a60-0471c3974081\"}\n[2026-04-14 10:23:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"98787823-e59a-47f2-9153-2f9fa0cb7a26\",\"trace_id\":\"10761287-c79c-4fa3-a90e-445cac9aae24\"}\n[2026-04-14 10:23:11] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"98787823-e59a-47f2-9153-2f9fa0cb7a26\",\"trace_id\":\"10761287-c79c-4fa3-a90e-445cac9aae24\"}\n[2026-04-14 10:23:11] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"98787823-e59a-47f2-9153-2f9fa0cb7a26\",\"trace_id\":\"10761287-c79c-4fa3-a90e-445cac9aae24\"}\n[2026-04-14 10:23:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"98787823-e59a-47f2-9153-2f9fa0cb7a26\",\"trace_id\":\"10761287-c79c-4fa3-a90e-445cac9aae24\"}\n[2026-04-14 10:23:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"690d7f65-e9e1-4508-9f9b-2f79d756fb2a\",\"trace_id\":\"e6ab1c5b-955d-4e02-914a-e143f108a5f1\"}\n[2026-04-14 10:23:13] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:retry-failed\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"690d7f65-e9e1-4508-9f9b-2f79d756fb2a\",\"trace_id\":\"e6ab1c5b-955d-4e02-914a-e143f108a5f1\"}\n[2026-04-14 10:23:13] local.ERROR: [integration-app] Validate team connection. SocialAccount is disconnected {\"team_id\":3143} {\"correlation_id\":\"5b00e761-7a45-418e-b069-640cc3bb1a0d\",\"trace_id\":\"1753955e-7f4d-4110-8f92-a3459ca5b81a\"}\n[2026-04-14 10:24:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"87769467-67d9-4fb9-85cc-8c4531f0134e\",\"trace_id\":\"b64603e0-591c-4eab-837d-12c2a9f93797\"}\n[2026-04-14 10:24:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"87769467-67d9-4fb9-85cc-8c4531f0134e\",\"trace_id\":\"b64603e0-591c-4eab-837d-12c2a9f93797\"}\n[2026-04-14 10:24:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"87769467-67d9-4fb9-85cc-8c4531f0134e\",\"trace_id\":\"b64603e0-591c-4eab-837d-12c2a9f93797\"}\n[2026-04-14 10:24:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"60d70644-b27b-429c-ab5d-855a94d5abc9\",\"trace_id\":\"6719dc62-67df-49c0-b389-88745f4872bf\"}\n[2026-04-14 10:24:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"60d70644-b27b-429c-ab5d-855a94d5abc9\",\"trace_id\":\"6719dc62-67df-49c0-b389-88745f4872bf\"}\n[2026-04-14 10:24:08] local.NOTICE: Monitoring start {\"correlation_id\":\"006fad04-1c48-4633-bb72-87c6347f4658\",\"trace_id\":\"6a029c1b-9125-445f-a3c4-f3b2b9a1c1a5\"}\n[2026-04-14 10:24:08] local.NOTICE: Monitoring end {\"correlation_id\":\"006fad04-1c48-4633-bb72-87c6347f4658\",\"trace_id\":\"6a029c1b-9125-445f-a3c4-f3b2b9a1c1a5\"}\n[2026-04-14 10:24:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"16fd1929-bb0d-46d2-95e5-b76fc91d8c3d\",\"trace_id\":\"d31705a1-f790-4db7-b1b8-3ad99261b620\"}\n[2026-04-14 10:24:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"16fd1929-bb0d-46d2-95e5-b76fc91d8c3d\",\"trace_id\":\"d31705a1-f790-4db7-b1b8-3ad99261b620\"}\n[2026-04-14 10:24:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ca87a1c3-2f4b-4e0f-ba98-a7d908526b89\",\"trace_id\":\"c448bb4a-7ef8-4a05-a137-9b30f2515fbf\"}\n[2026-04-14 10:24:12] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"ca87a1c3-2f4b-4e0f-ba98-a7d908526b89\",\"trace_id\":\"c448bb4a-7ef8-4a05-a137-9b30f2515fbf\"}\n[2026-04-14 10:24:12] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"ca87a1c3-2f4b-4e0f-ba98-a7d908526b89\",\"trace_id\":\"c448bb4a-7ef8-4a05-a137-9b30f2515fbf\"}\n[2026-04-14 10:24:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ca87a1c3-2f4b-4e0f-ba98-a7d908526b89\",\"trace_id\":\"c448bb4a-7ef8-4a05-a137-9b30f2515fbf\"}\n[2026-04-14 10:24:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ebba8eb5-06bf-42b8-b19a-907212a73a79\",\"trace_id\":\"f7d54925-142f-4902-a526-ab978ee2c37f\"}\n[2026-04-14 10:24:16] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:22:00, 2026-04-14 10:24:00] {\"correlation_id\":\"ebba8eb5-06bf-42b8-b19a-907212a73a79\",\"trace_id\":\"f7d54925-142f-4902-a526-ab978ee2c37f\"}\n[2026-04-14 10:24:16] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:22:00, 2026-04-14 10:24:00] {\"correlation_id\":\"ebba8eb5-06bf-42b8-b19a-907212a73a79\",\"trace_id\":\"f7d54925-142f-4902-a526-ab978ee2c37f\"}\n[2026-04-14 10:24:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ebba8eb5-06bf-42b8-b19a-907212a73a79\",\"trace_id\":\"f7d54925-142f-4902-a526-ab978ee2c37f\"}\n[2026-04-14 10:24:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:aircall:check-and-renew\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:19] local.INFO: [SocialAccountService] Fetching token {\"socialAccountId\":1496,\"provider\":\"aircall\"} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:19] local.INFO: [SocialAccountService] Token retrieved {\"socialAccountId\":1496,\"provider\":\"aircall\"} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:19] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:20] local.ERROR: [Aircall] Re-activating webhooks failed {\"team_id\":1,\"reason\":\"{\\\"message\\\":\\\"Forbidden\\\"}\"} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:aircall:check-and-renew\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"8ac1a42f-b470-42ad-bc56-a3d39f8b7c0d\",\"trace_id\":\"18f60670-d0b5-416e-865a-2b6d29a3fda3\"}\n[2026-04-14 10:24:22] local.INFO: [RetryFailedDownloads] Starting {\"options\":{\"from\":null,\"to\":null,\"help\":false,\"silent\":false,\"quiet\":false,\"verbose\":false,\"version\":false,\"ansi\":null,\"no-interaction\":false,\"env\":null}} {\"correlation_id\":\"c11b15ff-1036-4e32-b611-f8a3df3b8127\",\"trace_id\":\"685428df-6f1e-47b4-b2ea-521c6cbd3a85\"}\n[2026-04-14 10:25:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"c07afadb-0654-403b-8270-cfa193d8ce4f\",\"trace_id\":\"59f88c31-45e9-4243-a4dc-284e0e65602a\"}\n[2026-04-14 10:25:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"c07afadb-0654-403b-8270-cfa193d8ce4f\",\"trace_id\":\"59f88c31-45e9-4243-a4dc-284e0e65602a\"}\n[2026-04-14 10:25:04] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"c07afadb-0654-403b-8270-cfa193d8ce4f\",\"trace_id\":\"59f88c31-45e9-4243-a4dc-284e0e65602a\"}\n[2026-04-14 10:25:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"04359657-d8fa-4683-88ab-f41c05c65222\",\"trace_id\":\"c0a15344-1ad9-4977-b3c6-cdac7968dde4\"}\n[2026-04-14 10:25:06] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"04359657-d8fa-4683-88ab-f41c05c65222\",\"trace_id\":\"c0a15344-1ad9-4977-b3c6-cdac7968dde4\"}\n[2026-04-14 10:25:09] local.NOTICE: Monitoring start {\"correlation_id\":\"fedb1fd3-593c-4210-a082-f790f0aba781\",\"trace_id\":\"18f81fd2-1aa0-44a2-be9e-7c09a21a09d3\"}\n[2026-04-14 10:25:09] local.NOTICE: Monitoring end {\"correlation_id\":\"fedb1fd3-593c-4210-a082-f790f0aba781\",\"trace_id\":\"18f81fd2-1aa0-44a2-be9e-7c09a21a09d3\"}\n[2026-04-14 10:25:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"2bf8ad3e-04e8-40b8-b020-97fce6ca3029\",\"trace_id\":\"1661314e-6433-47c6-afd0-1ce9cd645edd\"}\n[2026-04-14 10:25:12] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"2bf8ad3e-04e8-40b8-b020-97fce6ca3029\",\"trace_id\":\"1661314e-6433-47c6-afd0-1ce9cd645edd\"}\n[2026-04-14 10:25:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"107e74dd-79aa-41fc-9eed-13f265a2e7e0\",\"trace_id\":\"25776c23-f7f0-42ba-9461-fd3f53dd417d\"}\n[2026-04-14 10:25:14] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"107e74dd-79aa-41fc-9eed-13f265a2e7e0\",\"trace_id\":\"25776c23-f7f0-42ba-9461-fd3f53dd417d\"}\n[2026-04-14 10:25:14] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"107e74dd-79aa-41fc-9eed-13f265a2e7e0\",\"trace_id\":\"25776c23-f7f0-42ba-9461-fd3f53dd417d\"}\n[2026-04-14 10:25:14] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"107e74dd-79aa-41fc-9eed-13f265a2e7e0\",\"trace_id\":\"25776c23-f7f0-42ba-9461-fd3f53dd417d\"}\n[2026-04-14 10:25:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ba5670c1-54b2-4c92-ad0f-4940e1edebed\",\"trace_id\":\"e7bf78d3-78c4-460d-91ea-b236d18092c5\"}\n[2026-04-14 10:25:16] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:purge-stale\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ba5670c1-54b2-4c92-ad0f-4940e1edebed\",\"trace_id\":\"e7bf78d3-78c4-460d-91ea-b236d18092c5\"}\n[2026-04-14 10:25:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"0c99a10a-93f7-4ba6-b9b1-bc4a1b49a62b\",\"trace_id\":\"ae62ca2a-dd5e-4eee-b063-f410f150d7a4\"}\n[2026-04-14 10:25:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:text-relay:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"0c99a10a-93f7-4ba6-b9b1-bc4a1b49a62b\",\"trace_id\":\"ae62ca2a-dd5e-4eee-b063-f410f150d7a4\"}\n[2026-04-14 10:25:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"d9d48905-6192-46b9-b697-8e94b16af1b3\",\"trace_id\":\"0f5793fd-8e00-4c96-8fd9-9caba00d41bc\"}\n[2026-04-14 10:25:20] local.INFO: Running pre-meeting notification command {\"correlation_id\":\"d9d48905-6192-46b9-b697-8e94b16af1b3\",\"trace_id\":\"0f5793fd-8e00-4c96-8fd9-9caba00d41bc\"}\n[2026-04-14 10:25:20] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-notification\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"d9d48905-6192-46b9-b697-8e94b16af1b3\",\"trace_id\":\"0f5793fd-8e00-4c96-8fd9-9caba00d41bc\"}\n[2026-04-14 10:25:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"a0aff5c4-6fdc-4bb1-9ec5-86e561600e12\",\"trace_id\":\"bdb17642-ebef-41ac-b598-7ab48079f333\"}\n[2026-04-14 10:25:22] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 10:15:00, 2026-04-14 10:20:00] {\"correlation_id\":\"a0aff5c4-6fdc-4bb1-9ec5-86e561600e12\",\"trace_id\":\"bdb17642-ebef-41ac-b598-7ab48079f333\"}\n[2026-04-14 10:25:22] local.INFO: [conference:monitor:start] No activities found in (2026-04-14 10:15:00, 2026-04-14 10:20:00] {\"correlation_id\":\"a0aff5c4-6fdc-4bb1-9ec5-86e561600e12\",\"trace_id\":\"bdb17642-ebef-41ac-b598-7ab48079f333\"}\n[2026-04-14 10:25:22] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:start\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"a0aff5c4-6fdc-4bb1-9ec5-86e561600e12\",\"trace_id\":\"bdb17642-ebef-41ac-b598-7ab48079f333\"}\n[2026-04-14 10:25:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"3f28aa59-2038-437b-b3f8-71dfcf92a66a\",\"trace_id\":\"2f8398d9-c13c-4292-8cd9-ec84535c749f\"}\n[2026-04-14 10:25:23] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesEnded {\"from\":\"10:20\",\"to\":\"10:25\"} {\"correlation_id\":\"3f28aa59-2038-437b-b3f8-71dfcf92a66a\",\"trace_id\":\"2f8398d9-c13c-4292-8cd9-ec84535c749f\"}\n[2026-04-14 10:25:23] local.INFO: conference:monitor:end:Jiminny\\Console\\Commands\\Activities\\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {\"from\":\"00:15\",\"to\":\"00:20\"} {\"correlation_id\":\"3f28aa59-2038-437b-b3f8-71dfcf92a66a\",\"trace_id\":\"2f8398d9-c13c-4292-8cd9-ec84535c749f\"}\n[2026-04-14 10:25:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:end\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"3f28aa59-2038-437b-b3f8-71dfcf92a66a\",\"trace_id\":\"2f8398d9-c13c-4292-8cd9-ec84535c749f\"}\n[2026-04-14 10:25:25] local.NOTICE: Repairing HubSpot tokens start {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:25] local.INFO: Trying to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:25] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:25] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":59,\"provider\":\"hubspot\",\"refreshToken\":\"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":59,\"updated_at\":\"2025-10-03 09:32:05\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":306,\"provider\":\"hubspot\",\"refreshToken\":\"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b\",\"state\":\"full-refresh\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":306,\"updated_at\":\"2023-11-27 09:30:03\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: Trying to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: [EncryptedTokenManager] Generating access token. {\"mode\":\"legacy\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.INFO: [SocialAccountService] Refreshing token from provider {\"socialAccountId\":1372,\"provider\":\"hubspot\",\"refreshToken\":\"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4\",\"state\":\"full-refresh\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.ERROR: Failed to refresh HubSpot token {\"account_id\":1372,\"updated_at\":\"2025-10-02 14:47:06\",\"reason\":\"missing or invalid refresh token\",\"previous\":\"\"} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:26] local.NOTICE: Repairing HubSpot tokens end {\"total\":3,\"fixed\":0,\"failed\":3} {\"correlation_id\":\"f4865ad6-41f7-429e-906c-3ff7b6477d5a\",\"trace_id\":\"c77f7d3e-7a59-4b12-a4b0-6804b95000ea\"}\n[2026-04-14 10:25:28] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"55bc4313-7c66-4136-9f5d-8e1fc1225670\",\"trace_id\":\"359c0125-96fc-46c4-8d19-89088b060aff\"}\n[2026-04-14 10:25:28] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"4447c4f7-17a4-4301-ab7b-eb90053f940f\",\"trace_id\":\"a31edfc1-4e06-41f1-96de-e69abed9b404\"}\n[2026-04-14 10:25:28] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"crm:bullhorn:ping\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"4447c4f7-17a4-4301-ab7b-eb90053f940f\",\"trace_id\":\"a31edfc1-4e06-41f1-96de-e69abed9b404\"}\n[2026-04-14 10:25:28] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:28] local.INFO: [HubSpot Journal Command] Starting polling service {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:28] local.INFO: [HubSpot Journal Polling] Service starting {\"memory_limit\":\"256M\",\"max_execution_time\":\"0\",\"initial_memory_mb\":62.0} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:29] local.INFO: [HubSpot Journal Polling] Acquired polling lock {\"expires_at\":\"2026-04-14T10:27:28.996306Z\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:29] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:29] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:29] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:pre-meeting-reminder\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"55bc4313-7c66-4136-9f5d-8e1fc1225670\",\"trace_id\":\"359c0125-96fc-46c4-8d19-89088b060aff\"}\n[2026-04-14 10:25:29] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:34] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:34] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:34] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:39] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:39] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:39] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:54] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:54] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:25:54] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"ec2b6ab8-433d-4988-9fc4-39aa9e6f7d76\",\"trace_id\":\"d2ff3c29-0c48-4449-859d-4fd503b2811b\"}\n[2026-04-14 10:26:07] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"ec2b6ab8-433d-4988-9fc4-39aa9e6f7d76\",\"trace_id\":\"d2ff3c29-0c48-4449-859d-4fd503b2811b\"}\n[2026-04-14 10:26:07] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"ec2b6ab8-433d-4988-9fc4-39aa9e6f7d76\",\"trace_id\":\"d2ff3c29-0c48-4449-859d-4fd503b2811b\"}\n[2026-04-14 10:26:10] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e8a78ad9-2c5b-48b3-af42-4fd16f1b3b95\",\"trace_id\":\"208430f6-334c-4edc-ad22-426bc66f2ca0\"}\n[2026-04-14 10:26:11] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e8a78ad9-2c5b-48b3-af42-4fd16f1b3b95\",\"trace_id\":\"208430f6-334c-4edc-ad22-426bc66f2ca0\"}\n[2026-04-14 10:26:14] local.NOTICE: Monitoring start {\"correlation_id\":\"6abc61c5-47aa-40f4-9504-214a85f90c80\",\"trace_id\":\"5979c806-c10b-458b-a634-036caa06b921\"}\n[2026-04-14 10:26:14] local.NOTICE: Monitoring end {\"correlation_id\":\"6abc61c5-47aa-40f4-9504-214a85f90c80\",\"trace_id\":\"5979c806-c10b-458b-a634-036caa06b921\"}\n[2026-04-14 10:26:17] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"b03b90de-df73-4a74-b7bc-c2210f641951\",\"trace_id\":\"e6761c94-ea37-41d1-a88a-079ec53b2ec8\"}\n[2026-04-14 10:26:18] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:skip-lists:refresh\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"b03b90de-df73-4a74-b7bc-c2210f641951\",\"trace_id\":\"e6761c94-ea37-41d1-a88a-079ec53b2ec8\"}\n[2026-04-14 10:26:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"6d9d5fba-7219-46d2-9298-d2c71421a694\",\"trace_id\":\"dcd4d636-234d-4605-86b5-1992156cce8b\"}\n[2026-04-14 10:26:21] local.INFO: [EmailSchedule] STARTING batch process {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"6d9d5fba-7219-46d2-9298-d2c71421a694\",\"trace_id\":\"dcd4d636-234d-4605-86b5-1992156cce8b\"}\n[2026-04-14 10:26:21] local.INFO: [EmailSchedule] FINISHED batch process {\"host\":\"docker_lamp_1\",\"processed\":0} {\"correlation_id\":\"6d9d5fba-7219-46d2-9298-d2c71421a694\",\"trace_id\":\"dcd4d636-234d-4605-86b5-1992156cce8b\"}\n[2026-04-14 10:26:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:batch:process\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"6d9d5fba-7219-46d2-9298-d2c71421a694\",\"trace_id\":\"dcd4d636-234d-4605-86b5-1992156cce8b\"}\n[2026-04-14 10:26:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"640dfd99-289e-4464-898e-f10bd05d7c1c\",\"trace_id\":\"a61f1d24-3e02-46cf-b339-dda3c9347237\"}\n[2026-04-14 10:26:23] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:24:00, 2026-04-14 10:26:00] {\"correlation_id\":\"640dfd99-289e-4464-898e-f10bd05d7c1c\",\"trace_id\":\"a61f1d24-3e02-46cf-b339-dda3c9347237\"}\n[2026-04-14 10:26:23] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:24:00, 2026-04-14 10:26:00] {\"correlation_id\":\"640dfd99-289e-4464-898e-f10bd05d7c1c\",\"trace_id\":\"a61f1d24-3e02-46cf-b339-dda3c9347237\"}\n[2026-04-14 10:26:23] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"conference:monitor:count\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"640dfd99-289e-4464-898e-f10bd05d7c1c\",\"trace_id\":\"a61f1d24-3e02-46cf-b339-dda3c9347237\"}\n[2026-04-14 10:26:25] local.INFO: [HubSpot Journal Polling] Getting offset from database {\"offset\":\"\",\"jiminny_team_id\":1} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.INFO: [HubSpot Journal API] Fetching latest journal entry {\"url\":\"https://api.hubapi.com/webhooks/v4/journal/latest\"} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.INFO: [HubSpot Journal Polling] No data {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {\"empty_results\":5,\"max_empty_results\":5} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.INFO: [HubSpot Journal Polling] Service ending {\"runtime_seconds\":57,\"total_cycles\":5,\"files_downloaded\":0,\"empty_files\":0,\"other_portal_skipped\":0,\"total_events\":0,\"events_per_file\":0,\"avg_api_ms\":176.8,\"avg_download_ms\":0.0,\"avg_transform_ms\":0.0,\"avg_process_ms\":0.0,\"peak_memory_mb\":99.75} {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:25] local.INFO: [HubSpot Journal Polling] Released polling lock {\"correlation_id\":\"b3a34a1f-3889-4aaf-9ef7-6aab2fbaff3a\",\"trace_id\":\"f2211483-3b9d-4a1a-b742-78b35aa2ef91\"}\n[2026-04-14 10:26:26] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"e32bab70-484f-463b-9fe9-ceb556655fe6\",\"trace_id\":\"efff9002-89e1-4f8f-80e0-8134ad07ec36\"}\n[2026-04-14 10:26:27] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"activity:notify-not-logged\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"e32bab70-484f-463b-9fe9-ceb556655fe6\",\"trace_id\":\"efff9002-89e1-4f8f-80e0-8134ad07ec36\"}\n[2026-04-14 10:26:33] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"4bad17e3-4d02-4827-93ef-4b7963d39627\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:33] local.INFO: [EmailSchedule] STARTING Inbox Sync {\"host\":\"docker_lamp_1\"} {\"correlation_id\":\"4bad17e3-4d02-4827-93ef-4b7963d39627\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:34] local.INFO: [EmailSchedule] FINISHED Inbox Sync {\"host\":\"docker_lamp_1\",\"events\":1} {\"correlation_id\":\"4bad17e3-4d02-4827-93ef-4b7963d39627\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:34] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"mailbox:sync\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"4bad17e3-4d02-4827-93ef-4b7963d39627\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:35] local.INFO: [Sync Mailbox] Sync start {\"inbox_id\":59} {\"correlation_id\":\"d941de3d-4c89-4d94-a3a3-48a90e525f9e\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:35] local.INFO: [Inbox service] Skipping METADATA SYNC for inbox 59 due to unauthorized access to the mailbox {\"correlation_id\":\"d941de3d-4c89-4d94-a3a3-48a90e525f9e\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:26:35] local.INFO: [Sync Mailbox] Sync complete {\"inbox_id\":59} {\"correlation_id\":\"d941de3d-4c89-4d94-a3a3-48a90e525f9e\",\"trace_id\":\"16b89aa6-aaf3-4bd5-9432-34300c48a03c\"}\n[2026-04-14 10:27:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"59c59788-bb08-4659-8792-75c738056638\",\"trace_id\":\"ccfc98c0-3577-45eb-b2ea-3793f3614a03\"}\n[2026-04-14 10:27:19] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {\"correlation_id\":\"59c59788-bb08-4659-8792-75c738056638\",\"trace_id\":\"ccfc98c0-3577-45eb-b2ea-3793f3614a03\"}\n[2026-04-14 10:27:19] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"meeting-bot:schedule-bot\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"59c59788-bb08-4659-8792-75c738056638\",\"trace_id\":\"ccfc98c0-3577-45eb-b2ea-3793f3614a03\"}\n[2026-04-14 10:27:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage before starting command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryPeakBeforeCommandInMb\":99.746} {\"correlation_id\":\"fd89ff27-9f90-4ca5-8a1b-07fdb2318bf8\",\"trace_id\":\"1a652459-8d6e-40ec-b302-2421e2e290d2\"}\n[2026-04-14 10:27:21] local.INFO: Jiminny\\Console\\Commands\\Command::run Memory usage for command {\"command\":\"dialers:monitor-activities\",\"memoryBeforeCommandInMb\":62.0,\"memoryAfterCommandInMB\":62.0,\"memoryPeakBeforeCommandInMb\":99.746,\"memoryPeakAfterCommandInMB\":99.746} {\"correlation_id\":\"fd89ff27-9f90-4ca5-8a1b-07fdb2318bf8\",\"trace_id\":\"1a652459-8d6e-40ec-b302-2421e2e290d2\"}\n[2026-04-14 10:27:23] local.NOTICE: Monitoring start {\"correlation_id\":\"1326ca30-351f-4a04-9e17-0eb197f7a97a\",\"trace_id\":\"dd0fd46b-204d-480f-b13c-cf070053ff83\"}\n[2026-04-14 10:27:23] local.NOTICE: Monitoring end {\"correlation_id\":\"1326ca30-351f-4a04-9e17-0eb197f7a97a\",\"trace_id\":\"dd0fd46b-204d-480f-b13c-cf070053ff83\"}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.049609374,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"14","depth":4,"bounds":{"left":0.31875,"top":0.23819445,"width":0.011328125,"height":0.013194445},"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.33242187,"top":0.23819445,"width":0.009375,"height":0.013194445},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.34375,"top":0.23680556,"width":0.00859375,"height":0.015972223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.35234374,"top":0.23680556,"width":0.008203125,"height":0.015972223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Console\\Commands\\Reports;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Console\\OutputStyle;\nuse Illuminate\\Contracts\\Bus\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Jiminny\\Console\\Commands\\Reports\\AutomatedReportsCommand;\nuse Jiminny\\Jobs\\AutomatedReports\\RequestGenerateAskJiminnyReportJob;\nuse Jiminny\\Jobs\\AutomatedReports\\RequestGenerateReportJob;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse PHPUnit\\Framework\\TestCase;\nuse Psr\\Log\\LoggerInterface;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\n\nclass AutomatedReportsCommandTest extends TestCase\n{\n private LoggerInterface&Mockery\\MockInterface $logger;\n private Dispatcher&Mockery\\MockInterface $dispatcher;\n private AutomatedReportsRepository&Mockery\\MockInterface $reportRepository;\n private InputInterface&MockObject $input;\n private OutputStyle&MockObject $output;\n private AutomatedReportsCommand $command;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->logger = Mockery::mock(LoggerInterface::class);\n $this->dispatcher = Mockery::mock(Dispatcher::class);\n $this->reportRepository = Mockery::mock(AutomatedReportsRepository::class);\n $this->input = $this->createMock(InputInterface::class);\n $this->output = $this->createMock(OutputStyle::class);\n $this->command = new AutomatedReportsCommand($this->logger, $this->dispatcher, $this->reportRepository);\n $this->input->method('getOption')->with('report-id')->willReturn(null);\n $this->command->setInput($this->input);\n $this->command->setOutput($this->output);\n }\n\n protected function tearDown(): void\n {\n Carbon::setTestNow();\n Mockery::close();\n parent::tearDown();\n }\n\n public function testProcessDailyReportsEveryDay(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 13, 10, 0, 0));\n\n $reports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 2);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($reports));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->twice()\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testDispatchesAskJiminnyJobForAskJiminnyReports(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 13, 10, 0, 0));\n\n $askJiminnyReport = $this->createAskJiminnyReport(AutomatedReportsService::FREQUENCY_DAILY);\n $standardReport = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 1)[0];\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection([$askJiminnyReport, $standardReport]));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->once()\n ->with(Mockery::type(RequestGenerateAskJiminnyReportJob::class));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->once()\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testProcessWeeklyReportsOnMonday(): void\n {\n Carbon::setTestNow(Carbon::create(2023, 12, 11, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 1);\n $weeklyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_WEEKLY, 2);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_WEEKLY)\n ->andReturn(new Collection($weeklyReports));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->times(3)\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testDoNotProcessWeeklyReportsOnNonMonday(): void\n {\n Carbon::setTestNow(Carbon::create(2023, 12, 12, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 0);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldNotReceive('getActiveReportsByFrequency')\n ->with(AutomatedReportsService::FREQUENCY_WEEKLY);\n\n $this->dispatcher->shouldNotReceive('dispatch');\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testProcessMonthlyReportsOnFirstDayOfMonth(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 1, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 0);\n $monthlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_MONTHLY, 2);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_MONTHLY)\n ->andReturn(new Collection($monthlyReports));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->twice()\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testDoNotProcessMonthlyReportsOnNonFirstDayOfMonth(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 13, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 0);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldNotReceive('getActiveReportsByFrequency')\n ->with(AutomatedReportsService::FREQUENCY_MONTHLY);\n\n $this->reportRepository->shouldNotReceive('getActiveReportsByFrequency')\n ->with(AutomatedReportsService::FREQUENCY_QUARTERLY);\n\n $this->dispatcher->shouldNotReceive('dispatch');\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testProcessQuarterlyReportsOnFirstDayOfQuarterlyMonth(): void\n {\n // 2024-10-01 is a Tuesday (first day of quarterly month, not Monday)\n Carbon::setTestNow(Carbon::create(2024, 10, 1, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 0);\n $monthlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_MONTHLY, 1);\n $quarterlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_QUARTERLY, 1);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_MONTHLY)\n ->andReturn(new Collection($monthlyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_QUARTERLY)\n ->andReturn(new Collection($quarterlyReports));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->twice()\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testDoNotProcessQuarterlyReportsOnNonQuarterlyFirstDay(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 1, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 0);\n $monthlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_MONTHLY, 0);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_MONTHLY)\n ->andReturn(new Collection($monthlyReports));\n\n $this->reportRepository->shouldNotReceive('getActiveReportsByFrequency')\n ->with(AutomatedReportsService::FREQUENCY_QUARTERLY);\n\n $this->dispatcher->shouldNotReceive('dispatch');\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testProcessAllFrequenciesOnMondayFirstDayOfQuarterlyMonth(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 7, 1, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 1);\n $weeklyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_WEEKLY, 1);\n $monthlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_MONTHLY, 1);\n $quarterlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_QUARTERLY, 1);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_WEEKLY)\n ->andReturn(new Collection($weeklyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_MONTHLY)\n ->andReturn(new Collection($monthlyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_QUARTERLY)\n ->andReturn(new Collection($quarterlyReports));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->times(4)\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testReturnsZeroOnSuccess(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 13, 10, 0, 0));\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection([]));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n private function createStandardReports(string $frequency, int $count): array\n {\n $reports = [];\n\n for ($i = 0; $i < $count; $i++) {\n $report = Mockery::mock();\n $report->shouldReceive('getUuid')->andReturn('uuid-' . $i);\n $report->shouldReceive('getTeamId')->andReturn($i + 1);\n $report->shouldReceive('getFrequency')->andReturn($frequency);\n $report->shouldReceive('getType')->andReturn(AutomatedReportsService::TYPE_LOSS_ANALYSIS);\n $report->shouldReceive('isAskJiminnyReport')->andReturn(false);\n\n $reports[] = $report;\n }\n\n return $reports;\n }\n\n private function createAskJiminnyReport(string $frequency): mixed\n {\n $report = Mockery::mock();\n $report->shouldReceive('getUuid')->andReturn('ask-jiminny-uuid');\n $report->shouldReceive('getTeamId')->andReturn(99);\n $report->shouldReceive('getFrequency')->andReturn($frequency);\n $report->shouldReceive('getType')->andReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->shouldReceive('isAskJiminnyReport')->andReturn(true);\n\n return $report;\n }\n}","depth":4,"bounds":{"left":0.15234375,"top":0.0,"width":0.28320312,"height":1.0},"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Console\\Commands\\Reports;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Console\\OutputStyle;\nuse Illuminate\\Contracts\\Bus\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Jiminny\\Console\\Commands\\Reports\\AutomatedReportsCommand;\nuse Jiminny\\Jobs\\AutomatedReports\\RequestGenerateAskJiminnyReportJob;\nuse Jiminny\\Jobs\\AutomatedReports\\RequestGenerateReportJob;\nuse Jiminny\\Repositories\\AutomatedReportsRepository;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Mockery;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse PHPUnit\\Framework\\TestCase;\nuse Psr\\Log\\LoggerInterface;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\n\nclass AutomatedReportsCommandTest extends TestCase\n{\n private LoggerInterface&Mockery\\MockInterface $logger;\n private Dispatcher&Mockery\\MockInterface $dispatcher;\n private AutomatedReportsRepository&Mockery\\MockInterface $reportRepository;\n private InputInterface&MockObject $input;\n private OutputStyle&MockObject $output;\n private AutomatedReportsCommand $command;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->logger = Mockery::mock(LoggerInterface::class);\n $this->dispatcher = Mockery::mock(Dispatcher::class);\n $this->reportRepository = Mockery::mock(AutomatedReportsRepository::class);\n $this->input = $this->createMock(InputInterface::class);\n $this->output = $this->createMock(OutputStyle::class);\n $this->command = new AutomatedReportsCommand($this->logger, $this->dispatcher, $this->reportRepository);\n $this->input->method('getOption')->with('report-id')->willReturn(null);\n $this->command->setInput($this->input);\n $this->command->setOutput($this->output);\n }\n\n protected function tearDown(): void\n {\n Carbon::setTestNow();\n Mockery::close();\n parent::tearDown();\n }\n\n public function testProcessDailyReportsEveryDay(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 13, 10, 0, 0));\n\n $reports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 2);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($reports));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->twice()\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testDispatchesAskJiminnyJobForAskJiminnyReports(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 13, 10, 0, 0));\n\n $askJiminnyReport = $this->createAskJiminnyReport(AutomatedReportsService::FREQUENCY_DAILY);\n $standardReport = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 1)[0];\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection([$askJiminnyReport, $standardReport]));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->once()\n ->with(Mockery::type(RequestGenerateAskJiminnyReportJob::class));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->once()\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testProcessWeeklyReportsOnMonday(): void\n {\n Carbon::setTestNow(Carbon::create(2023, 12, 11, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 1);\n $weeklyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_WEEKLY, 2);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_WEEKLY)\n ->andReturn(new Collection($weeklyReports));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->times(3)\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testDoNotProcessWeeklyReportsOnNonMonday(): void\n {\n Carbon::setTestNow(Carbon::create(2023, 12, 12, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 0);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldNotReceive('getActiveReportsByFrequency')\n ->with(AutomatedReportsService::FREQUENCY_WEEKLY);\n\n $this->dispatcher->shouldNotReceive('dispatch');\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testProcessMonthlyReportsOnFirstDayOfMonth(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 1, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 0);\n $monthlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_MONTHLY, 2);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_MONTHLY)\n ->andReturn(new Collection($monthlyReports));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->twice()\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testDoNotProcessMonthlyReportsOnNonFirstDayOfMonth(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 13, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 0);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldNotReceive('getActiveReportsByFrequency')\n ->with(AutomatedReportsService::FREQUENCY_MONTHLY);\n\n $this->reportRepository->shouldNotReceive('getActiveReportsByFrequency')\n ->with(AutomatedReportsService::FREQUENCY_QUARTERLY);\n\n $this->dispatcher->shouldNotReceive('dispatch');\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testProcessQuarterlyReportsOnFirstDayOfQuarterlyMonth(): void\n {\n // 2024-10-01 is a Tuesday (first day of quarterly month, not Monday)\n Carbon::setTestNow(Carbon::create(2024, 10, 1, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 0);\n $monthlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_MONTHLY, 1);\n $quarterlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_QUARTERLY, 1);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_MONTHLY)\n ->andReturn(new Collection($monthlyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_QUARTERLY)\n ->andReturn(new Collection($quarterlyReports));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->twice()\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testDoNotProcessQuarterlyReportsOnNonQuarterlyFirstDay(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 1, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 0);\n $monthlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_MONTHLY, 0);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_MONTHLY)\n ->andReturn(new Collection($monthlyReports));\n\n $this->reportRepository->shouldNotReceive('getActiveReportsByFrequency')\n ->with(AutomatedReportsService::FREQUENCY_QUARTERLY);\n\n $this->dispatcher->shouldNotReceive('dispatch');\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testProcessAllFrequenciesOnMondayFirstDayOfQuarterlyMonth(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 7, 1, 10, 0, 0));\n\n $dailyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_DAILY, 1);\n $weeklyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_WEEKLY, 1);\n $monthlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_MONTHLY, 1);\n $quarterlyReports = $this->createStandardReports(AutomatedReportsService::FREQUENCY_QUARTERLY, 1);\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection($dailyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_WEEKLY)\n ->andReturn(new Collection($weeklyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_MONTHLY)\n ->andReturn(new Collection($monthlyReports));\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_QUARTERLY)\n ->andReturn(new Collection($quarterlyReports));\n\n $this->dispatcher->shouldReceive('dispatch')\n ->times(4)\n ->with(Mockery::type(RequestGenerateReportJob::class));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n public function testReturnsZeroOnSuccess(): void\n {\n Carbon::setTestNow(Carbon::create(2024, 3, 13, 10, 0, 0));\n\n $this->logger->shouldReceive('info')->atLeast()->once();\n\n $this->reportRepository->shouldReceive('getActiveReportsByFrequency')\n ->once()\n ->with(AutomatedReportsService::FREQUENCY_DAILY)\n ->andReturn(new Collection([]));\n\n $result = $this->command->handle();\n\n $this->assertEquals(0, $result);\n }\n\n private function createStandardReports(string $frequency, int $count): array\n {\n $reports = [];\n\n for ($i = 0; $i < $count; $i++) {\n $report = Mockery::mock();\n $report->shouldReceive('getUuid')->andReturn('uuid-' . $i);\n $report->shouldReceive('getTeamId')->andReturn($i + 1);\n $report->shouldReceive('getFrequency')->andReturn($frequency);\n $report->shouldReceive('getType')->andReturn(AutomatedReportsService::TYPE_LOSS_ANALYSIS);\n $report->shouldReceive('isAskJiminnyReport')->andReturn(false);\n\n $reports[] = $report;\n }\n\n return $reports;\n }\n\n private function createAskJiminnyReport(string $frequency): mixed\n {\n $report = Mockery::mock();\n $report->shouldReceive('getUuid')->andReturn('ask-jiminny-uuid');\n $report->shouldReceive('getTeamId')->andReturn(99);\n $report->shouldReceive('getFrequency')->andReturn($frequency);\n $report->shouldReceive('getType')->andReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->shouldReceive('isAskJiminnyReport')->andReturn(true);\n\n return $report;\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.0140625,"top":0.041666668,"width":0.028515626,"height":0.021527778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6471947546197382969
|
-2358355934385201923
|
visual_change
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 fix test
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsCommandTest
Run 'AutomatedReportsCommandTest'
Debug 'AutomatedReportsCommandTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
873
Previous Highlighted Error
Next Highlighted Error
[2026-04-14 10:05:19] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"9756bfa7-c8e1-4b17-bc55-9f224d2af2e3","trace_id":"9e5fa115-9cf5-45d6-a1da-109e154cfae7"}
[2026-04-14 10:05:19] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"9756bfa7-c8e1-4b17-bc55-9f224d2af2e3","trace_id":"9e5fa115-9cf5-45d6-a1da-109e154cfae7"}
[2026-04-14 10:05:23] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"d9d68876-323b-42bd-9953-635da8008f2e","trace_id":"6c00ce4c-f2df-4ccb-908d-4862de973096"}
[2026-04-14 10:05:23] local.INFO: Running pre-meeting notification command {"correlation_id":"d9d68876-323b-42bd-9953-635da8008f2e","trace_id":"6c00ce4c-f2df-4ccb-908d-4862de973096"}
[2026-04-14 10:05:23] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"d9d68876-323b-42bd-9953-635da8008f2e","trace_id":"6c00ce4c-f2df-4ccb-908d-4862de973096"}
[2026-04-14 10:05:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"27d73fea-a8cb-4757-9bbb-fbe7222e6943","trace_id":"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e"}
[2026-04-14 10:05:26] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 09:55:00, 2026-04-14 10:00:00] {"correlation_id":"27d73fea-a8cb-4757-9bbb-fbe7222e6943","trace_id":"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e"}
[2026-04-14 10:05:26] local.INFO: [conference:monitor:start] start ok {"activity_id":407307} {"correlation_id":"27d73fea-a8cb-4757-9bbb-fbe7222e6943","trace_id":"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e"}
[2026-04-14 10:05:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"27d73fea-a8cb-4757-9bbb-fbe7222e6943","trace_id":"bcdb88d0-a641-43e4-85e8-b7dc4ab20a0e"}
[2026-04-14 10:05:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"588bae45-3998-4b86-b056-51aaf8b6882f","trace_id":"8f716a65-7768-44c5-b0e4-02a859f329e5"}
[2026-04-14 10:05:28] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:00","to":"10:05"} {"correlation_id":"588bae45-3998-4b86-b056-51aaf8b6882f","trace_id":"8f716a65-7768-44c5-b0e4-02a859f329e5"}
[2026-04-14 10:05:28] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"23:55","to":"00:00"} {"correlation_id":"588bae45-3998-4b86-b056-51aaf8b6882f","trace_id":"8f716a65-7768-44c5-b0e4-02a859f329e5"}
[2026-04-14 10:05:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"588bae45-3998-4b86-b056-51aaf8b6882f","trace_id":"8f716a65-7768-44c5-b0e4-02a859f329e5"}
[2026-04-14 10:05:30] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:30] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:30] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:30] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b","state":"full-refresh"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: Trying to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":306,"provider":"hubspot","refreshToken":"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b","state":"full-refresh"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: Trying to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1372,"provider":"hubspot","refreshToken":"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4","state":"full-refresh"} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:31] local.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"da835e46-68f6-4d4c-bf42-aa41de2e599d","trace_id":"7d96dad0-2325-4190-bff6-a2d83f01c4e1"}
[2026-04-14 10:05:34] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-reminder","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"2b2ca83a-1263-4a7c-a5d7-86dc15ea7aec","trace_id":"fbf48d3d-4e50-4442-b14f-d2ae5e6e70bd"}
[2026-04-14 10:05:34] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"crm:bullhorn:ping","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"73b127c9-c033-4fa7-a8ed-2e28077ba970","trace_id":"fd1cf3c5-d4ce-41d6-a19d-5e67fd544d9e"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"crm:bullhorn:ping","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"73b127c9-c033-4fa7-a8ed-2e28077ba970","trace_id":"fd1cf3c5-d4ce-41d6-a19d-5e67fd544d9e"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Command] Starting polling service {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Service starting {"memory_limit":"256M","max_execution_time":"0","initial_memory_mb":62.0} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Acquired polling lock {"expires_at":"2026-04-14T10:07:34.196472Z"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal API] Fetching latest journal entry {"url":"https://api.hubapi.com/webhooks/v4/journal/latest"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:34] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-reminder","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"2b2ca83a-1263-4a7c-a5d7-86dc15ea7aec","trace_id":"fbf48d3d-4e50-4442-b14f-d2ae5e6e70bd"}
[2026-04-14 10:05:34] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:39] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:39] local.INFO: [HubSpot Journal API] Fetching latest journal entry {"url":"https://api.hubapi.com/webhooks/v4/journal/latest"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:39] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:44] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:44] local.INFO: [HubSpot Journal API] Fetching latest journal entry {"url":"https://api.hubapi.com/webhooks/v4/journal/latest"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:44] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:59] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:05:59] local.INFO: [HubSpot Journal API] Fetching latest journal entry {"url":"https://api.hubapi.com/webhooks/v4/journal/latest"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:00] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a","trace_id":"b4c87c8d-120d-48fb-b13c-aee84323f3e2"}
[2026-04-14 10:06:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a","trace_id":"b4c87c8d-120d-48fb-b13c-aee84323f3e2"}
[2026-04-14 10:06:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"44f01bd8-2599-41a4-b7c3-8bb1fdf0df9a","trace_id":"b4c87c8d-120d-48fb-b13c-aee84323f3e2"}
[2026-04-14 10:06:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"8403c1e4-b5b6-41f9-9280-ff666beed28b","trace_id":"3f631f60-6d14-44f5-b6c3-b401999867f9"}
[2026-04-14 10:06:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"8403c1e4-b5b6-41f9-9280-ff666beed28b","trace_id":"3f631f60-6d14-44f5-b6c3-b401999867f9"}
[2026-04-14 10:06:08] local.NOTICE: Monitoring start {"correlation_id":"0d51eb08-f2f1-4322-97d0-268700856a99","trace_id":"92b45b9a-b6e8-40c8-a783-193cf1a4eea2"}
[2026-04-14 10:06:08] local.NOTICE: Monitoring end {"correlation_id":"0d51eb08-f2f1-4322-97d0-268700856a99","trace_id":"92b45b9a-b6e8-40c8-a783-193cf1a4eea2"}
[2026-04-14 10:06:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"0566c59b-bf67-49eb-970a-a6b955ddd756","trace_id":"724c5f5e-cd88-41fb-9b7e-74315e131024"}
[2026-04-14 10:06:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"0566c59b-bf67-49eb-970a-a6b955ddd756","trace_id":"724c5f5e-cd88-41fb-9b7e-74315e131024"}
[2026-04-14 10:06:12] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"33d190d4-0abb-4e63-af52-95faa913e7a1","trace_id":"703aaa4d-a551-4ed1-8a4a-609d373e2fc0"}
[2026-04-14 10:06:12] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"33d190d4-0abb-4e63-af52-95faa913e7a1","trace_id":"703aaa4d-a551-4ed1-8a4a-609d373e2fc0"}
[2026-04-14 10:06:12] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"33d190d4-0abb-4e63-af52-95faa913e7a1","trace_id":"703aaa4d-a551-4ed1-8a4a-609d373e2fc0"}
[2026-04-14 10:06:12] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"33d190d4-0abb-4e63-af52-95faa913e7a1","trace_id":"703aaa4d-a551-4ed1-8a4a-609d373e2fc0"}
[2026-04-14 10:06:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"da41d77d-46d9-41ae-90b7-f8418b05fb9a","trace_id":"47329a55-e6f4-406b-8730-e72d69737f09"}
[2026-04-14 10:06:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:04:00, 2026-04-14 10:06:00] {"correlation_id":"da41d77d-46d9-41ae-90b7-f8418b05fb9a","trace_id":"47329a55-e6f4-406b-8730-e72d69737f09"}
[2026-04-14 10:06:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:04:00, 2026-04-14 10:06:00] {"correlation_id":"da41d77d-46d9-41ae-90b7-f8418b05fb9a","trace_id":"47329a55-e6f4-406b-8730-e72d69737f09"}
[2026-04-14 10:06:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"da41d77d-46d9-41ae-90b7-f8418b05fb9a","trace_id":"47329a55-e6f4-406b-8730-e72d69737f09"}
[2026-04-14 10:06:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:notify-not-logged","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"310e7e99-6de4-4f93-967e-37c78e9ec826","trace_id":"2a1fdf0a-be0e-4e5a-a677-fa16ddc33e9e"}
[2026-04-14 10:06:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:notify-not-logged","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"310e7e99-6de4-4f93-967e-37c78e9ec826","trace_id":"2a1fdf0a-be0e-4e5a-a677-fa16ddc33e9e"}
[2026-04-14 10:06:19] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:sync","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"de8430ad-f242-4536-bebe-e165320b6b26","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:19] local.INFO: [EmailSchedule] STARTING Inbox Sync {"host":"docker_lamp_1"} {"correlation_id":"de8430ad-f242-4536-bebe-e165320b6b26","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:19] local.INFO: [EmailSchedule] FINISHED Inbox Sync {"host":"docker_lamp_1","events":1} {"correlation_id":"de8430ad-f242-4536-bebe-e165320b6b26","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:19] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:sync","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"de8430ad-f242-4536-bebe-e165320b6b26","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:22] local.INFO: [Sync Mailbox] Sync start {"inbox_id":59} {"correlation_id":"eb46c86e-5c80-48b1-a4ee-ac425f197754","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:22] local.INFO: [Inbox service] Skipping METADATA SYNC for inbox 59 due to unauthorized access to the mailbox {"correlation_id":"eb46c86e-5c80-48b1-a4ee-ac425f197754","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:22] local.INFO: [Sync Mailbox] Sync complete {"inbox_id":59} {"correlation_id":"eb46c86e-5c80-48b1-a4ee-ac425f197754","trace_id":"75f83d2f-4e5e-4086-b062-7c1d24b5b74c"}
[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Getting offset from database {"offset":"","jiminny_team_id":1} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.INFO: [HubSpot Journal API] Fetching latest journal entry {"url":"https://api.hubapi.com/webhooks/v4/journal/latest"} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {"empty_results":5,"max_empty_results":5} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {"empty_results":5,"max_empty_results":5} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Service ending {"runtime_seconds":56,"total_cycles":5,"files_downloaded":0,"empty_files":0,"other_portal_skipped":0,"total_events":0,"events_per_file":0,"avg_api_ms":169.9,"avg_download_ms":0.0,"avg_transform_ms":0.0,"avg_process_ms":0.0,"peak_memory_mb":99.75} {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:06:30] local.INFO: [HubSpot Journal Polling] Released polling lock {"correlation_id":"8dfaefe8-60b1-4846-bfa3-eb703c71deb8","trace_id":"186e2ff6-96dc-4ae6-a31b-0c3849678f7b"}
[2026-04-14 10:07:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"53329974-bdd6-4cd2-a022-0d565b0a5cf4","trace_id":"08246763-f961-45fb-b262-51378bdbc955"}
[2026-04-14 10:07:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"53329974-bdd6-4cd2-a022-0d565b0a5cf4","trace_id":"08246763-f961-45fb-b262-51378bdbc955"}
[2026-04-14 10:07:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"53329974-bdd6-4cd2-a022-0d565b0a5cf4","trace_id":"08246763-f961-45fb-b262-51378bdbc955"}
[2026-04-14 10:07:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"2b6586f0-419e-4422-8800-e4b7619c43d6","trace_id":"221c682d-c45f-4e4a-a793-ed11006dc6a1"}
[2026-04-14 10:07:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"2b6586f0-419e-4422-8800-e4b7619c43d6","trace_id":"221c682d-c45f-4e4a-a793-ed11006dc6a1"}
[2026-04-14 10:07:08] local.NOTICE: Monitoring start {"correlation_id":"9ba692ee-5286-41ca-abf0-86f6e1167a8e","trace_id":"d58ab8ad-7737-4d7c-91c0-81733c21e709"}
[2026-04-14 10:07:08] local.NOTICE: Monitoring end {"correlation_id":"9ba692ee-5286-41ca-abf0-86f6e1167a8e","trace_id":"d58ab8ad-7737-4d7c-91c0-81733c21e709"}
[2026-04-14 10:07:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"28e708ed-74ee-4417-a8da-c1a9ae0cd745","trace_id":"bd848201-9700-40bf-8fa4-9df13ae88f6e"}
[2026-04-14 10:07:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"28e708ed-74ee-4417-a8da-c1a9ae0cd745","trace_id":"bd848201-9700-40bf-8fa4-9df13ae88f6e"}
[2026-04-14 10:07:12] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"95326c5a-7b17-475d-9245-634d15d51bfe","trace_id":"31b36f9d-93cc-4917-bc7b-6b6a3da139e7"}
[2026-04-14 10:07:12] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"95326c5a-7b17-475d-9245-634d15d51bfe","trace_id":"31b36f9d-93cc-4917-bc7b-6b6a3da139e7"}
[2026-04-14 10:07:12] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"95326c5a-7b17-475d-9245-634d15d51bfe","trace_id":"31b36f9d-93cc-4917-bc7b-6b6a3da139e7"}
[2026-04-14 10:07:12] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"95326c5a-7b17-475d-9245-634d15d51bfe","trace_id":"31b36f9d-93cc-4917-bc7b-6b6a3da139e7"}
[2026-04-14 10:07:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:create","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"f4f68165-0bcc-4e79-89e5-81f9c627e4dc","trace_id":"5766aab2-0316-400f-aa89-168ea0579941"}
[2026-04-14 10:07:14] local.INFO: [EmailSchedule] STARTING batch create {"host":"docker_lamp_1"} {"correlation_id":"f4f68165-0bcc-4e79-89e5-81f9c627e4dc","trace_id":"5766aab2-0316-400f-aa89-168ea0579941"}
[2026-04-14 10:07:14] local.INFO: [EmailSchedule] FINISHED batch create {"host":"docker_lamp_1"} {"correlation_id":"f4f68165-0bcc-4e79-89e5-81f9c627e4dc","trace_id":"5766aab2-0316-400f-aa89-168ea0579941"}
[2026-04-14 10:07:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:create","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"f4f68165-0bcc-4e79-89e5-81f9c627e4dc","trace_id":"5766aab2-0316-400f-aa89-168ea0579941"}
[2026-04-14 10:07:15] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:sync","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"a7d5580f-8b90-4ff6-91e8-de94514f8ca1","trace_id":"fc40909d-86c1-4e45-bd51-96e2bd8c4556"}
[2026-04-14 10:07:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:sync","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"a7d5580f-8b90-4ff6-91e8-de94514f8ca1","trace_id":"fc40909d-86c1-4e45-bd51-96e2bd8c4556"}
[2026-04-14 10:07:16] local.INFO: [Jiminny\Jobs\Mailbox\CreateBatches] processed 0 inboxes and created 0 batches {"userId":null,"batchSize":30,"maxBatches":1000} {"correlation_id":"df4d1442-bcd6-4b63-8513-802ae90993e6","trace_id":"5766aab2-0316-400f-aa89-168ea0579941"}
[2026-04-14 10:08:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"43299ccb-af86-42b1-b793-4ede57e2b91d","trace_id":"2f919b69-9d68-488c-89fa-2aade6ef8519"}
[2026-04-14 10:08:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"43299ccb-af86-42b1-b793-4ede57e2b91d","trace_id":"2f919b69-9d68-488c-89fa-2aade6ef8519"}
[2026-04-14 10:08:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"43299ccb-af86-42b1-b793-4ede57e2b91d","trace_id":"2f919b69-9d68-488c-89fa-2aade6ef8519"}
[2026-04-14 10:08:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"cde80757-333e-4268-a902-892c031b2373","trace_id":"36e932e0-8362-432f-9e36-d819f902d49e"}
[2026-04-14 10:08:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"cde80757-333e-4268-a902-892c031b2373","trace_id":"36e932e0-8362-432f-9e36-d819f902d49e"}
[2026-04-14 10:08:07] local.NOTICE: Monitoring start {"correlation_id":"146390f8-e91a-4e5c-b282-0c83b4947101","trace_id":"fb689e40-c867-4fc5-9847-c223835da80e"}
[2026-04-14 10:08:07] local.NOTICE: Monitoring end {"correlation_id":"146390f8-e91a-4e5c-b282-0c83b4947101","trace_id":"fb689e40-c867-4fc5-9847-c223835da80e"}
[2026-04-14 10:08:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"58e23da5-8f3f-4836-aac7-315ab32f74a3","trace_id":"c71267c4-b5fe-42ad-9bcd-76f6299c1538"}
[2026-04-14 10:08:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"58e23da5-8f3f-4836-aac7-315ab32f74a3","trace_id":"c71267c4-b5fe-42ad-9bcd-76f6299c1538"}
[2026-04-14 10:08:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"9158bb6f-c165-495a-9b6e-8077d8343c87","trace_id":"df378af8-cacb-41ea-b030-b8f53144fddd"}
[2026-04-14 10:08:13] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"9158bb6f-c165-495a-9b6e-8077d8343c87","trace_id":"df378af8-cacb-41ea-b030-b8f53144fddd"}
[2026-04-14 10:08:13] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"9158bb6f-c165-495a-9b6e-8077d8343c87","trace_id":"df378af8-cacb-41ea-b030-b8f53144fddd"}
[2026-04-14 10:08:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"9158bb6f-c165-495a-9b6e-8077d8343c87","trace_id":"df378af8-cacb-41ea-b030-b8f53144fddd"}
[2026-04-14 10:08:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"35774df7-e046-49ec-835f-45f9dc1ec025","trace_id":"45c5e102-6b65-4d23-9edd-684ca996316c"}
[2026-04-14 10:08:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:06:00, 2026-04-14 10:08:00] {"correlation_id":"35774df7-e046-49ec-835f-45f9dc1ec025","trace_id":"45c5e102-6b65-4d23-9edd-684ca996316c"}
[2026-04-14 10:08:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:06:00, 2026-04-14 10:08:00] {"correlation_id":"35774df7-e046-49ec-835f-45f9dc1ec025","trace_id":"45c5e102-6b65-4d23-9edd-684ca996316c"}
[2026-04-14 10:08:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"35774df7-e046-49ec-835f-45f9dc1ec025","trace_id":"45c5e102-6b65-4d23-9edd-684ca996316c"}
[2026-04-14 10:08:17] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:retry-failed","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"d4dc4b3b-8dc8-4665-aec7-139be0df2306","trace_id":"853f2210-e804-40aa-a1d8-4457c60f4993"}
[2026-04-14 10:08:17] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:retry-failed","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"d4dc4b3b-8dc8-4665-aec7-139be0df2306","trace_id":"853f2210-e804-40aa-a1d8-4457c60f4993"}
[2026-04-14 10:09:05] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"8052fb2f-5876-4e2c-8f64-c770d9fe37fe","trace_id":"63249c19-bf59-4e52-9096-156d537a9786"}
[2026-04-14 10:09:05] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"8052fb2f-5876-4e2c-8f64-c770d9fe37fe","trace_id":"63249c19-bf59-4e52-9096-156d537a9786"}
[2026-04-14 10:09:05] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"8052fb2f-5876-4e2c-8f64-c770d9fe37fe","trace_id":"63249c19-bf59-4e52-9096-156d537a9786"}
[2026-04-14 10:09:07] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"1dd274b4-f71d-486e-b6c4-aaf106304102","trace_id":"1d55139c-a58d-4456-801a-9bcb3bf9b024"}
[2026-04-14 10:09:07] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"1dd274b4-f71d-486e-b6c4-aaf106304102","trace_id":"1d55139c-a58d-4456-801a-9bcb3bf9b024"}
[2026-04-14 10:09:10] local.NOTICE: Monitoring start {"correlation_id":"09dc762e-2b78-4dbb-a880-5c8f1cbfc4ad","trace_id":"8e60392d-4ea4-41f2-be2f-a01853c7a1ab"}
[2026-04-14 10:09:10] local.NOTICE: Monitoring end {"correlation_id":"09dc762e-2b78-4dbb-a880-5c8f1cbfc4ad","trace_id":"8e60392d-4ea4-41f2-be2f-a01853c7a1ab"}
[2026-04-14 10:09:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"2de9f84e-2691-459d-adfd-f5f6746501d0","trace_id":"418ad958-86c0-4477-b0fb-e487768d6fa1"}
[2026-04-14 10:09:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"2de9f84e-2691-459d-adfd-f5f6746501d0","trace_id":"418ad958-86c0-4477-b0fb-e487768d6fa1"}
[2026-04-14 10:09:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"1be8488c-ae59-4f42-8475-c426905c3ca6","trace_id":"aeb8b412-635e-4929-915f-fb3fe5786eae"}
[2026-04-14 10:09:16] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"1be8488c-ae59-4f42-8475-c426905c3ca6","trace_id":"aeb8b412-635e-4929-915f-fb3fe5786eae"}
[2026-04-14 10:09:16] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"1be8488c-ae59-4f42-8475-c426905c3ca6","trace_id":"aeb8b412-635e-4929-915f-fb3fe5786eae"}
[2026-04-14 10:09:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"1be8488c-ae59-4f42-8475-c426905c3ca6","trace_id":"aeb8b412-635e-4929-915f-fb3fe5786eae"}
[2026-04-14 10:09:18] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:aircall:check-and-renew","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:18] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1496,"provider":"aircall"} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:18] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1496,"provider":"aircall"} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:18] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:18] local.ERROR: [Aircall] Re-activating webhooks failed {"team_id":1,"reason":"{\"message\":\"Forbidden\"}"} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:18] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:aircall:check-and-renew","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"b3d1b688-309f-4df0-9dcd-9a733c87f597","trace_id":"f36f2d5a-efd0-474a-afd8-d4ec2ff4c60c"}
[2026-04-14 10:09:21] local.INFO: [RetryFailedDownloads] Starting {"options":{"from":null,"to":null,"help":false,"silent":false,"quiet":false,"verbose":false,"version":false,"ansi":null,"no-interaction":false,"env":null}} {"correlation_id":"c7aba065-c8f1-473d-b8b5-4797245873bf","trace_id":"48f587f9-dd77-4634-9ad9-1137b029b5f5"}
[2026-04-14 10:10:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"7310aae5-3829-4d5c-bbc9-f6550a35f539","trace_id":"6099cf10-45e2-4b82-9649-649e2f8a1209"}
[2026-04-14 10:10:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"7310aae5-3829-4d5c-bbc9-f6550a35f539","trace_id":"6099cf10-45e2-4b82-9649-649e2f8a1209"}
[2026-04-14 10:10:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"7310aae5-3829-4d5c-bbc9-f6550a35f539","trace_id":"6099cf10-45e2-4b82-9649-649e2f8a1209"}
[2026-04-14 10:10:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"5119d94e-0c61-4312-a740-2b569388cc9f","trace_id":"6a412a32-3bc3-46a4-af7c-24ad560a4e41"}
[2026-04-14 10:10:06] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"5119d94e-0c61-4312-a740-2b569388cc9f","trace_id":"6a412a32-3bc3-46a4-af7c-24ad560a4e41"}
[2026-04-14 10:10:08] local.NOTICE: Monitoring start {"correlation_id":"95cdb3b7-b356-4325-be28-20663ece6aa0","trace_id":"e64a75a4-2493-4f35-ba46-ccd002e6b7b7"}
[2026-04-14 10:10:08] local.NOTICE: Monitoring end {"correlation_id":"95cdb3b7-b356-4325-be28-20663ece6aa0","trace_id":"e64a75a4-2493-4f35-ba46-ccd002e6b7b7"}
[2026-04-14 10:10:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"6460dd5f-4b94-4cd1-867e-53304d785744","trace_id":"683b103d-2dfc-4266-84a2-d5cd799b133f"}
[2026-04-14 10:10:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"6460dd5f-4b94-4cd1-867e-53304d785744","trace_id":"683b103d-2dfc-4266-84a2-d5cd799b133f"}
[2026-04-14 10:10:11] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"5a59007d-2a12-4977-8a5a-59c678aa12ee","trace_id":"bc3a2ad5-9f13-4728-adaa-529da75cf011"}
[2026-04-14 10:10:11] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"5a59007d-2a12-4977-8a5a-59c678aa12ee","trace_id":"bc3a2ad5-9f13-4728-adaa-529da75cf011"}
[2026-04-14 10:10:11] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"5a59007d-2a12-4977-8a5a-59c678aa12ee","trace_id":"bc3a2ad5-9f13-4728-adaa-529da75cf011"}
[2026-04-14 10:10:11] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"5a59007d-2a12-4977-8a5a-59c678aa12ee","trace_id":"bc3a2ad5-9f13-4728-adaa-529da75cf011"}
[2026-04-14 10:10:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"afe2ff6b-1b9e-4485-bdad-a758d873a782","trace_id":"d507becf-55d6-4fda-8831-e981f95b85c8"}
[2026-04-14 10:10:14] local.INFO: Running conference:monitor:count command for activities in (2026-04-14 10:08:00, 2026-04-14 10:10:00] {"correlation_id":"afe2ff6b-1b9e-4485-bdad-a758d873a782","trace_id":"d507becf-55d6-4fda-8831-e981f95b85c8"}
[2026-04-14 10:10:14] local.INFO: [conference:monitor:count] No activities found in (2026-04-14 10:08:00, 2026-04-14 10:10:00] {"correlation_id":"afe2ff6b-1b9e-4485-bdad-a758d873a782","trace_id":"d507becf-55d6-4fda-8831-e981f95b85c8"}
[2026-04-14 10:10:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"afe2ff6b-1b9e-4485-bdad-a758d873a782","trace_id":"d507becf-55d6-4fda-8831-e981f95b85c8"}
[2026-04-14 10:10:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:purge-stale","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"ebe2ad2b-df9a-48d7-b78f-d52b7489c6f0","trace_id":"05b44216-d5ac-44cd-b74b-3e92567b192d"}
[2026-04-14 10:10:16] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:purge-stale","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"ebe2ad2b-df9a-48d7-b78f-d52b7489c6f0","trace_id":"05b44216-d5ac-44cd-b74b-3e92567b192d"}
[2026-04-14 10:10:18] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"d76b00ee-6271-4df7-ba45-769738bbb7ae","trace_id":"92384790-9588-452d-abea-cdd25a2fe7ff"}
[2026-04-14 10:10:18] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"d76b00ee-6271-4df7-ba45-769738bbb7ae","trace_id":"92384790-9588-452d-abea-cdd25a2fe7ff"}
[2026-04-14 10:10:20] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"c8f3b5c1-bef5-4584-b9d8-0c10578fefac","trace_id":"b700f03d-b02b-495e-b505-1598c7a9ea4b"}
[2026-04-14 10:10:20] local.INFO: Running pre-meeting notification command {"correlation_id":"c8f3b5c1-bef5-4584-b9d8-0c10578fefac","trace_id":"b700f03d-b02b-495e-b505-1598c7a9ea4b"}
[2026-04-14 10:10:20] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"c8f3b5c1-bef5-4584-b9d8-0c10578fefac","trace_id":"b700f03d-b02b-495e-b505-1598c7a9ea4b"}
[2026-04-14 10:10:22] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"d7b97fbb-00b9-47c2-ae81-dda03fd8b253","trace_id":"54447306-49bf-4629-8de0-bb191c61cce2"}
[2026-04-14 10:10:22] local.INFO: Running conference:monitor:start command for activities in (2026-04-14 10:00:00, 2026-04-14 10:05:00] {"correlation_id":"d7b97fbb-00b9-47c2-ae81-dda03fd8b253","trace_id":"54447306-49bf-4629-8de0-bb191c61cce2"}
[2026-04-14 10:10:22] local.INFO: [conference:monitor:start] No activities found in (2026-04-14 10:00:00, 2026-04-14 10:05:00] {"correlation_id":"d7b97fbb-00b9-47c2-ae81-dda03fd8b253","trace_id":"54447306-49bf-4629-8de0-bb191c61cce2"}
[2026-04-14 10:10:22] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"d7b97fbb-00b9-47c2-ae81-dda03fd8b253","trace_id":"54447306-49bf-4629-8de0-bb191c61cce2"}
[2026-04-14 10:10:23] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.746} {"correlation_id":"07665538-664f-421e-af9b-97152a688b68","trace_id":"d116813e-2d96-4a3d-ae04-6e53d69ca565"}
[2026-04-14 10:10:23] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:05","to":"10:10"} {"correlation_id":"07665538-664f-421e-af9b-97152a688b68","trace_id":"d116813e-2d96-4a3d-ae04-6e53d69ca565"}
[2026-04-14 10:10:23] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"00:00","to":"00:05"} {"correlation_id":"07665538-664f-421e-af9b-97152a688b68","trace_id":"d116813e-2d96-4a3d-ae04-6e53d69ca565"}
[2026-04-14 10:10:23] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.746,"memoryPeakAfterCommandInMB":99.746} {"correlation_id":"07665538-664f-421e-af9b-97152a688b68","trace_id":"d116813e-2d96-4a3d-ae04-6e53d69ca565"}
[2026-04-14 10:10:25] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"d269668d-cb18-4aeb-9a05-13a9e53195ed","trace_id":"ecbe2fde-809f-4720-8113-609eda111b53"}
[2026-04-14 10:10:25] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"d269668d-cb18-4aeb-9a05-13a9e53195ed","trace_id":"ecbe2fde-809f-4720-8113-609eda111b53"}
[2026-04-14 10:10:25] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d269668d-cb18-4aeb-9a05-13a9e53195ed","trace_id":"ecbe2fde-809f-4720-8113-609eda111b53"}
[2026-04-14 10:10:25] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f1...
|
NULL
|
|
13027
|
283
|
21
|
2026-04-14T11:58:03.024468+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-14/1776 /Users/lukas/.screenpipe/data/data/2026-04-14/1776167883024_m2.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsSendCommand.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8535156,"top":0.84791666,"width":0.1296875,"height":0.023611112},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3506466909119668715
|
-7051479631809503094
|
click
|
hybrid
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
PhpStormFileEditFV faVsco.s vProject vProphetAiv D Reports© AutomatedReportsCi© AutomatedReportsRe© AutomatedReportsS:© CreateMockAskJimir© DeleteReportComma© GenerateMarketingR© Team.php© Usage.phpIsack_leamsD TracksO TranscriptionO TwilioD UsersVocabularyDZoom© CoachingFeedbacksUpr© Command.phpcreateDatabaseusers.pc Daraoase oecountoi© DeleteOldAiCrmNotesC:© DeleteS3LeftoversComiViewNavigateCodeLaravelRefactorToolsWindowHelp#11894 on JY-18909-automated-reports-ask-jiminny© ReportController.php© SendReportJob.phpAutomatedReportsCommand.phpAutomatedReportsSendCommand.php >© AddLayoutEntities.php©Team.phpAutomatedReportsRepository.php© AutomatedReportsService.php© CreateHeldActivityEvent.php© TrackProviderInstalledEvent.phpCrealenctivityLoggeaevent.one© UserPilotActivityListener.php© ActivityLogged.phpC RequestGenerateAskJiminnyReportJob.phpRequestGeneratekeportJob.ong© AutomatedReportResult.php© AutomatedReport.phpclass AutomatedReportsSendCommand extends Commandx rxecure me consore couliiane* Qreturn intpublic function handle(): int$resultId = $this->option( key: 'result-id');if ($resultid l== null) {return $this->handleForceSend((int) $resultId);$reportResults = $this->reportRepository->getGeneratedNotSentResults();foreach ($reportResults as $reportResult) {/** @var AutomatedReportResult $reportResult */Local changesShelfLogConsole xLog XChanges 8 files, updating...= .env.local app© Activity Controller.php app/Http/Controllers/API© JiminnyDebugCommand.php app/Console/Commandsphp logging.php config(C) PlavbackService.php app/Services© ReportController.php app/Http/Controllers/Webhook® SyncTolntercom.php app/Jobs/Teamphp web.php routes› Unversioned Files 8 filesSide-by-side viewer+Do not ignoreHighlight words$b72153b7app/console/commanas/keports/Automateakeportssenacommana.png* The name and signature of the console command.X15 8* Qvar stringprotected $signature = 'automated-reports:send'* The console command description.* Qreturn intpublic function handle(): int$reportResults = Sthis->reportRepository->getGeneratedNotSentResults();foreach ($reportResults as $reportResult) {/** @var AutomatedReportResult $reportResult */$this->dispatcher->dispatch(new SendReportJob($reportResult->getUuid)));recurn commandAczas..suecess;= custom.logconsole PRODE laravel.logA console (EU]A SF [jiminny@localhost]A console [STAGING] >A HS_local [iminny@localhost]557558SO1562563564565566567568 V569570571Ix. AUTO VFlaycroundvSELECI r.* FRUn aucomaced_reporus njoin teams t on r.teamid = t.idWHERE r. Erequency = 'daily'and r.status = 1AND t.status = 'activelAND (r.exRicesuat >= now() OR r.exeicesnat IS NULL);Sa jiminny v017 A15 X 13 Aselect * from automated_report_results where repontaig IN (18, 33);select * from activity_searches where id = 10932;select * from activity_search_filters where activity_search_id = 10932;select * from automated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_report_results where repontaid IN (36);> 0Support Daily • in 2mAL AutomatedReportsCommandTest~100% [2Tue 14 Apr 14:58:02CascadeModify AutomatedRepparameters [EMAIL] as well and lets addIN sult t c as slets and i fo then then do nos foh eA houatsendpeport but calldire.p Senar eportiod irvsaidivecioeintsExplored 3 files and searched 3 queriesNow I have everything I need. I'll add an optional —-result-id argument to the command that bypasses shouldsendReport and dispatches directly if valid recipients existAutoma+38 -1Done. Here's what was added:--result-1d ootion on the signature — ovpasses the normal scheduled-time Tlow enurely.hand leForcesendd does.1. Finds AutomatedReportResult by ID - returns FAILURE with a log it not tound2. Resolves valid recipients - returns FAILURE with a log if noneDispatches SendReportJo directv no shouldSendRenort checkusage instae tne docker contalner.O bashphp artisan automated-reports:send --result-id=<id>Ask anything (&4L)+ ‹> CodeClaude Sonnet 4.6w3 differentesrequest (a minute ago)current versior* The name and signature of the console command.* @var stringprocecued ssignature = 'automated-reports:sendK--result-id= : Force send a specific AutomatedReportResult by ID, bypassing the scheduled time checkf';/*** The console command description.* @return intpublic function handle(): int$resultId = $this->option('result-id');if ($resultId !== null) {return $this->handLeForceSend((int) $resultId);$reportResults = $this->reportRepository->getGeneratedNotSentResuforeach ($reportResults as SreportResult) {/** @var AutomatedReportResult $reportResult */Pushed 1 commit toorigin/JY-18909-automated-reports-ask-jiminnyView pull reques• 1 file committedSthis->dispatcher->dispatchlnew_SendReportJobSreportResuJy-ovus moe i sene auromaree redotcommand to support immediate send for specific.Foit Commit Messace.winasun leams51:6uir-o( 4 spaces...
|
13026
|
|
13099
|
285
|
16
|
2026-04-14T12:04:37.543853+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-14/1776 /Users/lukas/.screenpipe/data/data/2026-04-14/1776168277543_m2.jpg...
|
PhpStorm
|
faVsco.js – console [STAGING]
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
2 files committed
JY-18909 modify send automated report command to support immediate send for specific result
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsCommandTest
Run 'AutomatedReportsCommandTest'
Debug 'AutomatedReportsCommandTest'
More Actions
JetBrains AI
Search Everywhere...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8535156,"top":0.84791666,"width":0.1296875,"height":0.023611112},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8535156,"top":0.84791666,"width":0.12070312,"height":0.023611112},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8535156,"top":0.8763889,"width":0.04140625,"height":0.011805556},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2 files committed","depth":2,"bounds":{"left":0.8535156,"top":0.9125,"width":0.11796875,"height":0.011805556},"role_description":"text"},{"role":"AXTextField","text":"JY-18909 modify send automated report command to support immediate send for specific result","depth":3,"bounds":{"left":0.8535156,"top":0.92638886,"width":0.1296875,"height":0.023611112},"value":"JY-18909 modify send automated report command to support immediate send for specific result","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8535156,"top":0.92638886,"width":0.119140625,"height":0.035416666},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"bounds":{"left":0.8535156,"top":0.9548611,"width":0.056640625,"height":0.011805556},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.03046875,"top":0.017361112,"width":0.0453125,"height":0.022222223},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.07578125,"top":0.017361112,"width":0.14257812,"height":0.022222223},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.78515625,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsCommandTest","depth":6,"bounds":{"left":0.803125,"top":0.017361112,"width":0.09765625,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsCommandTest'","depth":6,"bounds":{"left":0.9007813,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsCommandTest'","depth":6,"bounds":{"left":0.9140625,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9273437,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96015626,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9734375,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6239578680213861845
|
-7719075409652152106
|
visual_change
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
2 files committed
JY-18909 modify send automated report command to support immediate send for specific result
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsCommandTest
Run 'AutomatedReportsCommandTest'
Debug 'AutomatedReportsCommandTest'
More Actions
JetBrains AI
Search Everywhere...
|
13098
|
|
13032
|
283
|
24
|
2026-04-14T11:58:11.031939+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-14/1776 /Users/lukas/.screenpipe/data/data/2026-04-14/1776167891031_m2.jpg...
|
PhpStorm
|
faVsco.js – AutomatedReportsCommand.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 modify send automated report command to support immediate send for specific result
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsCommandTest
Run 'AutomatedReportsCommandTest'
Debug 'AutomatedReportsCommandTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","depth":3,"bounds":{"left":0.8535156,"top":0.84791666,"width":0.1296875,"height":0.023611112},"value":"Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8535156,"top":0.84791666,"width":0.12070312,"height":0.023611112},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"View pull request","depth":2,"bounds":{"left":0.8535156,"top":0.8763889,"width":0.04140625,"height":0.011805556},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1 file committed","depth":2,"bounds":{"left":0.8535156,"top":0.9125,"width":0.11796875,"height":0.011805556},"role_description":"text"},{"role":"AXTextField","text":"JY-18909 modify send automated report command to support immediate send for specific result","depth":3,"bounds":{"left":0.8535156,"top":0.92638886,"width":0.1296875,"height":0.023611112},"value":"JY-18909 modify send automated report command to support immediate send for specific result","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8535156,"top":0.92638886,"width":0.119140625,"height":0.035416666},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Edit Commit Message…","depth":2,"bounds":{"left":0.8535156,"top":0.9548611,"width":0.056640625,"height":0.011805556},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.03046875,"top":0.017361112,"width":0.0453125,"height":0.022222223},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.07578125,"top":0.017361112,"width":0.14257812,"height":0.022222223},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.78515625,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsCommandTest","depth":6,"bounds":{"left":0.803125,"top":0.017361112,"width":0.09765625,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsCommandTest'","depth":6,"bounds":{"left":0.9007813,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsCommandTest'","depth":6,"bounds":{"left":0.9140625,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9273437,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96015626,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9734375,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9867188,"top":0.017361112,"width":0.013281226,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.65703124,"top":0.19375,"width":0.01015625,"height":0.016666668},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.67929685,"top":0.19375,"width":0.033203125,"height":0.016666668},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-8835749900037175299
|
-7715703503842508522
|
click
|
accessibility
|
NULL
|
Pushed 1 commit to origin/JY-18909-automated-repor Pushed 1 commit to origin/JY-18909-automated-reports-ask-jiminny
text/html
text/html
text/html
View pull request
1 file committed
JY-18909 modify send automated report command to support immediate send for specific result
text/html
text/html
text/html
Edit Commit Message…
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsCommandTest
Run 'AutomatedReportsCommandTest'
Debug 'AutomatedReportsCommandTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes...
|
NULL
|
|
65952
|
1474
|
19
|
2026-04-21T13:18:08.624574+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776777488624_m2.jpg...
|
PhpStorm
|
Process 'AutomatedReportsRepositoryTest' I Process 'AutomatedReportsRepositoryTest' Is Running...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Process 'AutomatedReportsRepositoryTest' I Process 'AutomatedReportsRepositoryTest' Is Running
text/html
text/html
text/html
'AutomatedReportsRepositoryTest' is not allowed to run in parallel.<br/>Would you like to stop the running one?
Do not show this dialog in the future
Cancel
Stop and Rerun...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Process 'AutomatedReportsRepositoryTest' Is Running","depth":1,"bounds":{"left":0.45844415,"top":0.28092578,"width":0.09740692,"height":0.04309657},"value":"Process 'AutomatedReportsRepositoryTest' Is Running","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"bounds":{"left":0.45844415,"top":0.28092578,"width":0.08543883,"height":0.04309657},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"'AutomatedReportsRepositoryTest' is not allowed to run in parallel.<br/>Would you like to stop the running one?","depth":1,"bounds":{"left":0.45844415,"top":0.33040702,"width":0.09740692,"height":0.040702313},"help_text":"text/html","role_description":"text"},{"role":"AXCheckBox","text":"Do not show this dialog in the future","depth":1,"bounds":{"left":0.45711437,"top":0.38068634,"width":0.0987367,"height":0.019952115},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel","depth":1,"bounds":{"left":0.47772607,"top":0.41580206,"width":0.028590426,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Stop and Rerun","depth":1,"bounds":{"left":0.5103058,"top":0.41580206,"width":0.045545213,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1275966743726817172
|
-6381523224376633747
|
click
|
accessibility
|
NULL
|
Process 'AutomatedReportsRepositoryTest' I Process 'AutomatedReportsRepositoryTest' Is Running
text/html
text/html
text/html
'AutomatedReportsRepositoryTest' is not allowed to run in parallel.<br/>Would you like to stop the running one?
Do not show this dialog in the future
Cancel
Stop and Rerun...
|
NULL
|
|
76211
|
1907
|
26
|
2026-04-24T07:36:39.394013+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-24/1777 /Users/lukas/.screenpipe/data/data/2026-04-24/1777016199394_m1.jpg...
|
PhpStorm
|
faVsco.js – TrackAutomatedReportGeneratedEventTest faVsco.js – TrackAutomatedReportGeneratedEventTest.php...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Patch successfully applied
text/html
text/html
tex Patch successfully applied
text/html
text/html
text/html
Project: faVsco.js, menu
#12011 on JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
TrackAutomatedReportGeneratedEventTest
Run 'TrackAutomatedReportGeneratedEventTest'
Debug 'TrackAutomatedReportGeneratedEventTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Code changed:
Hide
Sync Changes
Hide This Notification...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Patch successfully applied","depth":3,"value":"Patch successfully applied","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12011 on JY-20157-AJ-report-not-send-notification, menu","depth":5,"help_text":"Pull request #12011 exists for current branch JY-20157-AJ-report-not-send-notification","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TrackAutomatedReportGeneratedEventTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TrackAutomatedReportGeneratedEventTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TrackAutomatedReportGeneratedEventTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"9","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6595782366022348956
|
8404748264372669338
|
click
|
accessibility
|
NULL
|
Patch successfully applied
text/html
text/html
tex Patch successfully applied
text/html
text/html
text/html
Project: faVsco.js, menu
#12011 on JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
TrackAutomatedReportGeneratedEventTest
Run 'TrackAutomatedReportGeneratedEventTest'
Debug 'TrackAutomatedReportGeneratedEventTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Code changed:
Hide
Sync Changes
Hide This Notification...
|
NULL
|
|
76213
|
1907
|
27
|
2026-04-24T07:36:41.170360+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-24/1777 /Users/lukas/.screenpipe/data/data/2026-04-24/1777016201170_m1.jpg...
|
PhpStorm
|
faVsco.js – TrackAutomatedReportGeneratedEventTest faVsco.js – TrackAutomatedReportGeneratedEventTest.php...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Patch successfully applied
text/html
text/html
tex Patch successfully applied
text/html
text/html
text/html
Project: faVsco.js, menu
#12011 on JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
TrackAutomatedReportGeneratedEventTest
Run 'TrackAutomatedReportGeneratedEventTest'
Debug 'TrackAutomatedReportGeneratedEventTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Code changed:
Hide
Sync Changes
Hide This Notification
43
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\Contracts\UserContract;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use Illuminate\Support\Facades\Log;
class TrackAutomatedReportGeneratedEvent implements ShouldQueue
{
use InteractsWithQueue;
private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';
private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';
public string $queue = Constants::QUEUE_DELAYABLE;
public function __construct(
private readonly UserPilotClient $userPilotClient,
private readonly AutomatedReportsService $automatedReportsService,
) {
}
public function handle(AutomatedReportGenerated $event): void
{
if (config('services.userpilot.token') === null) {
return;
}
$automatedReport = $event->automatedReport;
$payload = $this->buildPayload($automatedReport);
$eventName = $this->resolveEventName($automatedReport);
$users = $this->resolveUsers($automatedReport);
if (empty($users)) {
Log::warning('[UserPilot] No recipients found for automated report', [
'report_id' => $automatedReport->getId(),
'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),
]);
return;
}
Log::info('[UserPilot] Sending automated report event', [
'report_id' => $automatedReport->getId(),
'event_name' => $eventName,
'recipient_count' => count($users),
]);
try {
foreach ($users as $user) {
$this->userPilotClient->track($user, $eventName, $payload);
}
} catch (GuzzleException $e) {
Log::error('[UserPilot] Failed to send automated report event', [
'report_id' => $automatedReport->getId(),
'error' => $e->getMessage(),
]);
$this->release(3600);
}
}
/**
* @return array<UserContract>
*/
private function resolveUsers(AutomatedReport $automatedReport): array
{
if ($automatedReport->isAskJiminnyReport()) {
$creator = $automatedReport->getCreator();
return $creator !== null ? [$creator] : [];
}
return $this->automatedReportsService->getRecipientUserObjects($automatedReport);
}
private function buildPayload(AutomatedReport $automatedReport): array
{
return [
'report_type' => $automatedReport->getType(),
'frequency' => $automatedReport->getFrequency(),
];
}
private function resolveEventName(AutomatedReport $automatedReport): string
{
if ($automatedReport->isAskJiminnyReport()) {
return self::EVENT_NAME_ASK_JIMINNY_REPORT;
}
return self::EVENT_NAME_AUTOMATED_REPORT;
}
}
+++
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(123);
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(456);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(789);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(101);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$report->method('getId')->willReturn(202);
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$report->expects($this->once())->method('getId')->willReturn(303);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Patch successfully applied","depth":3,"value":"Patch successfully applied","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12011 on JY-20157-AJ-report-not-send-notification, menu","depth":5,"help_text":"Pull request #12011 exists for current branch JY-20157-AJ-report-not-send-notification","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TrackAutomatedReportGeneratedEventTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TrackAutomatedReportGeneratedEventTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TrackAutomatedReportGeneratedEventTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"9","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"43","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\Contracts\\UserContract;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse Illuminate\\Support\\Facades\\Log;\n\nclass TrackAutomatedReportGeneratedEvent implements ShouldQueue\n{\n use InteractsWithQueue;\n\n private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';\n private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';\n\n public string $queue = Constants::QUEUE_DELAYABLE;\n\n public function __construct(\n private readonly UserPilotClient $userPilotClient,\n private readonly AutomatedReportsService $automatedReportsService,\n ) {\n }\n\n public function handle(AutomatedReportGenerated $event): void\n {\n if (config('services.userpilot.token') === null) {\n return;\n }\n\n $automatedReport = $event->automatedReport;\n $payload = $this->buildPayload($automatedReport);\n\n $eventName = $this->resolveEventName($automatedReport);\n\n $users = $this->resolveUsers($automatedReport);\n\n if (empty($users)) {\n Log::warning('[UserPilot] No recipients found for automated report', [\n 'report_id' => $automatedReport->getId(),\n 'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),\n ]);\n\n return;\n }\n\n Log::info('[UserPilot] Sending automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'event_name' => $eventName,\n 'recipient_count' => count($users),\n ]);\n\n try {\n foreach ($users as $user) {\n $this->userPilotClient->track($user, $eventName, $payload);\n }\n } catch (GuzzleException $e) {\n Log::error('[UserPilot] Failed to send automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'error' => $e->getMessage(),\n ]);\n $this->release(3600);\n }\n }\n\n /**\n * @return array<UserContract>\n */\n private function resolveUsers(AutomatedReport $automatedReport): array\n {\n if ($automatedReport->isAskJiminnyReport()) {\n $creator = $automatedReport->getCreator();\n\n return $creator !== null ? [$creator] : [];\n }\n\n return $this->automatedReportsService->getRecipientUserObjects($automatedReport);\n }\n\n private function buildPayload(AutomatedReport $automatedReport): array\n {\n return [\n 'report_type' => $automatedReport->getType(),\n 'frequency' => $automatedReport->getFrequency(),\n ];\n }\n\n private function resolveEventName(AutomatedReport $automatedReport): string\n {\n if ($automatedReport->isAskJiminnyReport()) {\n return self::EVENT_NAME_ASK_JIMINNY_REPORT;\n }\n\n return self::EVENT_NAME_AUTOMATED_REPORT;\n }\n}\n\n+++\n\n<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(123);\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(456);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(789);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(101);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n $report->method('getId')->willReturn(202);\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n $report->expects($this->once())->method('getId')->willReturn(303);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\Contracts\\UserContract;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse Illuminate\\Support\\Facades\\Log;\n\nclass TrackAutomatedReportGeneratedEvent implements ShouldQueue\n{\n use InteractsWithQueue;\n\n private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';\n private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';\n\n public string $queue = Constants::QUEUE_DELAYABLE;\n\n public function __construct(\n private readonly UserPilotClient $userPilotClient,\n private readonly AutomatedReportsService $automatedReportsService,\n ) {\n }\n\n public function handle(AutomatedReportGenerated $event): void\n {\n if (config('services.userpilot.token') === null) {\n return;\n }\n\n $automatedReport = $event->automatedReport;\n $payload = $this->buildPayload($automatedReport);\n\n $eventName = $this->resolveEventName($automatedReport);\n\n $users = $this->resolveUsers($automatedReport);\n\n if (empty($users)) {\n Log::warning('[UserPilot] No recipients found for automated report', [\n 'report_id' => $automatedReport->getId(),\n 'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),\n ]);\n\n return;\n }\n\n Log::info('[UserPilot] Sending automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'event_name' => $eventName,\n 'recipient_count' => count($users),\n ]);\n\n try {\n foreach ($users as $user) {\n $this->userPilotClient->track($user, $eventName, $payload);\n }\n } catch (GuzzleException $e) {\n Log::error('[UserPilot] Failed to send automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'error' => $e->getMessage(),\n ]);\n $this->release(3600);\n }\n }\n\n /**\n * @return array<UserContract>\n */\n private function resolveUsers(AutomatedReport $automatedReport): array\n {\n if ($automatedReport->isAskJiminnyReport()) {\n $creator = $automatedReport->getCreator();\n\n return $creator !== null ? [$creator] : [];\n }\n\n return $this->automatedReportsService->getRecipientUserObjects($automatedReport);\n }\n\n private function buildPayload(AutomatedReport $automatedReport): array\n {\n return [\n 'report_type' => $automatedReport->getType(),\n 'frequency' => $automatedReport->getFrequency(),\n ];\n }\n\n private function resolveEventName(AutomatedReport $automatedReport): string\n {\n if ($automatedReport->isAskJiminnyReport()) {\n return self::EVENT_NAME_ASK_JIMINNY_REPORT;\n }\n\n return self::EVENT_NAME_AUTOMATED_REPORT;\n }\n}\n\n+++\n\n<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(123);\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(456);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(789);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(101);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n $report->method('getId')->willReturn(202);\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n $report->expects($this->once())->method('getId')->willReturn(303);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-2008227989749799702
|
8404466858115443482
|
click
|
accessibility
|
NULL
|
Patch successfully applied
text/html
text/html
tex Patch successfully applied
text/html
text/html
text/html
Project: faVsco.js, menu
#12011 on JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
TrackAutomatedReportGeneratedEventTest
Run 'TrackAutomatedReportGeneratedEventTest'
Debug 'TrackAutomatedReportGeneratedEventTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Code changed:
Hide
Sync Changes
Hide This Notification
43
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\Contracts\UserContract;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use Illuminate\Support\Facades\Log;
class TrackAutomatedReportGeneratedEvent implements ShouldQueue
{
use InteractsWithQueue;
private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';
private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';
public string $queue = Constants::QUEUE_DELAYABLE;
public function __construct(
private readonly UserPilotClient $userPilotClient,
private readonly AutomatedReportsService $automatedReportsService,
) {
}
public function handle(AutomatedReportGenerated $event): void
{
if (config('services.userpilot.token') === null) {
return;
}
$automatedReport = $event->automatedReport;
$payload = $this->buildPayload($automatedReport);
$eventName = $this->resolveEventName($automatedReport);
$users = $this->resolveUsers($automatedReport);
if (empty($users)) {
Log::warning('[UserPilot] No recipients found for automated report', [
'report_id' => $automatedReport->getId(),
'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),
]);
return;
}
Log::info('[UserPilot] Sending automated report event', [
'report_id' => $automatedReport->getId(),
'event_name' => $eventName,
'recipient_count' => count($users),
]);
try {
foreach ($users as $user) {
$this->userPilotClient->track($user, $eventName, $payload);
}
} catch (GuzzleException $e) {
Log::error('[UserPilot] Failed to send automated report event', [
'report_id' => $automatedReport->getId(),
'error' => $e->getMessage(),
]);
$this->release(3600);
}
}
/**
* @return array<UserContract>
*/
private function resolveUsers(AutomatedReport $automatedReport): array
{
if ($automatedReport->isAskJiminnyReport()) {
$creator = $automatedReport->getCreator();
return $creator !== null ? [$creator] : [];
}
return $this->automatedReportsService->getRecipientUserObjects($automatedReport);
}
private function buildPayload(AutomatedReport $automatedReport): array
{
return [
'report_type' => $automatedReport->getType(),
'frequency' => $automatedReport->getFrequency(),
];
}
private function resolveEventName(AutomatedReport $automatedReport): string
{
if ($automatedReport->isAskJiminnyReport()) {
return self::EVENT_NAME_ASK_JIMINNY_REPORT;
}
return self::EVENT_NAME_AUTOMATED_REPORT;
}
}
+++
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(123);
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(456);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(789);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(101);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$report->method('getId')->willReturn(202);
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$report->expects($this->once())->method('getId')->willReturn(303);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
76211
|
|
70371
|
1647
|
7
|
2026-04-22T10:16:21.938319+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-22/1776 /Users/lukas/.screenpipe/data/data/2026-04-22/1776852981938_m2.jpg...
|
PhpStorm
|
faVsco.js – CrmEntityRepository.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Patch successfully applied
text/html
text/html
tex Patch successfully applied
text/html
text/html
text/html
Project: faVsco.js, menu
JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Show Replace Field
Search History
map
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
3/5
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Code changed:
Hide
Sync Changes
Hide This Notification
6
31
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Repositories\Crm;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Jiminny\Models\Account;
use Jiminny\Models\Contact;
use Jiminny\Models\Crm\BusinessProcess;
use Jiminny\Models\Crm\Configuration;
use Jiminny\Models\Crm\Profile;
use Jiminny\Models\Crm\RecordType;
use Jiminny\Models\Lead;
use Jiminny\Models\Opportunity;
use Jiminny\Models\Stage;
class CrmEntityRepository
{
public function getExternalContactMap(Configuration $configuration): array
{
$configurationId = $configuration->getId();
$contacts = [];
$m1 = memory_get_usage();
Log::info(
'ExternalContactMap before',
[
'current' => $m1,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
$results = DB::select(
'select id, crm_provider_id from contacts where crm_configuration_id = :id and deleted_at is null',
['id' => $configurationId]
);
$m2 = memory_get_usage();
Log::info(
'ExternalContactMap after',
[
'used' => $m2 - $m1,
'current' => $m2,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
foreach ($results as $contact) {
$contacts[$contact->crm_provider_id] = $contact->id;
}
$m3 = memory_get_usage();
Log::info(
'ExternalContactMap final',
[
'used' => max($m2, $m3) - $m1,
'current' => $m3,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
return $contacts;
}
public function getExternalAccountMap(Configuration $configuration): array
{
$accounts = [];
$m1 = memory_get_usage();
$configurationId = $configuration->getId();
Log::info(
'ExternalAccountMap before',
[
'current' => $m1,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
// direct array result uses the least memory
$items = DB::select(
'select id, crm_provider_id from accounts where crm_configuration_id = :id and deleted_at is null',
['id' => $configurationId]
);
$m2 = memory_get_usage();
Log::info(
'ExternalAccountMap after',
[
'used' => $m2 - $m1,
'current' => $m2,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
foreach ($items as $item) {
$accounts[$item->crm_provider_id] = $item->id;
}
$m3 = memory_get_usage();
Log::info(
'ExternalAccountMap final',
[
'used' => max($m2, $m3) - $m1,
'current' => $m3,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
return $accounts;
}
// currently used only in tests, but keep in mind the memory usage could be high with mapWithKeys
public function getInternalAccountToContactMap(Configuration $configuration): array
{
$m1 = memory_get_usage();
$configurationId = $configuration->getId();
Log::info(
'InternalAccountToContactMap before',
[
'current' => $m1,
'config_id' => $configurationId,
]
);
$data = $configuration->accounts()
->whereHas('contacts')
->with('contacts')
->where('is_internal', 1)
->get()
->mapWithKeys(static function (Account $account) {
// Internal accounts must have only 1 contact
return [
$account->getCrmProviderId() => $account->contacts->first()->getCrmProviderId(),
];
})
->toArray();
$m2 = memory_get_usage();
Log::info(
'InternalAccountToContactMap after',
[
'used' => $m2 - $m1,
'current' => $m2,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
return $data;
}
public function getExternalStageMap(Configuration $configuration, ?string $type = null): array
{
return $configuration->stages()
->when($type, static fn ($query) => $query->where('type', $type))
->get()
->mapWithKeys(static function (Stage $stage) {
return [
$stage->getAttribute('name') => $stage->getAttribute('id'),
$stage->getAttribute('crm_provider_id') => $stage->getAttribute('id'),
];
})
->toArray();
}
public function getStageForName(Configuration $configuration, string $name, ?string $type = null): ?Stage
{
return $configuration->stages()
->when($type, static fn ($query) => $query->where('type', $type))
->where('name', $name)
->first();
}
public function getPipelineStageByConditions(BusinessProcess $businessProcess, array $conditions): ?Stage
{
return $businessProcess->stages()
->where($conditions)
->first();
}
public function getBusinessProcessRecordType(BusinessProcess $businessProcess): ?RecordType
{
return $businessProcess->recordTypes()->first();
}
public function getOpportunityClosedStages(Configuration $configuration): Collection
{
return $configuration->stages()
->where('type', Stage::TYPE_OPPORTUNITY)
->whereIn('probability', [0.00, 100.00])
->get();
}
public function importAccount(Configuration $configuration, array $accountData): Account
{
$account = $configuration->accounts()
->withTrashed()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $accountData['crm_provider_id'],
],
$accountData
);
if ($account->trashed()) {
Log::info('Restore deleted account', [
'id' => $account->getId(),
'crm_provider_id' => $account->getCrmProviderId(),
]);
$account->restore();
}
return $account;
}
public function importContact(Configuration $configuration, array $contactData): Contact
{
$contact = $configuration->contacts()
->withTrashed()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $contactData['crm_provider_id'],
],
$contactData
);
if ($contact->trashed()) {
Log::info('Restore deleted contact', [
'id' => $contact->getId(),
'crm_provider_id' => $contact->getCrmProviderId(),
]);
$contact->restore();
}
return $contact;
}
public function importLead(Configuration $configuration, array $leadData): Lead
{
$lead = $configuration->leads()
->withTrashed()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $leadData['crm_provider_id'],
],
$leadData
);
if ($lead->trashed()) {
Log::info('Restore deleted lead', [
'id' => $lead->getId(),
'crm_provider_id' => $lead->getCrmProviderId(),
]);
$lead->restore();
}
return $lead;
}
public function importOpportunity(
Configuration $configuration,
array $opportunityData,
bool $matchFromOtherCrm = false,
?string $matchName = null,
): Opportunity {
if ($matchFromOtherCrm) {
// Try find and match opportunity from other CRM configuration
// Update and attach it to the new CRM
// This case will work if a team is transitioning from one CRM provider to another, and we want to
// cross-reference deals.
$opportunityData['crm_configuration_id'] = $configuration->getId();
$opportunity = $configuration->getTeam()->opportunities()
->withTrashed()
->updateOrCreate(
[
'team_id' => $configuration->getTeamId(),
'user_id' => $opportunityData['user_id'],
'name' => $matchName,
],
$opportunityData
);
if ($opportunity->trashed()) {
$opportunity->restore();
}
return $opportunity;
}
$opportunity = $configuration->opportunities()
->withTrashed()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $opportunityData['crm_provider_id'],
],
$opportunityData
);
if ($opportunity->trashed()) {
Log::info('Restore deleted opportunity', [
'id' => $opportunity->getId(),
'crm_provider_id' => $opportunity->getCrmProviderId(),
]);
$opportunity->restore();
}
return $opportunity;
}
public function upsertOpportunity(array $attributes, array $data): Opportunity
{
/** @var ?Opportunity $opportunity */
$opportunity = Opportunity::withTrashed()->where($attributes)->first();
if ($opportunity === null) {
$opportunity = Opportunity::create($data);
} else {
$opportunity->update($data);
}
return $opportunity;
}
public function importStage(Configuration $configuration, string $objectType, array $stageData): Stage
{
return $configuration->stages()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $stageData['crm_provider_id'],
'type' => $objectType,
],
$stageData
);
}
public function importBusinessProcess(Configuration $configuration, array $pipelineData): BusinessProcess
{
return $configuration->businessProcesses()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $pipelineData['crm_provider_id'],
'type' => $pipelineData['object_type'],
],
$pipelineData
);
}
public function findAccountByExternalId(Configuration $configuration, string $crmProviderId): ?Account
{
return $configuration->accounts()
->where('crm_provider_id', $crmProviderId)
->first();
}
/**
* Find multiple accounts by their external CRM IDs
*
* @param Configuration $configuration
* @param array<string> $crmProviderIds
*
* @return Collection<Account>
*/
public function findAccountsByExternalIds(Configuration $configuration, array $crmProviderIds): Collection
{
if (empty($crmProviderIds)) {
return collect();
}
return $configuration->accounts()
->whereIn('crm_provider_id', $crmProviderIds)
->get();
}
/**
* Return a [crm_provider_id => id] map of existing accounts for the given configuration.
* Uses a covering index lookup (no row hydration) for hot-path callers.
*
* @param array<string> $crmProviderIds
*
* @return array<string, int>
*/
public function getExistingAccountIdsMap(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->accounts()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('id', 'crm_provider_id')
->all();
}
public function findContactByExternalId(Configuration $configuration, string $crmProviderId): ?Contact
{
return $configuration->contacts()
->where('crm_provider_id', $crmProviderId)
->first();
}
/**
* Find multiple contacts by their external CRM IDs
*
* @param Configuration $configuration
* @param array<string> $crmProviderIds
*
* @return Collection<Contact>
*/
public function findContactsByExternalIds(Configuration $configuration, array $crmProviderIds): Collection
{
if (empty($crmProviderIds)) {
return collect();
}
return $configuration->contacts()
->whereIn('crm_provider_id', $crmProviderIds)
->get();
}
/**
* Return a [crm_provider_id => id] map of existing contacts for the given configuration.
* Uses a covering index lookup (no row hydration) for hot-path callers.
*
* @param array<string> $crmProviderIds
*
* @return array<string, int>
*/
public function getExistingContactIdsMap(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->contacts()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('id', 'crm_provider_id')
->all();
}
public function findLeadByExternalId(Configuration $configuration, string $crmProviderId): ?Lead
{
return $configuration->leads()
->where('crm_provider_id', $crmProviderId)
->first();
}
public function findOpportunityByExternalId(Configuration $configuration, string $crmProviderId): ?Opportunity
{
return $configuration->opportunities()
->where('crm_provider_id', $crmProviderId)
->first();
}
/**
* Find multiple opportunities by their external CRM IDs
*
* @param Configuration $configuration
* @param array<string> $crmProviderIds
*
* @return Collection<Opportunity>
*/
public function findOpportunitiesByExternalIds(Configuration $configuration, array $crmProviderIds): Collection
{
if (empty($crmProviderIds)) {
return collect();
}
return $configuration->opportunities()
->whereIn('crm_provider_id', $crmProviderIds)
->get();
}
/**
* @param array<string> $crmProviderIds
*
* @return array<string>
*/
public function getExistingLeadCrmIds(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->leads()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('crm_provider_id')
->toArray();
}
/**
* @param array<string> $crmProviderIds
*
* @return array<string>
*/
public function getExistingAccountCrmIds(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->accounts()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('crm_provider_id')
->toArray();
}
/**
* @param array<string> $crmProviderIds
*
* @return array<string>
*/
public function getExistingContactCrmIds(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->contacts()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('crm_provider_id')
->toArray();
}
/**
* @param array<string> $crmProviderIds
*
* @return array<string>
*/
public function getExistingOpportunityCrmIds(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->opportunities()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('crm_provider_id')
->toArray();
}
public function findProfileByExternalId(Configuration $configuration, string $crmProviderId): ?Profile
{
return $configuration->profiles()
->where('crm_provider_id', $crmProviderId)
->first();
}
public function findBusinessProcessesByExternalId(
Configuration $configuration,
string $crmProviderId
): ?BusinessProcess {
return $configuration->businessProcesses()
->where('crm_provider_id', $crmProviderId)
->first();
}
/**
* @return Collection<Account>
*/
public function findAccountsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection
{
return $configuration->accounts()
->where('owner_id', $crmOwnerId)
->whereNull('user_id')
->get();
}
/**
* @return Collection<Contact>
*/
public function findContactsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection
{
return $configuration->contacts()
->where('owner_id', $crmOwnerId)
->whereNull('user_id')
->get();
}
/**
* @return Collection<Lead>
*/
public function findLeadsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection
{
return $configuration->leads()
->where('owner_id', $crmOwnerId)
->whereNull('user_id')
->get();
}
/**
* @return Collection<Opportunity>
*/
public function findOpportunitiesByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection
{
return $configuration->opportunities()
->where('owner_id', $crmOwnerId)
->whereNull('user_id')
->get();
}
public function searchLeadsByString(
Configuration $configuration,
string $query,
?int $limit = null,
?int $offset = null,
bool $orderByName = false,
bool $usePhoneSearch = false
): Collection {
$queryBuilder = $configuration->leads()
->with('stages')
->where('converted_at', null)
->whereNested(function ($qb) use ($query, $usePhoneSearch) {
$qb->where('crm_provider_id', $query);
if ($usePhoneSearch) {
$qb->orWhere('phone', 'LIKE', "%{$query}%")
->orWhere('mobile_phone', 'LIKE', "%{$query}%");
} else {
$qb->orWhere('name', 'LIKE', "%{$query}%")
->orWhere('company', 'LIKE', "%{$query}%");
}
});
if ($orderByName) {
$queryBuilder->orderBy('name');
}
if ($limit !== null) {
$queryBuilder->limit($limit);
}
if ($offset !== null) {
$queryBuilder->offset($offset);
}
return $queryBuilder->get();
}
public function searchAccountsByString(
Configuration $configuration,
string $query,
?int $limit = null,
?int $offset = null,
bool $orderByName = false,
bool $usePhoneSearch = false
): Collection {
$queryBuilder = $configuration->accounts()
->where('is_internal', 0)
->where(function ($qb) use ($query, $usePhoneSearch) {
$qb->where('crm_provider_id', $query);
if ($usePhoneSearch) {
$qb->orWhere('phone', 'LIKE', "%{$query}%");
} else {
$qb->orWhere('name', 'LIKE', "%{$query}%");
}
});
if ($orderByName) {
$queryBuilder->orderBy('name');
}
if ($limit !== null) {
$queryBuilder->limit($limit);
}
if ($offset !== null) {
$queryBuilder->offset($offset);
}
return $queryBuilder->get();
}
public function searchContactsByString(
Configuration $configuration,
string $query,
?int $limit = null,
?int $offset = null,
bool $orderByName = false,
bool $usePhoneSearch = false
): Collection {
$queryBuilder = $configuration->contacts()
->with('account')
->where(function ($qb) use ($query, $usePhoneSearch) {
$qb->where('crm_provider_id', $query);
if ($usePhoneSearch) {
$qb->orWhere('phone', 'LIKE', "%{$query}%")
->orWhere('mobile_phone', 'LIKE', "%{$query}%");
} else {
$qb->orWhere('name', 'LIKE', "%{$query}%")
->orWhere('email', 'LIKE', "%{$query}%")
->orWhere('phone', 'LIKE', "%{$query}%")
->orWhere('mobile_phone', 'LIKE', "%{$query}%");
}
});
if ($orderByName) {
$queryBuilder->orderBy('name');
}
if ($limit !== null) {
$queryBuilder->limit($limit);
}
if ($offset !== null) {
$queryBuilder->offset($offset);
}
return $queryBuilder->get();
}
/**
* Find a contact by id only if it belongs to the team
*/
public function findContactByConfigurationAndId(Configuration $configuration, int $contactId): ?Contact
{
return $configuration->contacts()
->where('id', $contactId)
->first();
}
/**
* Find a lead by id only if it belongs to the team
*/
public function findLeadByConfigurationAndId(Configuration $configuration, int $leadId): ?Lead
{
return $configuration->leads()
->where('id', $leadId)
->first();
}
/**
* Find an account by id only if it belongs to the team
*/
public function findAccountByConfigurationAndId(Configuration $configuration, int $accountId): ?Account
{
return $configuration->accounts()
->where('id', $accountId)
->first();
}
/**
* Find an opportunity by id only if it belongs to the team
*/
public function findOpportunityByConfigurationAndId(Configuration $configuration, int $opportunityId): ?Opportunity
{
return $configuration->opportunities()
->where('id', $opportunityId)
->first();
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
35
1
33
63
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id =...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Patch successfully applied","depth":3,"bounds":{"left":0.24900267,"top":0.858739,"width":0.05418883,"height":0.013567438},"value":"Patch successfully applied","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.24900267,"top":0.858739,"width":0.05418883,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.25797874,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20157-AJ-report-not-send-notification, menu","depth":5,"bounds":{"left":0.29654256,"top":0.019952115,"width":0.10139628,"height":0.025538707},"help_text":"Git Branch: JY-20157-AJ-report-not-send-notification","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Show Replace Field","depth":4,"bounds":{"left":0.35305852,"top":0.25379092,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Search History","depth":3,"bounds":{"left":0.36569148,"top":0.2529928,"width":0.00731383,"height":0.017557861},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"map","depth":4,"bounds":{"left":0.37666222,"top":0.2529928,"width":0.043882977,"height":0.015961692},"value":"map","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"New Line","depth":3,"bounds":{"left":0.42952126,"top":0.2529928,"width":0.00731383,"height":0.017557861},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Match Case","depth":3,"bounds":{"left":0.43949467,"top":0.2529928,"width":0.00731383,"height":0.017557861},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Words","depth":3,"bounds":{"left":0.4481383,"top":0.2529928,"width":0.00731383,"height":0.017557861},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Regex","depth":3,"bounds":{"left":0.45678192,"top":0.2529928,"width":0.00731383,"height":0.017557861},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Replace History","depth":3,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"Replace","depth":4,"role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"New Line","depth":3,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Preserve case","depth":3,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"3/5","depth":4,"bounds":{"left":0.47041222,"top":0.25219473,"width":0.025598405,"height":0.017557861},"role_description":"text"},{"role":"AXButton","text":"Previous Occurrence","depth":4,"bounds":{"left":0.49601063,"top":0.25139666,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Occurrence","depth":4,"bounds":{"left":0.5046542,"top":0.25139666,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Filter Search Results","depth":4,"bounds":{"left":0.51329786,"top":0.25139666,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open in Window, Multiple Cursors","depth":4,"bounds":{"left":0.5219415,"top":0.25139666,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Click to highlight","depth":4,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close","depth":4,"bounds":{"left":0.64295214,"top":0.25139666,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.6203458,"top":0.28252193,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"31","depth":4,"bounds":{"left":0.6303192,"top":0.28252193,"width":0.009640957,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.64162236,"top":0.28092578,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.64893615,"top":0.28092578,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Repositories\\Crm;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Models\\Account;\nuse Jiminny\\Models\\Contact;\nuse Jiminny\\Models\\Crm\\BusinessProcess;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Models\\Crm\\RecordType;\nuse Jiminny\\Models\\Lead;\nuse Jiminny\\Models\\Opportunity;\nuse Jiminny\\Models\\Stage;\n\nclass CrmEntityRepository\n{\n public function getExternalContactMap(Configuration $configuration): array\n {\n $configurationId = $configuration->getId();\n $contacts = [];\n $m1 = memory_get_usage();\n Log::info(\n 'ExternalContactMap before',\n [\n 'current' => $m1,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n $results = DB::select(\n 'select id, crm_provider_id from contacts where crm_configuration_id = :id and deleted_at is null',\n ['id' => $configurationId]\n );\n\n $m2 = memory_get_usage();\n Log::info(\n 'ExternalContactMap after',\n [\n 'used' => $m2 - $m1,\n 'current' => $m2,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n foreach ($results as $contact) {\n $contacts[$contact->crm_provider_id] = $contact->id;\n }\n\n $m3 = memory_get_usage();\n Log::info(\n 'ExternalContactMap final',\n [\n 'used' => max($m2, $m3) - $m1,\n 'current' => $m3,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n return $contacts;\n }\n\n public function getExternalAccountMap(Configuration $configuration): array\n {\n $accounts = [];\n $m1 = memory_get_usage();\n $configurationId = $configuration->getId();\n Log::info(\n 'ExternalAccountMap before',\n [\n 'current' => $m1,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n // direct array result uses the least memory\n $items = DB::select(\n 'select id, crm_provider_id from accounts where crm_configuration_id = :id and deleted_at is null',\n ['id' => $configurationId]\n );\n\n $m2 = memory_get_usage();\n Log::info(\n 'ExternalAccountMap after',\n [\n 'used' => $m2 - $m1,\n 'current' => $m2,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n foreach ($items as $item) {\n $accounts[$item->crm_provider_id] = $item->id;\n }\n\n $m3 = memory_get_usage();\n Log::info(\n 'ExternalAccountMap final',\n [\n 'used' => max($m2, $m3) - $m1,\n 'current' => $m3,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n return $accounts;\n }\n\n // currently used only in tests, but keep in mind the memory usage could be high with mapWithKeys\n public function getInternalAccountToContactMap(Configuration $configuration): array\n {\n $m1 = memory_get_usage();\n $configurationId = $configuration->getId();\n Log::info(\n 'InternalAccountToContactMap before',\n [\n 'current' => $m1,\n 'config_id' => $configurationId,\n ]\n );\n\n $data = $configuration->accounts()\n ->whereHas('contacts')\n ->with('contacts')\n ->where('is_internal', 1)\n ->get()\n ->mapWithKeys(static function (Account $account) {\n // Internal accounts must have only 1 contact\n return [\n $account->getCrmProviderId() => $account->contacts->first()->getCrmProviderId(),\n ];\n })\n ->toArray();\n\n $m2 = memory_get_usage();\n Log::info(\n 'InternalAccountToContactMap after',\n [\n 'used' => $m2 - $m1,\n 'current' => $m2,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n return $data;\n }\n\n public function getExternalStageMap(Configuration $configuration, ?string $type = null): array\n {\n return $configuration->stages()\n ->when($type, static fn ($query) => $query->where('type', $type))\n ->get()\n ->mapWithKeys(static function (Stage $stage) {\n return [\n $stage->getAttribute('name') => $stage->getAttribute('id'),\n $stage->getAttribute('crm_provider_id') => $stage->getAttribute('id'),\n ];\n })\n ->toArray();\n }\n\n public function getStageForName(Configuration $configuration, string $name, ?string $type = null): ?Stage\n {\n return $configuration->stages()\n ->when($type, static fn ($query) => $query->where('type', $type))\n ->where('name', $name)\n ->first();\n }\n\n public function getPipelineStageByConditions(BusinessProcess $businessProcess, array $conditions): ?Stage\n {\n return $businessProcess->stages()\n ->where($conditions)\n ->first();\n }\n\n public function getBusinessProcessRecordType(BusinessProcess $businessProcess): ?RecordType\n {\n return $businessProcess->recordTypes()->first();\n }\n\n public function getOpportunityClosedStages(Configuration $configuration): Collection\n {\n return $configuration->stages()\n ->where('type', Stage::TYPE_OPPORTUNITY)\n ->whereIn('probability', [0.00, 100.00])\n ->get();\n }\n\n public function importAccount(Configuration $configuration, array $accountData): Account\n {\n $account = $configuration->accounts()\n ->withTrashed()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $accountData['crm_provider_id'],\n ],\n $accountData\n );\n\n if ($account->trashed()) {\n Log::info('Restore deleted account', [\n 'id' => $account->getId(),\n 'crm_provider_id' => $account->getCrmProviderId(),\n ]);\n\n $account->restore();\n }\n\n return $account;\n }\n\n public function importContact(Configuration $configuration, array $contactData): Contact\n {\n $contact = $configuration->contacts()\n ->withTrashed()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $contactData['crm_provider_id'],\n ],\n $contactData\n );\n\n if ($contact->trashed()) {\n Log::info('Restore deleted contact', [\n 'id' => $contact->getId(),\n 'crm_provider_id' => $contact->getCrmProviderId(),\n ]);\n\n $contact->restore();\n }\n\n return $contact;\n }\n\n public function importLead(Configuration $configuration, array $leadData): Lead\n {\n $lead = $configuration->leads()\n ->withTrashed()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $leadData['crm_provider_id'],\n ],\n $leadData\n );\n\n if ($lead->trashed()) {\n Log::info('Restore deleted lead', [\n 'id' => $lead->getId(),\n 'crm_provider_id' => $lead->getCrmProviderId(),\n ]);\n\n $lead->restore();\n }\n\n return $lead;\n }\n\n public function importOpportunity(\n Configuration $configuration,\n array $opportunityData,\n bool $matchFromOtherCrm = false,\n ?string $matchName = null,\n ): Opportunity {\n if ($matchFromOtherCrm) {\n // Try find and match opportunity from other CRM configuration\n // Update and attach it to the new CRM\n // This case will work if a team is transitioning from one CRM provider to another, and we want to\n // cross-reference deals.\n $opportunityData['crm_configuration_id'] = $configuration->getId();\n\n $opportunity = $configuration->getTeam()->opportunities()\n ->withTrashed()\n ->updateOrCreate(\n [\n 'team_id' => $configuration->getTeamId(),\n 'user_id' => $opportunityData['user_id'],\n 'name' => $matchName,\n ],\n $opportunityData\n );\n\n if ($opportunity->trashed()) {\n $opportunity->restore();\n }\n\n return $opportunity;\n }\n\n $opportunity = $configuration->opportunities()\n ->withTrashed()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $opportunityData['crm_provider_id'],\n ],\n $opportunityData\n );\n\n if ($opportunity->trashed()) {\n Log::info('Restore deleted opportunity', [\n 'id' => $opportunity->getId(),\n 'crm_provider_id' => $opportunity->getCrmProviderId(),\n ]);\n\n $opportunity->restore();\n }\n\n return $opportunity;\n }\n\n public function upsertOpportunity(array $attributes, array $data): Opportunity\n {\n /** @var ?Opportunity $opportunity */\n $opportunity = Opportunity::withTrashed()->where($attributes)->first();\n if ($opportunity === null) {\n $opportunity = Opportunity::create($data);\n } else {\n $opportunity->update($data);\n }\n\n return $opportunity;\n }\n\n public function importStage(Configuration $configuration, string $objectType, array $stageData): Stage\n {\n return $configuration->stages()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $stageData['crm_provider_id'],\n 'type' => $objectType,\n ],\n $stageData\n );\n }\n\n public function importBusinessProcess(Configuration $configuration, array $pipelineData): BusinessProcess\n {\n return $configuration->businessProcesses()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $pipelineData['crm_provider_id'],\n 'type' => $pipelineData['object_type'],\n ],\n $pipelineData\n );\n }\n\n public function findAccountByExternalId(Configuration $configuration, string $crmProviderId): ?Account\n {\n return $configuration->accounts()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n /**\n * Find multiple accounts by their external CRM IDs\n *\n * @param Configuration $configuration\n * @param array<string> $crmProviderIds\n *\n * @return Collection<Account>\n */\n public function findAccountsByExternalIds(Configuration $configuration, array $crmProviderIds): Collection\n {\n if (empty($crmProviderIds)) {\n return collect();\n }\n\n return $configuration->accounts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->get();\n }\n\n /**\n * Return a [crm_provider_id => id] map of existing accounts for the given configuration.\n * Uses a covering index lookup (no row hydration) for hot-path callers.\n *\n * @param array<string> $crmProviderIds\n *\n * @return array<string, int>\n */\n public function getExistingAccountIdsMap(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->accounts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('id', 'crm_provider_id')\n ->all();\n }\n\n public function findContactByExternalId(Configuration $configuration, string $crmProviderId): ?Contact\n {\n return $configuration->contacts()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n /**\n * Find multiple contacts by their external CRM IDs\n *\n * @param Configuration $configuration\n * @param array<string> $crmProviderIds\n *\n * @return Collection<Contact>\n */\n public function findContactsByExternalIds(Configuration $configuration, array $crmProviderIds): Collection\n {\n if (empty($crmProviderIds)) {\n return collect();\n }\n\n return $configuration->contacts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->get();\n }\n\n /**\n * Return a [crm_provider_id => id] map of existing contacts for the given configuration.\n * Uses a covering index lookup (no row hydration) for hot-path callers.\n *\n * @param array<string> $crmProviderIds\n *\n * @return array<string, int>\n */\n public function getExistingContactIdsMap(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->contacts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('id', 'crm_provider_id')\n ->all();\n }\n\n public function findLeadByExternalId(Configuration $configuration, string $crmProviderId): ?Lead\n {\n return $configuration->leads()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n public function findOpportunityByExternalId(Configuration $configuration, string $crmProviderId): ?Opportunity\n {\n return $configuration->opportunities()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n /**\n * Find multiple opportunities by their external CRM IDs\n *\n * @param Configuration $configuration\n * @param array<string> $crmProviderIds\n *\n * @return Collection<Opportunity>\n */\n public function findOpportunitiesByExternalIds(Configuration $configuration, array $crmProviderIds): Collection\n {\n if (empty($crmProviderIds)) {\n return collect();\n }\n\n return $configuration->opportunities()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->get();\n }\n\n /**\n * @param array<string> $crmProviderIds\n *\n * @return array<string>\n */\n public function getExistingLeadCrmIds(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->leads()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('crm_provider_id')\n ->toArray();\n }\n\n /**\n * @param array<string> $crmProviderIds\n *\n * @return array<string>\n */\n public function getExistingAccountCrmIds(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->accounts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('crm_provider_id')\n ->toArray();\n }\n\n /**\n * @param array<string> $crmProviderIds\n *\n * @return array<string>\n */\n public function getExistingContactCrmIds(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->contacts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('crm_provider_id')\n ->toArray();\n }\n\n /**\n * @param array<string> $crmProviderIds\n *\n * @return array<string>\n */\n public function getExistingOpportunityCrmIds(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->opportunities()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('crm_provider_id')\n ->toArray();\n }\n\n public function findProfileByExternalId(Configuration $configuration, string $crmProviderId): ?Profile\n {\n return $configuration->profiles()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n public function findBusinessProcessesByExternalId(\n Configuration $configuration,\n string $crmProviderId\n ): ?BusinessProcess {\n return $configuration->businessProcesses()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n /**\n * @return Collection<Account>\n */\n public function findAccountsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection\n {\n return $configuration->accounts()\n ->where('owner_id', $crmOwnerId)\n ->whereNull('user_id')\n ->get();\n }\n\n /**\n * @return Collection<Contact>\n */\n public function findContactsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection\n {\n return $configuration->contacts()\n ->where('owner_id', $crmOwnerId)\n ->whereNull('user_id')\n ->get();\n }\n\n /**\n * @return Collection<Lead>\n */\n public function findLeadsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection\n {\n return $configuration->leads()\n ->where('owner_id', $crmOwnerId)\n ->whereNull('user_id')\n ->get();\n }\n\n /**\n * @return Collection<Opportunity>\n */\n public function findOpportunitiesByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection\n {\n return $configuration->opportunities()\n ->where('owner_id', $crmOwnerId)\n ->whereNull('user_id')\n ->get();\n }\n\n public function searchLeadsByString(\n Configuration $configuration,\n string $query,\n ?int $limit = null,\n ?int $offset = null,\n bool $orderByName = false,\n bool $usePhoneSearch = false\n ): Collection {\n $queryBuilder = $configuration->leads()\n ->with('stages')\n ->where('converted_at', null)\n ->whereNested(function ($qb) use ($query, $usePhoneSearch) {\n $qb->where('crm_provider_id', $query);\n\n if ($usePhoneSearch) {\n $qb->orWhere('phone', 'LIKE', \"%{$query}%\")\n ->orWhere('mobile_phone', 'LIKE', \"%{$query}%\");\n } else {\n $qb->orWhere('name', 'LIKE', \"%{$query}%\")\n ->orWhere('company', 'LIKE', \"%{$query}%\");\n }\n });\n\n if ($orderByName) {\n $queryBuilder->orderBy('name');\n }\n\n if ($limit !== null) {\n $queryBuilder->limit($limit);\n }\n\n if ($offset !== null) {\n $queryBuilder->offset($offset);\n }\n\n return $queryBuilder->get();\n }\n\n public function searchAccountsByString(\n Configuration $configuration,\n string $query,\n ?int $limit = null,\n ?int $offset = null,\n bool $orderByName = false,\n bool $usePhoneSearch = false\n ): Collection {\n $queryBuilder = $configuration->accounts()\n ->where('is_internal', 0)\n ->where(function ($qb) use ($query, $usePhoneSearch) {\n $qb->where('crm_provider_id', $query);\n\n if ($usePhoneSearch) {\n $qb->orWhere('phone', 'LIKE', \"%{$query}%\");\n } else {\n $qb->orWhere('name', 'LIKE', \"%{$query}%\");\n }\n });\n\n if ($orderByName) {\n $queryBuilder->orderBy('name');\n }\n\n if ($limit !== null) {\n $queryBuilder->limit($limit);\n }\n\n if ($offset !== null) {\n $queryBuilder->offset($offset);\n }\n\n return $queryBuilder->get();\n }\n\n public function searchContactsByString(\n Configuration $configuration,\n string $query,\n ?int $limit = null,\n ?int $offset = null,\n bool $orderByName = false,\n bool $usePhoneSearch = false\n ): Collection {\n $queryBuilder = $configuration->contacts()\n ->with('account')\n ->where(function ($qb) use ($query, $usePhoneSearch) {\n $qb->where('crm_provider_id', $query);\n\n if ($usePhoneSearch) {\n $qb->orWhere('phone', 'LIKE', \"%{$query}%\")\n ->orWhere('mobile_phone', 'LIKE', \"%{$query}%\");\n } else {\n $qb->orWhere('name', 'LIKE', \"%{$query}%\")\n ->orWhere('email', 'LIKE', \"%{$query}%\")\n ->orWhere('phone', 'LIKE', \"%{$query}%\")\n ->orWhere('mobile_phone', 'LIKE', \"%{$query}%\");\n }\n });\n\n if ($orderByName) {\n $queryBuilder->orderBy('name');\n }\n\n if ($limit !== null) {\n $queryBuilder->limit($limit);\n }\n\n if ($offset !== null) {\n $queryBuilder->offset($offset);\n }\n\n return $queryBuilder->get();\n }\n\n /**\n * Find a contact by id only if it belongs to the team\n */\n public function findContactByConfigurationAndId(Configuration $configuration, int $contactId): ?Contact\n {\n return $configuration->contacts()\n ->where('id', $contactId)\n ->first();\n }\n\n /**\n * Find a lead by id only if it belongs to the team\n */\n public function findLeadByConfigurationAndId(Configuration $configuration, int $leadId): ?Lead\n {\n return $configuration->leads()\n ->where('id', $leadId)\n ->first();\n }\n\n /**\n * Find an account by id only if it belongs to the team\n */\n public function findAccountByConfigurationAndId(Configuration $configuration, int $accountId): ?Account\n {\n return $configuration->accounts()\n ->where('id', $accountId)\n ->first();\n }\n\n /**\n * Find an opportunity by id only if it belongs to the team\n */\n public function findOpportunityByConfigurationAndId(Configuration $configuration, int $opportunityId): ?Opportunity\n {\n return $configuration->opportunities()\n ->where('id', $opportunityId)\n ->first();\n }\n}","depth":4,"bounds":{"left":0.3706782,"top":0.0,"width":0.32912233,"height":1.0},"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Repositories\\Crm;\n\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\DB;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Models\\Account;\nuse Jiminny\\Models\\Contact;\nuse Jiminny\\Models\\Crm\\BusinessProcess;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Models\\Crm\\RecordType;\nuse Jiminny\\Models\\Lead;\nuse Jiminny\\Models\\Opportunity;\nuse Jiminny\\Models\\Stage;\n\nclass CrmEntityRepository\n{\n public function getExternalContactMap(Configuration $configuration): array\n {\n $configurationId = $configuration->getId();\n $contacts = [];\n $m1 = memory_get_usage();\n Log::info(\n 'ExternalContactMap before',\n [\n 'current' => $m1,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n $results = DB::select(\n 'select id, crm_provider_id from contacts where crm_configuration_id = :id and deleted_at is null',\n ['id' => $configurationId]\n );\n\n $m2 = memory_get_usage();\n Log::info(\n 'ExternalContactMap after',\n [\n 'used' => $m2 - $m1,\n 'current' => $m2,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n foreach ($results as $contact) {\n $contacts[$contact->crm_provider_id] = $contact->id;\n }\n\n $m3 = memory_get_usage();\n Log::info(\n 'ExternalContactMap final',\n [\n 'used' => max($m2, $m3) - $m1,\n 'current' => $m3,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n return $contacts;\n }\n\n public function getExternalAccountMap(Configuration $configuration): array\n {\n $accounts = [];\n $m1 = memory_get_usage();\n $configurationId = $configuration->getId();\n Log::info(\n 'ExternalAccountMap before',\n [\n 'current' => $m1,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n // direct array result uses the least memory\n $items = DB::select(\n 'select id, crm_provider_id from accounts where crm_configuration_id = :id and deleted_at is null',\n ['id' => $configurationId]\n );\n\n $m2 = memory_get_usage();\n Log::info(\n 'ExternalAccountMap after',\n [\n 'used' => $m2 - $m1,\n 'current' => $m2,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n foreach ($items as $item) {\n $accounts[$item->crm_provider_id] = $item->id;\n }\n\n $m3 = memory_get_usage();\n Log::info(\n 'ExternalAccountMap final',\n [\n 'used' => max($m2, $m3) - $m1,\n 'current' => $m3,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n return $accounts;\n }\n\n // currently used only in tests, but keep in mind the memory usage could be high with mapWithKeys\n public function getInternalAccountToContactMap(Configuration $configuration): array\n {\n $m1 = memory_get_usage();\n $configurationId = $configuration->getId();\n Log::info(\n 'InternalAccountToContactMap before',\n [\n 'current' => $m1,\n 'config_id' => $configurationId,\n ]\n );\n\n $data = $configuration->accounts()\n ->whereHas('contacts')\n ->with('contacts')\n ->where('is_internal', 1)\n ->get()\n ->mapWithKeys(static function (Account $account) {\n // Internal accounts must have only 1 contact\n return [\n $account->getCrmProviderId() => $account->contacts->first()->getCrmProviderId(),\n ];\n })\n ->toArray();\n\n $m2 = memory_get_usage();\n Log::info(\n 'InternalAccountToContactMap after',\n [\n 'used' => $m2 - $m1,\n 'current' => $m2,\n 'peak' => memory_get_peak_usage(),\n 'config_id' => $configurationId,\n ]\n );\n\n return $data;\n }\n\n public function getExternalStageMap(Configuration $configuration, ?string $type = null): array\n {\n return $configuration->stages()\n ->when($type, static fn ($query) => $query->where('type', $type))\n ->get()\n ->mapWithKeys(static function (Stage $stage) {\n return [\n $stage->getAttribute('name') => $stage->getAttribute('id'),\n $stage->getAttribute('crm_provider_id') => $stage->getAttribute('id'),\n ];\n })\n ->toArray();\n }\n\n public function getStageForName(Configuration $configuration, string $name, ?string $type = null): ?Stage\n {\n return $configuration->stages()\n ->when($type, static fn ($query) => $query->where('type', $type))\n ->where('name', $name)\n ->first();\n }\n\n public function getPipelineStageByConditions(BusinessProcess $businessProcess, array $conditions): ?Stage\n {\n return $businessProcess->stages()\n ->where($conditions)\n ->first();\n }\n\n public function getBusinessProcessRecordType(BusinessProcess $businessProcess): ?RecordType\n {\n return $businessProcess->recordTypes()->first();\n }\n\n public function getOpportunityClosedStages(Configuration $configuration): Collection\n {\n return $configuration->stages()\n ->where('type', Stage::TYPE_OPPORTUNITY)\n ->whereIn('probability', [0.00, 100.00])\n ->get();\n }\n\n public function importAccount(Configuration $configuration, array $accountData): Account\n {\n $account = $configuration->accounts()\n ->withTrashed()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $accountData['crm_provider_id'],\n ],\n $accountData\n );\n\n if ($account->trashed()) {\n Log::info('Restore deleted account', [\n 'id' => $account->getId(),\n 'crm_provider_id' => $account->getCrmProviderId(),\n ]);\n\n $account->restore();\n }\n\n return $account;\n }\n\n public function importContact(Configuration $configuration, array $contactData): Contact\n {\n $contact = $configuration->contacts()\n ->withTrashed()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $contactData['crm_provider_id'],\n ],\n $contactData\n );\n\n if ($contact->trashed()) {\n Log::info('Restore deleted contact', [\n 'id' => $contact->getId(),\n 'crm_provider_id' => $contact->getCrmProviderId(),\n ]);\n\n $contact->restore();\n }\n\n return $contact;\n }\n\n public function importLead(Configuration $configuration, array $leadData): Lead\n {\n $lead = $configuration->leads()\n ->withTrashed()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $leadData['crm_provider_id'],\n ],\n $leadData\n );\n\n if ($lead->trashed()) {\n Log::info('Restore deleted lead', [\n 'id' => $lead->getId(),\n 'crm_provider_id' => $lead->getCrmProviderId(),\n ]);\n\n $lead->restore();\n }\n\n return $lead;\n }\n\n public function importOpportunity(\n Configuration $configuration,\n array $opportunityData,\n bool $matchFromOtherCrm = false,\n ?string $matchName = null,\n ): Opportunity {\n if ($matchFromOtherCrm) {\n // Try find and match opportunity from other CRM configuration\n // Update and attach it to the new CRM\n // This case will work if a team is transitioning from one CRM provider to another, and we want to\n // cross-reference deals.\n $opportunityData['crm_configuration_id'] = $configuration->getId();\n\n $opportunity = $configuration->getTeam()->opportunities()\n ->withTrashed()\n ->updateOrCreate(\n [\n 'team_id' => $configuration->getTeamId(),\n 'user_id' => $opportunityData['user_id'],\n 'name' => $matchName,\n ],\n $opportunityData\n );\n\n if ($opportunity->trashed()) {\n $opportunity->restore();\n }\n\n return $opportunity;\n }\n\n $opportunity = $configuration->opportunities()\n ->withTrashed()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $opportunityData['crm_provider_id'],\n ],\n $opportunityData\n );\n\n if ($opportunity->trashed()) {\n Log::info('Restore deleted opportunity', [\n 'id' => $opportunity->getId(),\n 'crm_provider_id' => $opportunity->getCrmProviderId(),\n ]);\n\n $opportunity->restore();\n }\n\n return $opportunity;\n }\n\n public function upsertOpportunity(array $attributes, array $data): Opportunity\n {\n /** @var ?Opportunity $opportunity */\n $opportunity = Opportunity::withTrashed()->where($attributes)->first();\n if ($opportunity === null) {\n $opportunity = Opportunity::create($data);\n } else {\n $opportunity->update($data);\n }\n\n return $opportunity;\n }\n\n public function importStage(Configuration $configuration, string $objectType, array $stageData): Stage\n {\n return $configuration->stages()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $stageData['crm_provider_id'],\n 'type' => $objectType,\n ],\n $stageData\n );\n }\n\n public function importBusinessProcess(Configuration $configuration, array $pipelineData): BusinessProcess\n {\n return $configuration->businessProcesses()\n ->updateOrCreate(\n [\n 'crm_configuration_id' => $configuration->getId(),\n 'team_id' => $configuration->getTeamId(),\n 'crm_provider_id' => $pipelineData['crm_provider_id'],\n 'type' => $pipelineData['object_type'],\n ],\n $pipelineData\n );\n }\n\n public function findAccountByExternalId(Configuration $configuration, string $crmProviderId): ?Account\n {\n return $configuration->accounts()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n /**\n * Find multiple accounts by their external CRM IDs\n *\n * @param Configuration $configuration\n * @param array<string> $crmProviderIds\n *\n * @return Collection<Account>\n */\n public function findAccountsByExternalIds(Configuration $configuration, array $crmProviderIds): Collection\n {\n if (empty($crmProviderIds)) {\n return collect();\n }\n\n return $configuration->accounts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->get();\n }\n\n /**\n * Return a [crm_provider_id => id] map of existing accounts for the given configuration.\n * Uses a covering index lookup (no row hydration) for hot-path callers.\n *\n * @param array<string> $crmProviderIds\n *\n * @return array<string, int>\n */\n public function getExistingAccountIdsMap(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->accounts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('id', 'crm_provider_id')\n ->all();\n }\n\n public function findContactByExternalId(Configuration $configuration, string $crmProviderId): ?Contact\n {\n return $configuration->contacts()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n /**\n * Find multiple contacts by their external CRM IDs\n *\n * @param Configuration $configuration\n * @param array<string> $crmProviderIds\n *\n * @return Collection<Contact>\n */\n public function findContactsByExternalIds(Configuration $configuration, array $crmProviderIds): Collection\n {\n if (empty($crmProviderIds)) {\n return collect();\n }\n\n return $configuration->contacts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->get();\n }\n\n /**\n * Return a [crm_provider_id => id] map of existing contacts for the given configuration.\n * Uses a covering index lookup (no row hydration) for hot-path callers.\n *\n * @param array<string> $crmProviderIds\n *\n * @return array<string, int>\n */\n public function getExistingContactIdsMap(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->contacts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('id', 'crm_provider_id')\n ->all();\n }\n\n public function findLeadByExternalId(Configuration $configuration, string $crmProviderId): ?Lead\n {\n return $configuration->leads()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n public function findOpportunityByExternalId(Configuration $configuration, string $crmProviderId): ?Opportunity\n {\n return $configuration->opportunities()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n /**\n * Find multiple opportunities by their external CRM IDs\n *\n * @param Configuration $configuration\n * @param array<string> $crmProviderIds\n *\n * @return Collection<Opportunity>\n */\n public function findOpportunitiesByExternalIds(Configuration $configuration, array $crmProviderIds): Collection\n {\n if (empty($crmProviderIds)) {\n return collect();\n }\n\n return $configuration->opportunities()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->get();\n }\n\n /**\n * @param array<string> $crmProviderIds\n *\n * @return array<string>\n */\n public function getExistingLeadCrmIds(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->leads()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('crm_provider_id')\n ->toArray();\n }\n\n /**\n * @param array<string> $crmProviderIds\n *\n * @return array<string>\n */\n public function getExistingAccountCrmIds(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->accounts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('crm_provider_id')\n ->toArray();\n }\n\n /**\n * @param array<string> $crmProviderIds\n *\n * @return array<string>\n */\n public function getExistingContactCrmIds(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->contacts()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('crm_provider_id')\n ->toArray();\n }\n\n /**\n * @param array<string> $crmProviderIds\n *\n * @return array<string>\n */\n public function getExistingOpportunityCrmIds(Configuration $configuration, array $crmProviderIds): array\n {\n if (empty($crmProviderIds)) {\n return [];\n }\n\n return $configuration->opportunities()\n ->whereIn('crm_provider_id', $crmProviderIds)\n ->pluck('crm_provider_id')\n ->toArray();\n }\n\n public function findProfileByExternalId(Configuration $configuration, string $crmProviderId): ?Profile\n {\n return $configuration->profiles()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n public function findBusinessProcessesByExternalId(\n Configuration $configuration,\n string $crmProviderId\n ): ?BusinessProcess {\n return $configuration->businessProcesses()\n ->where('crm_provider_id', $crmProviderId)\n ->first();\n }\n\n /**\n * @return Collection<Account>\n */\n public function findAccountsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection\n {\n return $configuration->accounts()\n ->where('owner_id', $crmOwnerId)\n ->whereNull('user_id')\n ->get();\n }\n\n /**\n * @return Collection<Contact>\n */\n public function findContactsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection\n {\n return $configuration->contacts()\n ->where('owner_id', $crmOwnerId)\n ->whereNull('user_id')\n ->get();\n }\n\n /**\n * @return Collection<Lead>\n */\n public function findLeadsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection\n {\n return $configuration->leads()\n ->where('owner_id', $crmOwnerId)\n ->whereNull('user_id')\n ->get();\n }\n\n /**\n * @return Collection<Opportunity>\n */\n public function findOpportunitiesByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection\n {\n return $configuration->opportunities()\n ->where('owner_id', $crmOwnerId)\n ->whereNull('user_id')\n ->get();\n }\n\n public function searchLeadsByString(\n Configuration $configuration,\n string $query,\n ?int $limit = null,\n ?int $offset = null,\n bool $orderByName = false,\n bool $usePhoneSearch = false\n ): Collection {\n $queryBuilder = $configuration->leads()\n ->with('stages')\n ->where('converted_at', null)\n ->whereNested(function ($qb) use ($query, $usePhoneSearch) {\n $qb->where('crm_provider_id', $query);\n\n if ($usePhoneSearch) {\n $qb->orWhere('phone', 'LIKE', \"%{$query}%\")\n ->orWhere('mobile_phone', 'LIKE', \"%{$query}%\");\n } else {\n $qb->orWhere('name', 'LIKE', \"%{$query}%\")\n ->orWhere('company', 'LIKE', \"%{$query}%\");\n }\n });\n\n if ($orderByName) {\n $queryBuilder->orderBy('name');\n }\n\n if ($limit !== null) {\n $queryBuilder->limit($limit);\n }\n\n if ($offset !== null) {\n $queryBuilder->offset($offset);\n }\n\n return $queryBuilder->get();\n }\n\n public function searchAccountsByString(\n Configuration $configuration,\n string $query,\n ?int $limit = null,\n ?int $offset = null,\n bool $orderByName = false,\n bool $usePhoneSearch = false\n ): Collection {\n $queryBuilder = $configuration->accounts()\n ->where('is_internal', 0)\n ->where(function ($qb) use ($query, $usePhoneSearch) {\n $qb->where('crm_provider_id', $query);\n\n if ($usePhoneSearch) {\n $qb->orWhere('phone', 'LIKE', \"%{$query}%\");\n } else {\n $qb->orWhere('name', 'LIKE', \"%{$query}%\");\n }\n });\n\n if ($orderByName) {\n $queryBuilder->orderBy('name');\n }\n\n if ($limit !== null) {\n $queryBuilder->limit($limit);\n }\n\n if ($offset !== null) {\n $queryBuilder->offset($offset);\n }\n\n return $queryBuilder->get();\n }\n\n public function searchContactsByString(\n Configuration $configuration,\n string $query,\n ?int $limit = null,\n ?int $offset = null,\n bool $orderByName = false,\n bool $usePhoneSearch = false\n ): Collection {\n $queryBuilder = $configuration->contacts()\n ->with('account')\n ->where(function ($qb) use ($query, $usePhoneSearch) {\n $qb->where('crm_provider_id', $query);\n\n if ($usePhoneSearch) {\n $qb->orWhere('phone', 'LIKE', \"%{$query}%\")\n ->orWhere('mobile_phone', 'LIKE', \"%{$query}%\");\n } else {\n $qb->orWhere('name', 'LIKE', \"%{$query}%\")\n ->orWhere('email', 'LIKE', \"%{$query}%\")\n ->orWhere('phone', 'LIKE', \"%{$query}%\")\n ->orWhere('mobile_phone', 'LIKE', \"%{$query}%\");\n }\n });\n\n if ($orderByName) {\n $queryBuilder->orderBy('name');\n }\n\n if ($limit !== null) {\n $queryBuilder->limit($limit);\n }\n\n if ($offset !== null) {\n $queryBuilder->offset($offset);\n }\n\n return $queryBuilder->get();\n }\n\n /**\n * Find a contact by id only if it belongs to the team\n */\n public function findContactByConfigurationAndId(Configuration $configuration, int $contactId): ?Contact\n {\n return $configuration->contacts()\n ->where('id', $contactId)\n ->first();\n }\n\n /**\n * Find a lead by id only if it belongs to the team\n */\n public function findLeadByConfigurationAndId(Configuration $configuration, int $leadId): ?Lead\n {\n return $configuration->leads()\n ->where('id', $leadId)\n ->first();\n }\n\n /**\n * Find an account by id only if it belongs to the team\n */\n public function findAccountByConfigurationAndId(Configuration $configuration, int $accountId): ?Account\n {\n return $configuration->accounts()\n ->where('id', $accountId)\n ->first();\n }\n\n /**\n * Find an opportunity by id only if it belongs to the team\n */\n public function findOpportunityByConfigurationAndId(Configuration $configuration, int $opportunityId): ?Opportunity\n {\n return $configuration->opportunities()\n ->where('id', $opportunityId)\n ->first();\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"35","depth":4,"bounds":{"left":0.9281915,"top":0.10055866,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.94049203,"top":0.10055866,"width":0.00731383,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"33","depth":4,"bounds":{"left":0.94980055,"top":0.10055866,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"63","depth":4,"bounds":{"left":0.96210104,"top":0.10055866,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9740692,"top":0.09896249,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.98138297,"top":0.09896249,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;","depth":4,"value":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.24401596,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-1988941832791249831
|
1065678639425009223
|
visual_change
|
accessibility
|
NULL
|
Patch successfully applied
text/html
text/html
tex Patch successfully applied
text/html
text/html
text/html
Project: faVsco.js, menu
JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Show Replace Field
Search History
map
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
3/5
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Code changed:
Hide
Sync Changes
Hide This Notification
6
31
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Repositories\Crm;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Jiminny\Models\Account;
use Jiminny\Models\Contact;
use Jiminny\Models\Crm\BusinessProcess;
use Jiminny\Models\Crm\Configuration;
use Jiminny\Models\Crm\Profile;
use Jiminny\Models\Crm\RecordType;
use Jiminny\Models\Lead;
use Jiminny\Models\Opportunity;
use Jiminny\Models\Stage;
class CrmEntityRepository
{
public function getExternalContactMap(Configuration $configuration): array
{
$configurationId = $configuration->getId();
$contacts = [];
$m1 = memory_get_usage();
Log::info(
'ExternalContactMap before',
[
'current' => $m1,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
$results = DB::select(
'select id, crm_provider_id from contacts where crm_configuration_id = :id and deleted_at is null',
['id' => $configurationId]
);
$m2 = memory_get_usage();
Log::info(
'ExternalContactMap after',
[
'used' => $m2 - $m1,
'current' => $m2,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
foreach ($results as $contact) {
$contacts[$contact->crm_provider_id] = $contact->id;
}
$m3 = memory_get_usage();
Log::info(
'ExternalContactMap final',
[
'used' => max($m2, $m3) - $m1,
'current' => $m3,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
return $contacts;
}
public function getExternalAccountMap(Configuration $configuration): array
{
$accounts = [];
$m1 = memory_get_usage();
$configurationId = $configuration->getId();
Log::info(
'ExternalAccountMap before',
[
'current' => $m1,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
// direct array result uses the least memory
$items = DB::select(
'select id, crm_provider_id from accounts where crm_configuration_id = :id and deleted_at is null',
['id' => $configurationId]
);
$m2 = memory_get_usage();
Log::info(
'ExternalAccountMap after',
[
'used' => $m2 - $m1,
'current' => $m2,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
foreach ($items as $item) {
$accounts[$item->crm_provider_id] = $item->id;
}
$m3 = memory_get_usage();
Log::info(
'ExternalAccountMap final',
[
'used' => max($m2, $m3) - $m1,
'current' => $m3,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
return $accounts;
}
// currently used only in tests, but keep in mind the memory usage could be high with mapWithKeys
public function getInternalAccountToContactMap(Configuration $configuration): array
{
$m1 = memory_get_usage();
$configurationId = $configuration->getId();
Log::info(
'InternalAccountToContactMap before',
[
'current' => $m1,
'config_id' => $configurationId,
]
);
$data = $configuration->accounts()
->whereHas('contacts')
->with('contacts')
->where('is_internal', 1)
->get()
->mapWithKeys(static function (Account $account) {
// Internal accounts must have only 1 contact
return [
$account->getCrmProviderId() => $account->contacts->first()->getCrmProviderId(),
];
})
->toArray();
$m2 = memory_get_usage();
Log::info(
'InternalAccountToContactMap after',
[
'used' => $m2 - $m1,
'current' => $m2,
'peak' => memory_get_peak_usage(),
'config_id' => $configurationId,
]
);
return $data;
}
public function getExternalStageMap(Configuration $configuration, ?string $type = null): array
{
return $configuration->stages()
->when($type, static fn ($query) => $query->where('type', $type))
->get()
->mapWithKeys(static function (Stage $stage) {
return [
$stage->getAttribute('name') => $stage->getAttribute('id'),
$stage->getAttribute('crm_provider_id') => $stage->getAttribute('id'),
];
})
->toArray();
}
public function getStageForName(Configuration $configuration, string $name, ?string $type = null): ?Stage
{
return $configuration->stages()
->when($type, static fn ($query) => $query->where('type', $type))
->where('name', $name)
->first();
}
public function getPipelineStageByConditions(BusinessProcess $businessProcess, array $conditions): ?Stage
{
return $businessProcess->stages()
->where($conditions)
->first();
}
public function getBusinessProcessRecordType(BusinessProcess $businessProcess): ?RecordType
{
return $businessProcess->recordTypes()->first();
}
public function getOpportunityClosedStages(Configuration $configuration): Collection
{
return $configuration->stages()
->where('type', Stage::TYPE_OPPORTUNITY)
->whereIn('probability', [0.00, 100.00])
->get();
}
public function importAccount(Configuration $configuration, array $accountData): Account
{
$account = $configuration->accounts()
->withTrashed()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $accountData['crm_provider_id'],
],
$accountData
);
if ($account->trashed()) {
Log::info('Restore deleted account', [
'id' => $account->getId(),
'crm_provider_id' => $account->getCrmProviderId(),
]);
$account->restore();
}
return $account;
}
public function importContact(Configuration $configuration, array $contactData): Contact
{
$contact = $configuration->contacts()
->withTrashed()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $contactData['crm_provider_id'],
],
$contactData
);
if ($contact->trashed()) {
Log::info('Restore deleted contact', [
'id' => $contact->getId(),
'crm_provider_id' => $contact->getCrmProviderId(),
]);
$contact->restore();
}
return $contact;
}
public function importLead(Configuration $configuration, array $leadData): Lead
{
$lead = $configuration->leads()
->withTrashed()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $leadData['crm_provider_id'],
],
$leadData
);
if ($lead->trashed()) {
Log::info('Restore deleted lead', [
'id' => $lead->getId(),
'crm_provider_id' => $lead->getCrmProviderId(),
]);
$lead->restore();
}
return $lead;
}
public function importOpportunity(
Configuration $configuration,
array $opportunityData,
bool $matchFromOtherCrm = false,
?string $matchName = null,
): Opportunity {
if ($matchFromOtherCrm) {
// Try find and match opportunity from other CRM configuration
// Update and attach it to the new CRM
// This case will work if a team is transitioning from one CRM provider to another, and we want to
// cross-reference deals.
$opportunityData['crm_configuration_id'] = $configuration->getId();
$opportunity = $configuration->getTeam()->opportunities()
->withTrashed()
->updateOrCreate(
[
'team_id' => $configuration->getTeamId(),
'user_id' => $opportunityData['user_id'],
'name' => $matchName,
],
$opportunityData
);
if ($opportunity->trashed()) {
$opportunity->restore();
}
return $opportunity;
}
$opportunity = $configuration->opportunities()
->withTrashed()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $opportunityData['crm_provider_id'],
],
$opportunityData
);
if ($opportunity->trashed()) {
Log::info('Restore deleted opportunity', [
'id' => $opportunity->getId(),
'crm_provider_id' => $opportunity->getCrmProviderId(),
]);
$opportunity->restore();
}
return $opportunity;
}
public function upsertOpportunity(array $attributes, array $data): Opportunity
{
/** @var ?Opportunity $opportunity */
$opportunity = Opportunity::withTrashed()->where($attributes)->first();
if ($opportunity === null) {
$opportunity = Opportunity::create($data);
} else {
$opportunity->update($data);
}
return $opportunity;
}
public function importStage(Configuration $configuration, string $objectType, array $stageData): Stage
{
return $configuration->stages()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $stageData['crm_provider_id'],
'type' => $objectType,
],
$stageData
);
}
public function importBusinessProcess(Configuration $configuration, array $pipelineData): BusinessProcess
{
return $configuration->businessProcesses()
->updateOrCreate(
[
'crm_configuration_id' => $configuration->getId(),
'team_id' => $configuration->getTeamId(),
'crm_provider_id' => $pipelineData['crm_provider_id'],
'type' => $pipelineData['object_type'],
],
$pipelineData
);
}
public function findAccountByExternalId(Configuration $configuration, string $crmProviderId): ?Account
{
return $configuration->accounts()
->where('crm_provider_id', $crmProviderId)
->first();
}
/**
* Find multiple accounts by their external CRM IDs
*
* @param Configuration $configuration
* @param array<string> $crmProviderIds
*
* @return Collection<Account>
*/
public function findAccountsByExternalIds(Configuration $configuration, array $crmProviderIds): Collection
{
if (empty($crmProviderIds)) {
return collect();
}
return $configuration->accounts()
->whereIn('crm_provider_id', $crmProviderIds)
->get();
}
/**
* Return a [crm_provider_id => id] map of existing accounts for the given configuration.
* Uses a covering index lookup (no row hydration) for hot-path callers.
*
* @param array<string> $crmProviderIds
*
* @return array<string, int>
*/
public function getExistingAccountIdsMap(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->accounts()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('id', 'crm_provider_id')
->all();
}
public function findContactByExternalId(Configuration $configuration, string $crmProviderId): ?Contact
{
return $configuration->contacts()
->where('crm_provider_id', $crmProviderId)
->first();
}
/**
* Find multiple contacts by their external CRM IDs
*
* @param Configuration $configuration
* @param array<string> $crmProviderIds
*
* @return Collection<Contact>
*/
public function findContactsByExternalIds(Configuration $configuration, array $crmProviderIds): Collection
{
if (empty($crmProviderIds)) {
return collect();
}
return $configuration->contacts()
->whereIn('crm_provider_id', $crmProviderIds)
->get();
}
/**
* Return a [crm_provider_id => id] map of existing contacts for the given configuration.
* Uses a covering index lookup (no row hydration) for hot-path callers.
*
* @param array<string> $crmProviderIds
*
* @return array<string, int>
*/
public function getExistingContactIdsMap(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->contacts()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('id', 'crm_provider_id')
->all();
}
public function findLeadByExternalId(Configuration $configuration, string $crmProviderId): ?Lead
{
return $configuration->leads()
->where('crm_provider_id', $crmProviderId)
->first();
}
public function findOpportunityByExternalId(Configuration $configuration, string $crmProviderId): ?Opportunity
{
return $configuration->opportunities()
->where('crm_provider_id', $crmProviderId)
->first();
}
/**
* Find multiple opportunities by their external CRM IDs
*
* @param Configuration $configuration
* @param array<string> $crmProviderIds
*
* @return Collection<Opportunity>
*/
public function findOpportunitiesByExternalIds(Configuration $configuration, array $crmProviderIds): Collection
{
if (empty($crmProviderIds)) {
return collect();
}
return $configuration->opportunities()
->whereIn('crm_provider_id', $crmProviderIds)
->get();
}
/**
* @param array<string> $crmProviderIds
*
* @return array<string>
*/
public function getExistingLeadCrmIds(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->leads()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('crm_provider_id')
->toArray();
}
/**
* @param array<string> $crmProviderIds
*
* @return array<string>
*/
public function getExistingAccountCrmIds(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->accounts()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('crm_provider_id')
->toArray();
}
/**
* @param array<string> $crmProviderIds
*
* @return array<string>
*/
public function getExistingContactCrmIds(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->contacts()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('crm_provider_id')
->toArray();
}
/**
* @param array<string> $crmProviderIds
*
* @return array<string>
*/
public function getExistingOpportunityCrmIds(Configuration $configuration, array $crmProviderIds): array
{
if (empty($crmProviderIds)) {
return [];
}
return $configuration->opportunities()
->whereIn('crm_provider_id', $crmProviderIds)
->pluck('crm_provider_id')
->toArray();
}
public function findProfileByExternalId(Configuration $configuration, string $crmProviderId): ?Profile
{
return $configuration->profiles()
->where('crm_provider_id', $crmProviderId)
->first();
}
public function findBusinessProcessesByExternalId(
Configuration $configuration,
string $crmProviderId
): ?BusinessProcess {
return $configuration->businessProcesses()
->where('crm_provider_id', $crmProviderId)
->first();
}
/**
* @return Collection<Account>
*/
public function findAccountsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection
{
return $configuration->accounts()
->where('owner_id', $crmOwnerId)
->whereNull('user_id')
->get();
}
/**
* @return Collection<Contact>
*/
public function findContactsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection
{
return $configuration->contacts()
->where('owner_id', $crmOwnerId)
->whereNull('user_id')
->get();
}
/**
* @return Collection<Lead>
*/
public function findLeadsByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection
{
return $configuration->leads()
->where('owner_id', $crmOwnerId)
->whereNull('user_id')
->get();
}
/**
* @return Collection<Opportunity>
*/
public function findOpportunitiesByExternalOwnerId(Configuration $configuration, string $crmOwnerId): Collection
{
return $configuration->opportunities()
->where('owner_id', $crmOwnerId)
->whereNull('user_id')
->get();
}
public function searchLeadsByString(
Configuration $configuration,
string $query,
?int $limit = null,
?int $offset = null,
bool $orderByName = false,
bool $usePhoneSearch = false
): Collection {
$queryBuilder = $configuration->leads()
->with('stages')
->where('converted_at', null)
->whereNested(function ($qb) use ($query, $usePhoneSearch) {
$qb->where('crm_provider_id', $query);
if ($usePhoneSearch) {
$qb->orWhere('phone', 'LIKE', "%{$query}%")
->orWhere('mobile_phone', 'LIKE', "%{$query}%");
} else {
$qb->orWhere('name', 'LIKE', "%{$query}%")
->orWhere('company', 'LIKE', "%{$query}%");
}
});
if ($orderByName) {
$queryBuilder->orderBy('name');
}
if ($limit !== null) {
$queryBuilder->limit($limit);
}
if ($offset !== null) {
$queryBuilder->offset($offset);
}
return $queryBuilder->get();
}
public function searchAccountsByString(
Configuration $configuration,
string $query,
?int $limit = null,
?int $offset = null,
bool $orderByName = false,
bool $usePhoneSearch = false
): Collection {
$queryBuilder = $configuration->accounts()
->where('is_internal', 0)
->where(function ($qb) use ($query, $usePhoneSearch) {
$qb->where('crm_provider_id', $query);
if ($usePhoneSearch) {
$qb->orWhere('phone', 'LIKE', "%{$query}%");
} else {
$qb->orWhere('name', 'LIKE', "%{$query}%");
}
});
if ($orderByName) {
$queryBuilder->orderBy('name');
}
if ($limit !== null) {
$queryBuilder->limit($limit);
}
if ($offset !== null) {
$queryBuilder->offset($offset);
}
return $queryBuilder->get();
}
public function searchContactsByString(
Configuration $configuration,
string $query,
?int $limit = null,
?int $offset = null,
bool $orderByName = false,
bool $usePhoneSearch = false
): Collection {
$queryBuilder = $configuration->contacts()
->with('account')
->where(function ($qb) use ($query, $usePhoneSearch) {
$qb->where('crm_provider_id', $query);
if ($usePhoneSearch) {
$qb->orWhere('phone', 'LIKE', "%{$query}%")
->orWhere('mobile_phone', 'LIKE', "%{$query}%");
} else {
$qb->orWhere('name', 'LIKE', "%{$query}%")
->orWhere('email', 'LIKE', "%{$query}%")
->orWhere('phone', 'LIKE', "%{$query}%")
->orWhere('mobile_phone', 'LIKE', "%{$query}%");
}
});
if ($orderByName) {
$queryBuilder->orderBy('name');
}
if ($limit !== null) {
$queryBuilder->limit($limit);
}
if ($offset !== null) {
$queryBuilder->offset($offset);
}
return $queryBuilder->get();
}
/**
* Find a contact by id only if it belongs to the team
*/
public function findContactByConfigurationAndId(Configuration $configuration, int $contactId): ?Contact
{
return $configuration->contacts()
->where('id', $contactId)
->first();
}
/**
* Find a lead by id only if it belongs to the team
*/
public function findLeadByConfigurationAndId(Configuration $configuration, int $leadId): ?Lead
{
return $configuration->leads()
->where('id', $leadId)
->first();
}
/**
* Find an account by id only if it belongs to the team
*/
public function findAccountByConfigurationAndId(Configuration $configuration, int $accountId): ?Account
{
return $configuration->accounts()
->where('id', $accountId)
->first();
}
/**
* Find an opportunity by id only if it belongs to the team
*/
public function findOpportunityByConfigurationAndId(Configuration $configuration, int $opportunityId): ?Opportunity
{
return $configuration->opportunities()
->where('id', $opportunityId)
->first();
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
35
1
33
63
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id =...
|
70370
|
|
76214
|
1908
|
29
|
2026-04-24T07:36:41.235053+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-24/1777 /Users/lukas/.screenpipe/data/data/2026-04-24/1777016201235_m2.jpg...
|
PhpStorm
|
faVsco.js – TrackAutomatedReportGeneratedEventTest faVsco.js – TrackAutomatedReportGeneratedEventTest.php...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Patch successfully applied
text/html
text/html
tex Patch successfully applied
text/html
text/html
text/html
Project: faVsco.js, menu
#12011 on JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
TrackAutomatedReportGeneratedEventTest
Run 'TrackAutomatedReportGeneratedEventTest'
Debug 'TrackAutomatedReportGeneratedEventTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Code changed:
Hide
Sync Changes
Hide This Notification
43
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\Contracts\UserContract;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use Illuminate\Support\Facades\Log;
class TrackAutomatedReportGeneratedEvent implements ShouldQueue
{
use InteractsWithQueue;
private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';
private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';
public string $queue = Constants::QUEUE_DELAYABLE;
public function __construct(
private readonly UserPilotClient $userPilotClient,
private readonly AutomatedReportsService $automatedReportsService,
) {
}
public function handle(AutomatedReportGenerated $event): void
{
if (config('services.userpilot.token') === null) {
return;
}
$automatedReport = $event->automatedReport;
$payload = $this->buildPayload($automatedReport);
$eventName = $this->resolveEventName($automatedReport);
$users = $this->resolveUsers($automatedReport);
if (empty($users)) {
Log::warning('[UserPilot] No recipients found for automated report', [
'report_id' => $automatedReport->getId(),
'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),
]);
return;
}
Log::info('[UserPilot] Sending automated report event', [
'report_id' => $automatedReport->getId(),
'event_name' => $eventName,
'recipient_count' => count($users),
]);
try {
foreach ($users as $user) {
$this->userPilotClient->track($user, $eventName, $payload);
}
} catch (GuzzleException $e) {
Log::error('[UserPilot] Failed to send automated report event', [
'report_id' => $automatedReport->getId(),
'error' => $e->getMessage(),
]);
$this->release(3600);
}
}
/**
* @return array<UserContract>
*/
private function resolveUsers(AutomatedReport $automatedReport): array
{
if ($automatedReport->isAskJiminnyReport()) {
$creator = $automatedReport->getCreator();
return $creator !== null ? [$creator] : [];
}
return $this->automatedReportsService->getRecipientUserObjects($automatedReport);
}
private function buildPayload(AutomatedReport $automatedReport): array
{
return [
'report_type' => $automatedReport->getType(),
'frequency' => $automatedReport->getFrequency(),
];
}
private function resolveEventName(AutomatedReport $automatedReport): string
{
if ($automatedReport->isAskJiminnyReport()) {
return self::EVENT_NAME_ASK_JIMINNY_REPORT;
}
return self::EVENT_NAME_AUTOMATED_REPORT;
}
}
+++
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(123);
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(456);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(789);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(101);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$report->method('getId')->willReturn(202);
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$report->expects($this->once())->method('getId')->willReturn(303);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Patch successfully applied","depth":3,"bounds":{"left":0.24833776,"top":0.858739,"width":0.05418883,"height":0.013567438},"value":"Patch successfully applied","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.24833776,"top":0.858739,"width":0.05418883,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.25731382,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12011 on JY-20157-AJ-report-not-send-notification, menu","depth":5,"bounds":{"left":0.29587767,"top":0.019952115,"width":0.12134308,"height":0.025538707},"help_text":"Pull request #12011 exists for current branch JY-20157-AJ-report-not-send-notification","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.796875,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TrackAutomatedReportGeneratedEventTest","depth":6,"bounds":{"left":0.8121675,"top":0.019952115,"width":0.103390954,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TrackAutomatedReportGeneratedEventTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TrackAutomatedReportGeneratedEventTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"9","depth":4,"bounds":{"left":0.59574467,"top":0.32322428,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.60538566,"top":0.3216281,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.61269945,"top":0.3216281,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"43","depth":4,"bounds":{"left":0.96210104,"top":0.10055866,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9740692,"top":0.09896249,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.98138297,"top":0.09896249,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\Contracts\\UserContract;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse Illuminate\\Support\\Facades\\Log;\n\nclass TrackAutomatedReportGeneratedEvent implements ShouldQueue\n{\n use InteractsWithQueue;\n\n private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';\n private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';\n\n public string $queue = Constants::QUEUE_DELAYABLE;\n\n public function __construct(\n private readonly UserPilotClient $userPilotClient,\n private readonly AutomatedReportsService $automatedReportsService,\n ) {\n }\n\n public function handle(AutomatedReportGenerated $event): void\n {\n if (config('services.userpilot.token') === null) {\n return;\n }\n\n $automatedReport = $event->automatedReport;\n $payload = $this->buildPayload($automatedReport);\n\n $eventName = $this->resolveEventName($automatedReport);\n\n $users = $this->resolveUsers($automatedReport);\n\n if (empty($users)) {\n Log::warning('[UserPilot] No recipients found for automated report', [\n 'report_id' => $automatedReport->getId(),\n 'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),\n ]);\n\n return;\n }\n\n Log::info('[UserPilot] Sending automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'event_name' => $eventName,\n 'recipient_count' => count($users),\n ]);\n\n try {\n foreach ($users as $user) {\n $this->userPilotClient->track($user, $eventName, $payload);\n }\n } catch (GuzzleException $e) {\n Log::error('[UserPilot] Failed to send automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'error' => $e->getMessage(),\n ]);\n $this->release(3600);\n }\n }\n\n /**\n * @return array<UserContract>\n */\n private function resolveUsers(AutomatedReport $automatedReport): array\n {\n if ($automatedReport->isAskJiminnyReport()) {\n $creator = $automatedReport->getCreator();\n\n return $creator !== null ? [$creator] : [];\n }\n\n return $this->automatedReportsService->getRecipientUserObjects($automatedReport);\n }\n\n private function buildPayload(AutomatedReport $automatedReport): array\n {\n return [\n 'report_type' => $automatedReport->getType(),\n 'frequency' => $automatedReport->getFrequency(),\n ];\n }\n\n private function resolveEventName(AutomatedReport $automatedReport): string\n {\n if ($automatedReport->isAskJiminnyReport()) {\n return self::EVENT_NAME_ASK_JIMINNY_REPORT;\n }\n\n return self::EVENT_NAME_AUTOMATED_REPORT;\n }\n}\n\n+++\n\n<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(123);\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(456);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(789);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(101);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n $report->method('getId')->willReturn(202);\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n $report->expects($this->once())->method('getId')->willReturn(303);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\Contracts\\UserContract;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse Illuminate\\Support\\Facades\\Log;\n\nclass TrackAutomatedReportGeneratedEvent implements ShouldQueue\n{\n use InteractsWithQueue;\n\n private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';\n private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';\n\n public string $queue = Constants::QUEUE_DELAYABLE;\n\n public function __construct(\n private readonly UserPilotClient $userPilotClient,\n private readonly AutomatedReportsService $automatedReportsService,\n ) {\n }\n\n public function handle(AutomatedReportGenerated $event): void\n {\n if (config('services.userpilot.token') === null) {\n return;\n }\n\n $automatedReport = $event->automatedReport;\n $payload = $this->buildPayload($automatedReport);\n\n $eventName = $this->resolveEventName($automatedReport);\n\n $users = $this->resolveUsers($automatedReport);\n\n if (empty($users)) {\n Log::warning('[UserPilot] No recipients found for automated report', [\n 'report_id' => $automatedReport->getId(),\n 'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),\n ]);\n\n return;\n }\n\n Log::info('[UserPilot] Sending automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'event_name' => $eventName,\n 'recipient_count' => count($users),\n ]);\n\n try {\n foreach ($users as $user) {\n $this->userPilotClient->track($user, $eventName, $payload);\n }\n } catch (GuzzleException $e) {\n Log::error('[UserPilot] Failed to send automated report event', [\n 'report_id' => $automatedReport->getId(),\n 'error' => $e->getMessage(),\n ]);\n $this->release(3600);\n }\n }\n\n /**\n * @return array<UserContract>\n */\n private function resolveUsers(AutomatedReport $automatedReport): array\n {\n if ($automatedReport->isAskJiminnyReport()) {\n $creator = $automatedReport->getCreator();\n\n return $creator !== null ? [$creator] : [];\n }\n\n return $this->automatedReportsService->getRecipientUserObjects($automatedReport);\n }\n\n private function buildPayload(AutomatedReport $automatedReport): array\n {\n return [\n 'report_type' => $automatedReport->getType(),\n 'frequency' => $automatedReport->getFrequency(),\n ];\n }\n\n private function resolveEventName(AutomatedReport $automatedReport): string\n {\n if ($automatedReport->isAskJiminnyReport()) {\n return self::EVENT_NAME_ASK_JIMINNY_REPORT;\n }\n\n return self::EVENT_NAME_AUTOMATED_REPORT;\n }\n}\n\n+++\n\n<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Listeners\\AutomatedReports\\UserPilot;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Listeners\\AutomatedReports\\UserPilot\\TrackAutomatedReportGeneratedEvent;\nuse Jiminny\\Models\\AutomatedReport;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Jiminny\\Services\\UserPilot\\UserPilotClient;\nuse PHPUnit\\Framework\\MockObject\\MockObject;\nuse Tests\\TestCase;\n\nclass TrackAutomatedReportGeneratedEventTest extends TestCase\n{\n private UserPilotClient&MockObject $userPilotClient;\n private AutomatedReportsService&MockObject $automatedReportsService;\n\n protected function setUp(): void\n {\n parent::setUp();\n $this->userPilotClient = $this->createMock(UserPilotClient::class);\n $this->automatedReportsService = $this->createMock(AutomatedReportsService::class);\n }\n\n private function makeListener(): TrackAutomatedReportGeneratedEvent\n {\n return new TrackAutomatedReportGeneratedEvent(\n $this->userPilotClient,\n $this->automatedReportsService,\n );\n }\n\n private function makeEvent(AutomatedReport $report): AutomatedReportGenerated\n {\n return new AutomatedReportGenerated($report);\n }\n\n public function testHandleSkipsWhenUserPilotTokenIsNull(): void\n {\n config(['services.userpilot.token' => null]);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->never())->method('isAskJiminnyReport');\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksCreatorForAskJiminnyReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn($creator);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(123);\n\n $this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $creator,\n 'ask-jiminny-report-generated',\n ['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);\n $report->expects($this->once())->method('getCreator')->willReturn(null);\n $report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->expects($this->once())->method('getFrequency')->willReturn('weekly');\n $report->expects($this->once())->method('getId')->willReturn(456);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleTracksAllRecipientsForExecReport(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $userOne = $this->createMock(User::class);\n $userTwo = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(789);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$userOne, $userTwo]);\n\n $this->userPilotClient->expects($this->exactly(2))\n ->method('track')\n ->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {\n $this->assertTrue($user === $userOne || $user === $userTwo);\n $this->assertSame('automated-report-generated', $eventName);\n $this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);\n\n return null;\n });\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('exec_summary');\n $report->expects($this->once())->method('getFrequency')->willReturn('monthly');\n $report->expects($this->once())->method('getId')->willReturn(101);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->willReturn([]);\n\n $this->userPilotClient->expects($this->never())->method('track');\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n\n public function testHandleDoesNotThrowOnGuzzleException(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $creator = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->method('isAskJiminnyReport')->willReturn(true);\n $report->method('getCreator')->willReturn($creator);\n $report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);\n $report->method('getFrequency')->willReturn('daily');\n $report->method('getId')->willReturn(202);\n\n $guzzleException = $this->createMock(GuzzleException::class);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with($creator, 'ask-jiminny-report-generated', $this->anything())\n ->willThrowException($guzzleException);\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n\n $this->addToAssertionCount(1);\n }\n\n public function testHandleTracksAutomatedReportWithSingleRecipient(): void\n {\n config(['services.userpilot.token' => 'NX-token']);\n\n $user = $this->createMock(User::class);\n\n $report = $this->createMock(AutomatedReport::class);\n $report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);\n $report->expects($this->once())->method('getType')->willReturn('team_performance');\n $report->expects($this->once())->method('getFrequency')->willReturn('daily');\n $report->expects($this->once())->method('getId')->willReturn(303);\n\n $this->automatedReportsService->expects($this->once())\n ->method('getRecipientUserObjects')\n ->with($report)\n ->willReturn([$user]);\n\n $this->userPilotClient->expects($this->once())\n ->method('track')\n ->with(\n $user,\n 'automated-report-generated',\n ['report_type' => 'team_performance', 'frequency' => 'daily']\n );\n\n $listener = $this->makeListener();\n $listener->handle($this->makeEvent($report));\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.24335106,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-2008227989749799702
|
8404466858115443482
|
click
|
accessibility
|
NULL
|
Patch successfully applied
text/html
text/html
tex Patch successfully applied
text/html
text/html
text/html
Project: faVsco.js, menu
#12011 on JY-20157-AJ-report-not-send-notification, menu
Start Listening for PHP Debug Connections
TrackAutomatedReportGeneratedEventTest
Run 'TrackAutomatedReportGeneratedEventTest'
Debug 'TrackAutomatedReportGeneratedEventTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
9
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Code changed:
Hide
Sync Changes
Hide This Notification
43
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\Contracts\UserContract;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use Illuminate\Support\Facades\Log;
class TrackAutomatedReportGeneratedEvent implements ShouldQueue
{
use InteractsWithQueue;
private const string EVENT_NAME_AUTOMATED_REPORT = 'automated-report-generated';
private const string EVENT_NAME_ASK_JIMINNY_REPORT = 'ask-jiminny-report-generated';
public string $queue = Constants::QUEUE_DELAYABLE;
public function __construct(
private readonly UserPilotClient $userPilotClient,
private readonly AutomatedReportsService $automatedReportsService,
) {
}
public function handle(AutomatedReportGenerated $event): void
{
if (config('services.userpilot.token') === null) {
return;
}
$automatedReport = $event->automatedReport;
$payload = $this->buildPayload($automatedReport);
$eventName = $this->resolveEventName($automatedReport);
$users = $this->resolveUsers($automatedReport);
if (empty($users)) {
Log::warning('[UserPilot] No recipients found for automated report', [
'report_id' => $automatedReport->getId(),
'is_ask_jiminny' => $automatedReport->isAskJiminnyReport(),
]);
return;
}
Log::info('[UserPilot] Sending automated report event', [
'report_id' => $automatedReport->getId(),
'event_name' => $eventName,
'recipient_count' => count($users),
]);
try {
foreach ($users as $user) {
$this->userPilotClient->track($user, $eventName, $payload);
}
} catch (GuzzleException $e) {
Log::error('[UserPilot] Failed to send automated report event', [
'report_id' => $automatedReport->getId(),
'error' => $e->getMessage(),
]);
$this->release(3600);
}
}
/**
* @return array<UserContract>
*/
private function resolveUsers(AutomatedReport $automatedReport): array
{
if ($automatedReport->isAskJiminnyReport()) {
$creator = $automatedReport->getCreator();
return $creator !== null ? [$creator] : [];
}
return $this->automatedReportsService->getRecipientUserObjects($automatedReport);
}
private function buildPayload(AutomatedReport $automatedReport): array
{
return [
'report_type' => $automatedReport->getType(),
'frequency' => $automatedReport->getFrequency(),
];
}
private function resolveEventName(AutomatedReport $automatedReport): string
{
if ($automatedReport->isAskJiminnyReport()) {
return self::EVENT_NAME_ASK_JIMINNY_REPORT;
}
return self::EVENT_NAME_AUTOMATED_REPORT;
}
}
+++
<?php
declare(strict_types=1);
namespace Tests\Unit\Listeners\AutomatedReports\UserPilot;
use GuzzleHttp\Exception\GuzzleException;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Listeners\AutomatedReports\UserPilot\TrackAutomatedReportGeneratedEvent;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\User;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
class TrackAutomatedReportGeneratedEventTest extends TestCase
{
private UserPilotClient&MockObject $userPilotClient;
private AutomatedReportsService&MockObject $automatedReportsService;
protected function setUp(): void
{
parent::setUp();
$this->userPilotClient = $this->createMock(UserPilotClient::class);
$this->automatedReportsService = $this->createMock(AutomatedReportsService::class);
}
private function makeListener(): TrackAutomatedReportGeneratedEvent
{
return new TrackAutomatedReportGeneratedEvent(
$this->userPilotClient,
$this->automatedReportsService,
);
}
private function makeEvent(AutomatedReport $report): AutomatedReportGenerated
{
return new AutomatedReportGenerated($report);
}
public function testHandleSkipsWhenUserPilotTokenIsNull(): void
{
config(['services.userpilot.token' => null]);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->never())->method('isAskJiminnyReport');
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksCreatorForAskJiminnyReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn($creator);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(123);
$this->automatedReportsService->expects($this->never())->method('getRecipientUserObjects');
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$creator,
'ask-jiminny-report-generated',
['report_type' => AutomatedReportsService::TYPE_ASK_JIMINNY, 'frequency' => 'weekly']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleSkipsTrackingWhenAskJiminnyCreatorIsNull(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(true);
$report->expects($this->once())->method('getCreator')->willReturn(null);
$report->expects($this->once())->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->expects($this->once())->method('getFrequency')->willReturn('weekly');
$report->expects($this->once())->method('getId')->willReturn(456);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleTracksAllRecipientsForExecReport(): void
{
config(['services.userpilot.token' => 'NX-token']);
$userOne = $this->createMock(User::class);
$userTwo = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(789);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$userOne, $userTwo]);
$this->userPilotClient->expects($this->exactly(2))
->method('track')
->willReturnCallback(function ($user, $eventName, $payload) use ($userOne, $userTwo) {
$this->assertTrue($user === $userOne || $user === $userTwo);
$this->assertSame('automated-report-generated', $eventName);
$this->assertSame(['report_type' => 'exec_summary', 'frequency' => 'monthly'], $payload);
return null;
});
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotTrackWhenExecReportHasNoRecipients(): void
{
config(['services.userpilot.token' => 'NX-token']);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(3))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('exec_summary');
$report->expects($this->once())->method('getFrequency')->willReturn('monthly');
$report->expects($this->once())->method('getId')->willReturn(101);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->willReturn([]);
$this->userPilotClient->expects($this->never())->method('track');
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
public function testHandleDoesNotThrowOnGuzzleException(): void
{
config(['services.userpilot.token' => 'NX-token']);
$creator = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->method('isAskJiminnyReport')->willReturn(true);
$report->method('getCreator')->willReturn($creator);
$report->method('getType')->willReturn(AutomatedReportsService::TYPE_ASK_JIMINNY);
$report->method('getFrequency')->willReturn('daily');
$report->method('getId')->willReturn(202);
$guzzleException = $this->createMock(GuzzleException::class);
$this->userPilotClient->expects($this->once())
->method('track')
->with($creator, 'ask-jiminny-report-generated', $this->anything())
->willThrowException($guzzleException);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
$this->addToAssertionCount(1);
}
public function testHandleTracksAutomatedReportWithSingleRecipient(): void
{
config(['services.userpilot.token' => 'NX-token']);
$user = $this->createMock(User::class);
$report = $this->createMock(AutomatedReport::class);
$report->expects($this->exactly(2))->method('isAskJiminnyReport')->willReturn(false);
$report->expects($this->once())->method('getType')->willReturn('team_performance');
$report->expects($this->once())->method('getFrequency')->willReturn('daily');
$report->expects($this->once())->method('getId')->willReturn(303);
$this->automatedReportsService->expects($this->once())
->method('getRecipientUserObjects')
->with($report)
->willReturn([$user]);
$this->userPilotClient->expects($this->once())
->method('track')
->with(
$user,
'automated-report-generated',
['report_type' => 'team_performance', 'frequency' => 'daily']
);
$listener = $this->makeListener();
$listener->handle($this->makeEvent($report));
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
76212
|
|
68731
|
1561
|
18
|
2026-04-22T06:35:00.417230+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-22/1776 /Users/lukas/.screenpipe/data/data/2026-04-22/1776839700417_m2.jpg...
|
PhpStorm
|
faVsco.js – RematchActivityOnCrmObjectDetach.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Patch successfully applied
text/html
text/html
tex Patch successfully applied
text/html
text/html
text/html
Project: faVsco.js, menu
JY-20372-ai-reports-promotion-pages, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
4
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Listeners\Crm;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Bus;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Jobs\Crm\CheckAndRetryRemoteMatch;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
readonly class RematchActivityOnCrmObjectDetach implements ShouldQueue
{
private const array SUPPORTED_OBJECTS = [
CrmObject::LEAD,
CrmObject::OPPORTUNITY,
CrmObject::CONTACT,
CrmObject::ACCOUNT,
];
public function __construct(
private LoggerInterface $logger,
) {
}
public function handle(DetachActivityObject $event): void
{
$crmObject = $event->getCrmObject();
$activity = $event->getActivity();
if ($activity->trashed()) {
$this->logger->info('[RematchActivityOnCrmObjectDetach] Skipping rematch for soft-deleted activity', [
'activity' => $activity->getId(),
'crm_object' => $crmObject->value,
]);
return;
}
if (! in_array($crmObject, self::SUPPORTED_OBJECTS, true)) {
$this->logger->debug('[RematchActivityOnCrmObjectDetach] Skipping rematch for CRM object type', [
'activity' => $activity->getId(),
'crm_object' => $crmObject->value,
]);
return;
}
if ($activity->isTypeConference() &&
! in_array($activity->getStatus(), Activity::FINITE_STATES_CONFERENCE, true)
) {
$this->logger
->info('[RematchActivityOnCrmObjectDetach] Skipping rematch for non-finite conference activity', [
'activity' => $activity->getId(),
'crm_object' => $crmObject->value,
]);
return;
}
$this->logger->info('[RematchActivityOnCrmObjectDetach] Try to match new crm data for deleted object', [
'activity' => $activity->getId(),
'crm_object' => $crmObject->value,
]);
Bus::chain([
new MatchActivityCrmData(
activityId: $activity->getId(),
fromConfiguration: null,
remoteSearch: false,
),
new CheckAndRetryRemoteMatch(
activityId: $activity->getId(),
crmObject: $crmObject,
),
])->dispatch();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
35
1
33
63
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Patch successfully applied","depth":3,"bounds":{"left":0.016954787,"top":0.858739,"width":0.05418883,"height":0.013567438},"value":"Patch successfully applied","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.016954787,"top":0.858739,"width":0.05418883,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20372-ai-reports-promotion-pages, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09507979,"height":0.025538707},"help_text":"Git Branch: JY-20372-ai-reports-promotion-pages","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.51296544,"top":0.19952115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.5226064,"top":0.19792499,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.5299202,"top":0.19792499,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Listeners\\Crm;\n\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Support\\Facades\\Bus;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Jobs\\Crm\\CheckAndRetryRemoteMatch;\nuse Jiminny\\Jobs\\Crm\\MatchActivityCrmData;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\n\nreadonly class RematchActivityOnCrmObjectDetach implements ShouldQueue\n{\n private const array SUPPORTED_OBJECTS = [\n CrmObject::LEAD,\n CrmObject::OPPORTUNITY,\n CrmObject::CONTACT,\n CrmObject::ACCOUNT,\n ];\n\n public function __construct(\n private LoggerInterface $logger,\n ) {\n }\n\n public function handle(DetachActivityObject $event): void\n {\n $crmObject = $event->getCrmObject();\n $activity = $event->getActivity();\n\n if ($activity->trashed()) {\n $this->logger->info('[RematchActivityOnCrmObjectDetach] Skipping rematch for soft-deleted activity', [\n 'activity' => $activity->getId(),\n 'crm_object' => $crmObject->value,\n ]);\n\n return;\n }\n\n if (! in_array($crmObject, self::SUPPORTED_OBJECTS, true)) {\n $this->logger->debug('[RematchActivityOnCrmObjectDetach] Skipping rematch for CRM object type', [\n 'activity' => $activity->getId(),\n 'crm_object' => $crmObject->value,\n ]);\n\n return;\n }\n\n if ($activity->isTypeConference() &&\n ! in_array($activity->getStatus(), Activity::FINITE_STATES_CONFERENCE, true)\n ) {\n $this->logger\n ->info('[RematchActivityOnCrmObjectDetach] Skipping rematch for non-finite conference activity', [\n 'activity' => $activity->getId(),\n 'crm_object' => $crmObject->value,\n ]);\n\n return;\n }\n\n $this->logger->info('[RematchActivityOnCrmObjectDetach] Try to match new crm data for deleted object', [\n 'activity' => $activity->getId(),\n 'crm_object' => $crmObject->value,\n ]);\n\n Bus::chain([\n new MatchActivityCrmData(\n activityId: $activity->getId(),\n fromConfiguration: null,\n remoteSearch: false,\n ),\n new CheckAndRetryRemoteMatch(\n activityId: $activity->getId(),\n crmObject: $crmObject,\n ),\n ])->dispatch();\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Listeners\\Crm;\n\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Support\\Facades\\Bus;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Jobs\\Crm\\CheckAndRetryRemoteMatch;\nuse Jiminny\\Jobs\\Crm\\MatchActivityCrmData;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\n\nreadonly class RematchActivityOnCrmObjectDetach implements ShouldQueue\n{\n private const array SUPPORTED_OBJECTS = [\n CrmObject::LEAD,\n CrmObject::OPPORTUNITY,\n CrmObject::CONTACT,\n CrmObject::ACCOUNT,\n ];\n\n public function __construct(\n private LoggerInterface $logger,\n ) {\n }\n\n public function handle(DetachActivityObject $event): void\n {\n $crmObject = $event->getCrmObject();\n $activity = $event->getActivity();\n\n if ($activity->trashed()) {\n $this->logger->info('[RematchActivityOnCrmObjectDetach] Skipping rematch for soft-deleted activity', [\n 'activity' => $activity->getId(),\n 'crm_object' => $crmObject->value,\n ]);\n\n return;\n }\n\n if (! in_array($crmObject, self::SUPPORTED_OBJECTS, true)) {\n $this->logger->debug('[RematchActivityOnCrmObjectDetach] Skipping rematch for CRM object type', [\n 'activity' => $activity->getId(),\n 'crm_object' => $crmObject->value,\n ]);\n\n return;\n }\n\n if ($activity->isTypeConference() &&\n ! in_array($activity->getStatus(), Activity::FINITE_STATES_CONFERENCE, true)\n ) {\n $this->logger\n ->info('[RematchActivityOnCrmObjectDetach] Skipping rematch for non-finite conference activity', [\n 'activity' => $activity->getId(),\n 'crm_object' => $crmObject->value,\n ]);\n\n return;\n }\n\n $this->logger->info('[RematchActivityOnCrmObjectDetach] Try to match new crm data for deleted object', [\n 'activity' => $activity->getId(),\n 'crm_object' => $crmObject->value,\n ]);\n\n Bus::chain([\n new MatchActivityCrmData(\n activityId: $activity->getId(),\n fromConfiguration: null,\n remoteSearch: false,\n ),\n new CheckAndRetryRemoteMatch(\n activityId: $activity->getId(),\n crmObject: $crmObject,\n ),\n ])->dispatch();\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.53856385,"top":0.074221864,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.5472075,"top":0.074221864,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.5581782,"top":0.074221864,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.5668218,"top":0.074221864,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.57546544,"top":0.074221864,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.58643615,"top":0.074221864,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.5974069,"top":0.074221864,"width":0.024268618,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.62400264,"top":0.074221864,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.6349734,"top":0.074221864,"width":0.029587766,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.9587766,"top":0.074221864,"width":0.02825798,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"35","depth":4,"bounds":{"left":0.9281915,"top":0.09896249,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.94049203,"top":0.09896249,"width":0.00731383,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"33","depth":4,"bounds":{"left":0.94980055,"top":0.09896249,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"63","depth":4,"bounds":{"left":0.96210104,"top":0.09896249,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9740692,"top":0.09736632,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.98138297,"top":0.09736632,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;","depth":4,"value":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-6948940988263269382
|
2218635362830792269
|
visual_change
|
accessibility
|
NULL
|
Patch successfully applied
text/html
text/html
tex Patch successfully applied
text/html
text/html
text/html
Project: faVsco.js, menu
JY-20372-ai-reports-promotion-pages, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
4
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Listeners\Crm;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Bus;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Jobs\Crm\CheckAndRetryRemoteMatch;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
readonly class RematchActivityOnCrmObjectDetach implements ShouldQueue
{
private const array SUPPORTED_OBJECTS = [
CrmObject::LEAD,
CrmObject::OPPORTUNITY,
CrmObject::CONTACT,
CrmObject::ACCOUNT,
];
public function __construct(
private LoggerInterface $logger,
) {
}
public function handle(DetachActivityObject $event): void
{
$crmObject = $event->getCrmObject();
$activity = $event->getActivity();
if ($activity->trashed()) {
$this->logger->info('[RematchActivityOnCrmObjectDetach] Skipping rematch for soft-deleted activity', [
'activity' => $activity->getId(),
'crm_object' => $crmObject->value,
]);
return;
}
if (! in_array($crmObject, self::SUPPORTED_OBJECTS, true)) {
$this->logger->debug('[RematchActivityOnCrmObjectDetach] Skipping rematch for CRM object type', [
'activity' => $activity->getId(),
'crm_object' => $crmObject->value,
]);
return;
}
if ($activity->isTypeConference() &&
! in_array($activity->getStatus(), Activity::FINITE_STATES_CONFERENCE, true)
) {
$this->logger
->info('[RematchActivityOnCrmObjectDetach] Skipping rematch for non-finite conference activity', [
'activity' => $activity->getId(),
'crm_object' => $crmObject->value,
]);
return;
}
$this->logger->info('[RematchActivityOnCrmObjectDetach] Try to match new crm data for deleted object', [
'activity' => $activity->getId(),
'crm_object' => $crmObject->value,
]);
Bus::chain([
new MatchActivityCrmData(
activityId: $activity->getId(),
fromConfiguration: null,
remoteSearch: false,
),
new CheckAndRetryRemoteMatch(
activityId: $activity->getId(),
crmObject: $crmObject,
),
])->dispatch();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
35
1
33
63
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
68730
|
|
55434
|
1195
|
19
|
2026-04-20T09:49:51.295384+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-20/1776 /Users/lukas/.screenpipe/data/data/2026-04-20/1776678591295_m1.jpg...
|
PhpStorm
|
faVsco.js – OpportunitySyncTrait.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
It's the only usage in Project Files
Find Opti It's the only usage in Project Files
Find Options… (⌃⌥⌘N)
text/html
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
#11976 on JY-20553-debug-crm-sync-delays, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
33
2
19
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot\ServiceTraits;
use Carbon\Carbon;
use HubSpot\Client\Crm\Deals\Model\CollectionResponseAssociatedId;
use Jiminny\Exceptions\InvalidArgumentException;
use Jiminny\Models\Account;
use Exception;
use Jiminny\Component\DealInsights\Forecast\Forecast;
use Jiminny\Jobs\Crm\MatchActivitiesToNewOpportunity;
use Jiminny\Models\Contact;
use Jiminny\Models\Crm\BusinessProcess;
use Jiminny\Exceptions\CrmException;
use Jiminny\Models\Opportunity;
use Illuminate\Support\Collection;
use Jiminny\Models\Stage;
use Jiminny\Repositories\Crm\CrmEntityRepository;
use Jiminny\Services\Crm\Hubspot\DealFieldsService;
use Jiminny\Services\Crm\Hubspot\OpportunitySyncStrategy\HubspotSingleSyncStrategy;
use Jiminny\Services\Crm\Hubspot\WebhookSyncBatchProcessor;
use Jiminny\Services\Crm\OpportunitySyncStrategyResolver;
use Jiminny\Utils\CurrencyFormatter;
/**
* Optimized sync methods for better performance
* These methods can be integrated into SyncCrmEntitiesTrait for significant performance gains
*/
trait OpportunitySyncTrait
{
private const int BATCH_SIZE = 100;
private const int BATCH_PROCESS_SIZE = 800;
protected OpportunitySyncStrategyResolver $opportunitySyncStrategyResolver;
protected CrmEntityRepository $crmEntityRepository;
protected DealFieldsService $dealFieldsService;
private ?array $cachedClosedDealStages = null;
private array $cachedBusinessProcesses = [];
private array $cachedStages = [];
public function syncOpportunities(array $parameters, ?string $strategy = null): int
{
$startTime = microtime(true);
$strategies = $this->opportunitySyncStrategyResolver->getStrategies($this->config, $strategy);
$parameters['config'] = $this->config;
$syncCount = 0;
$reportedTotal = 0;
$lastSyncedId = [];
$strategyNames = [];
try {
foreach ($strategies as $strategyName => $syncStrategy) {
$strategyNames[] = $strategyName;
$this->logger->info(
'[' . $this->getDisplayName() . '] Syncing opportunities using strategy: ' . $strategyName,
['team' => $this->team->getId()]
);
$total = 0;
$lastId = null;
$buffer = [];
// HubspotWebhookBatchSyncStrategy returns empty generator, this is for other strategies
foreach ($syncStrategy->fetchOpportunities($parameters, $total, $lastId) as $hsOpportunity) {
$buffer[] = $hsOpportunity;
// process every 800 rows (fits < 1 000 association limit)
if (\count($buffer) >= self::BATCH_PROCESS_SIZE) {
$syncCount += $this->processOpportunityBatch($buffer);
$buffer = [];
}
}
// leftovers
if ($buffer) {
$syncCount += $this->processOpportunityBatch($buffer);
}
$reportedTotal += $total;
$lastSyncedId = $lastId;
}
} catch (\HubSpot\Client\Crm\Deals\ApiException | CrmException $e) {
$this->handleSyncException($e, $parameters);
}
$durationMs = round((microtime(true) - $startTime) * 1000, 2);
$this->logger->info(
'[HubSpot] Synced opportunities',
[
'team' => $this->team->getId(),
'strategies' => implode(',', $strategyNames),
'sync_count' => $syncCount,
'total' => $reportedTotal,
'last_synced_id' => $lastSyncedId,
'duration_ms' => $durationMs,
]
);
return $reportedTotal;
}
private function handleSyncException(\Throwable $e, array $parameters): void
{
if (($parameters['since'] ?? null) instanceof Carbon) {
$parameters['since'] = $parameters['since']->toDateTimeString();
}
$parameters['config'] = $this->config->getId();
$this->logger->warning('[' . $this->getDisplayName() . '] Sync opportunities failed', [
'teamId' => $this->team->getUuid(),
'parameters' => $parameters,
'reason' => $e->getMessage(),
]);
}
/**
* @inheritdoc
*/
public function syncOpportunity(string $crmId): ?Opportunity
{
$strategy = $this->opportunitySyncStrategyResolver->resolve(
$this->config,
OpportunitySyncStrategyResolver::SINGLE_SYNC_OPPORTUNITY_STRATEGY,
);
$parameters = [
'config' => $this->config,
'crm_id' => $crmId,
];
try {
if (! $strategy instanceof HubspotSingleSyncStrategy) {
throw new InvalidArgumentException('Strategy must by HubspotSingleSyncStrategy');
}
$hsOpportunity = $strategy->fetchOpportunity($parameters);
} catch (\HubSpot\Client\Crm\Deals\ApiException $e) {
$this->logger->info('[' . $this->getDisplayName() . '] Opportunity not found', [
'teamId' => $this->team->getUuid(),
'crmId' => $crmId,
'reason' => $e->getMessage(),
]);
return null;
}
$hsOpportunity['associations'] = $this->convertDealAssociations($hsOpportunity['associations'] ?? []);
return $this->importOrUpdateOpportunity($hsOpportunity);
}
/**
* Process webhook-collected opportunity batches.
*
* Drains Redis sets containing company CRM IDs collected from webhook events
* and dispatches ImportOpportunityBatch jobs for batch processing.
*
* @return int Number of opportunity IDs dispatched to jobs
*/
public function batchSyncOpportunities(): int
{
$configId = $this->team->getCrmConfiguration()->getId();
return $this->batchProcessor->processBatchesForObjectType(
WebhookSyncBatchProcessor::OBJECT_TYPE_DEAL,
$configId
);
}
/**
* Import a batch of opportunities by their CRM IDs.
* Fetches opportunity data from HubSpot API and delegates to importOpportunityBatch().
*
* @param array<string> $crmIds HubSpot deal CRM IDs
*
* @return array{success: array, failed_ids: array, errors?: array<string, string>}
*/
public function importOpportunityBatchByIds(array $crmIds): array
{
$fields = $this->dealFieldsService->getFieldsForConfiguration($this->config);
$allDeals = [];
foreach (array_chunk($crmIds, self::BATCH_SIZE) as $chunk) {
$deals = $this->client->getOpportunitiesByIds($chunk, $fields);
foreach ($deals as $deal) {
$allDeals[] = $deal;
}
}
// IDs not returned by HubSpot are likely deleted or inaccessible deals.
// These are not failures — retrying won't bring them back.
$fetchedIds = array_map('strval', array_column($allDeals, 'id'));
$notFoundIds = array_values(array_diff(array_map('strval', $crmIds), $fetchedIds));
if (! empty($notFoundIds)) {
$this->logger->info('[' . $this->getDisplayName() . '] CRM IDs not found in HubSpot (likely deleted)', [
'teamId' => $this->team->getId(),
'notFoundCount' => \count($notFoundIds),
'notFoundIds' => $notFoundIds,
'requestedCount' => \count($crmIds),
'fetchedCount' => \count($allDeals),
]);
}
if (empty($allDeals)) {
return ['success' => [], 'failed_ids' => []];
}
return $this->importOpportunityBatch($allDeals);
}
private function getClosedDealStages(): array
{
if ($this->cachedClosedDealStages !== null) {
return $this->cachedClosedDealStages;
}
$stages = $this->crmEntityRepository->getOpportunityClosedStages($this->config);
$data = [
'lost' => [],
'won' => [],
];
foreach ($stages as $stage) {
if ($stage->probability == 0.00) {
$data['lost'][] = $stage->crm_provider_id;
}
if ($stage->probability == 100.00) {
$data['won'][] = $stage->crm_provider_id;
}
}
$this->cachedClosedDealStages = $data;
return $data;
}
/**
* Import deals into the database with pre-fetched associations.
*
* API calls here (getAssociationsData, getExistingOpportunityCrmIds) are NOT
* caught — if they throw, the exception propagates to ImportOpportunityBatch::handle()
* where Laravel retries the whole job with backoff. After all retries exhausted,
* failed() requeues all IDs to Redis.
*
* The per-deal loop catches exceptions individually. A deal can end up in three states:
* - success: imported/updated successfully
* - failed_ids: exception thrown (DB constraint violation, corrupt data, etc.)
* These are permanent issues — retrying won't fix them.
* - skipped (null): missing dependencies (no account, unknown pipeline/stage).
* This is acceptable — the deal cannot be imported until those exist.
*/
private function importOpportunityBatch(array $deals): array
{
$syncedOpportunities = [
'success' => [],
'failed_ids' => [],
];
$dealIds = array_column($deals, 'id');
// Shared association/existing-ID preparation is batch-level state. If it fails, rethrow so the
// queue job retries the whole batch and eventually requeues all deal IDs back to Redis.
try {
$companyAssociations = $this->client->getAssociationsData($dealIds, 'deals', 'companies');
$contactAssociations = $this->client->getAssociationsData($dealIds, 'deals', 'contacts');
$associationsData = $this->prepareAssociatedEntities($companyAssociations, $contactAssociations);
$existingCrmIds = $this->crmEntityRepository->getExistingOpportunityCrmIds(
$this->config,
array_map('strval', $dealIds)
);
$existingCrmIdSet = array_flip($existingCrmIds);
} catch (\Throwable $e) {
$this->logger->error('[' . $this->getDisplayName() . '] Failed to fetch associations or existing IDs', [
'teamId' => $this->team->getId(),
'dealCount' => count($dealIds),
'error' => $e->getMessage(),
]);
throw $e;
}
foreach ($deals as $deal) {
try {
$deal['associations'] = $this->prepareAssociationsForOpportunity(
$deal['id'],
$companyAssociations,
$contactAssociations,
$associationsData
);
$syncedOpportunity = $this->importOrUpdateOpportunity(
$deal,
isset($existingCrmIdSet[(string) $deal['id']])
);
if ($syncedOpportunity) {
$syncedOpportunities['success'][] = $syncedOpportunity;
}
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Failed to import opportunity', [
'teamId' => $this->team->getId(),
'crmId' => $deal['id'],
'error' => $e->getMessage(),
]);
$syncedOpportunities['failed_ids'][] = $deal['id'];
$syncedOpportunities['errors'][$deal['id']] = $e->getMessage();
}
}
return $syncedOpportunities;
}
/**
* Prepare associated entities for opportunities with optimized batch processing
* Returns structured data with CRM ID to DB ID mappings for each opportunity
*/
private function prepareAssociatedEntities(array $companyAssociations, array $contactAssociations): array
{
// Step 1: Collect all unique company and contact IDs from associations
$allCompanyIds = $this->flattenAssociationIds($companyAssociations);
$allContactIds = $this->flattenAssociationIds($contactAssociations);
// Step 2: Batch sync missing entities and get CRM ID to DB ID mappings
$companyIdMappings = [];
$contactIdMappings = [];
if (! empty($allCompanyIds)) {
$companyIdMappings = $this->prepareAssociatedAccounts($allCompanyIds);
}
if (! empty($allContactIds)) {
$contactIdMappings = $this->prepareAssociatedContacts($allContactIds);
}
return [
'company_id_mappings' => $companyIdMappings,
'contact_id_mappings' => $contactIdMappings,
];
}
/**
* Flatten association data to get unique IDs
*/
private function flattenAssociationIds(array $associations): array
{
$ids = [];
foreach ($associations as $dealAssociations) {
if (is_array($dealAssociations)) {
foreach ($dealAssociations as $id) {
$ids[$id] = true;
}
}
}
return array_keys($ids);
}
/**
* Batch sync missing accounts
*/
private function prepareAssociatedAccounts(array $companyIds): array
{
// Find which accounts already exist
$existingAccounts = $this->crmEntityRepository
->findAccountsByExternalIds($this->config, $companyIds);
$existingCompanyIds = $existingAccounts->pluck('crm_provider_id')->toArray();
$existingAccountsData = $existingAccounts->mapWithKeys(function ($account) {
return [$account->getCrmProviderId() => $account->getId()];
})->toArray();
$missingCompanyIds = array_diff($companyIds, $existingCompanyIds);
if (empty($missingCompanyIds)) {
return $existingAccountsData;
}
$this->logger->info('[' . $this->getDisplayName() . '] Batch syncing missing accounts', [
'teamId' => $this->team->getUuid(),
'total_companies' => count($companyIds),
'existing_companies' => count($existingCompanyIds),
'missing_companies' => count($missingCompanyIds),
]);
// we already have limit on opportunity ids count
// Initialize variable before try block
$syncedAccountsData = [];
try {
$syncedAccountsData = $this->batchSyncCrmObjects('companies', $missingCompanyIds);
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Failed to sync missing accounts', [
'size' => count($missingCompanyIds),
'error' => $e->getMessage(),
]);
$syncedAccountsData = [];
}
return $existingAccountsData + $syncedAccountsData;
}
/**
* Prepare associated contacts - find existing and sync missing ones
* Returns mapping of CRM ID to DB ID
*/
private function prepareAssociatedContacts(array $contactIds): array
{
// Find which contacts already exist
$existingContacts = $this->crmEntityRepository
->findContactsByExternalIds($this->config, $contactIds);
$existingContactIds = $existingContacts->pluck('crm_provider_id')->toArray();
// Create mapping for existing contacts
$existingContactsData = $existingContacts->mapWithKeys(function ($contact) {
return [$contact->getCrmProviderId() => $contact->getId()];
})->toArray();
$missingContactIds = array_diff($contactIds, $existingContactIds);
if (empty($missingContactIds)) {
return $existingContactsData;
}
$this->logger->info('[' . $this->getDisplayName() . '] Batch syncing missing contacts', [
'teamId' => $this->team->getUuid(),
'total_contacts' => count($contactIds),
'existing_contacts' => count($existingContactIds),
'missing_contacts' => count($missingContactIds),
]);
// Sync missing contacts using batch API
try {
$syncedContactsData = $this->batchSyncCrmObjects('contacts', $missingContactIds);
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Failed to sync missing contacts', [
'size' => count($missingContactIds),
'error' => $e->getMessage(),
]);
$syncedContactsData = [];
}
return $existingContactsData + $syncedContactsData;
}
private function batchSyncCrmObjects(string $objectType, array $crmIds): array
{
$syncObjects = [];
$crmObjectIds = array_values($crmIds);
foreach (array_chunk($crmObjectIds, self::BATCH_SIZE) as $chunk) {
try {
$objects = $objectType === 'companies' ?
$this->client->getCompaniesByIds($chunk, $this->getCompanyFields()) :
$this->client->getContactsByIds($chunk, $this->getContactFields());
foreach ($objects as $objectId => $objectData) {
$this->importCrmObject($objectType, (string) $objectId, $objectData, $syncObjects);
}
$this->logger->info('[' . $this->getDisplayName() . '] Batch synced ' . $objectType, [
'requested_count' => count($chunk),
'synced_count' => count($objects),
]);
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Batch ' . $objectType . ' sync failed', [
'ids' => $chunk,
'error' => $e->getMessage(),
]);
}
}
return $syncObjects;
}
private function importCrmObject(string $objectType, string $objectId, mixed $objectData, array &$syncObjects): void
{
try {
$object = $objectType === 'companies' ?
$this->importAccount($objectData) :
$this->importContact($objectData);
if ($object) {
$syncObjects[$object->getCrmProviderId()] = $object->getId();
}
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Failed to import batch ' . $objectType, [
'id' => $objectId,
'error' => $e->getMessage(),
]);
}
}
/**
* Prepare associations for a single opportunity
*
* The return value is an array with the following structure:
* [
* 'companies' => [
* $companyCrmId => $companyId,
* ...
* ],
* 'contacts' => [
* $contactCrmId => $contactId,
* ...
* ],
* 'account_id' => $accountId,
* ]
*/
private function prepareAssociationsForOpportunity(
string $oppCrmId,
array $companyAssociations,
array $contactAssociations,
array $associationsData
): array {
$associations = [
'companies' => [],
'contacts' => [],
'account_id' => null, // Primary account for opportunity
];
$oppCompanyIds = $companyAssociations[$oppCrmId] ?? [];
foreach ($oppCompanyIds as $companyCrmId) {
if (isset($associationsData['company_id_mappings'][$companyCrmId])) {
$associations['companies'][$companyCrmId] = $associationsData['company_id_mappings'][$companyCrmId];
// Set primary account (first company becomes primary account)
if ($associations['account_id'] === null) {
$associations['account_id'] = $associationsData['company_id_mappings'][$companyCrmId];
}
}
}
$oppContactIds = $contactAssociations[$oppCrmId] ?? [];
foreach ($oppContactIds as $contactCrmId) {
if (isset($associationsData['contact_id_mappings'][$contactCrmId])) {
$associations['contacts'][$contactCrmId] = $associationsData['contact_id_mappings'][$contactCrmId];
}
}
return $associations;
}
/**
* Update only associations for an opportunity
*/
private function updateOpportunityAssociations(Opportunity $opportunity, array $associations): void
{
// Update contact associations
$this->importOpportunityContacts($opportunity, $associations['contacts']);
// Update company (account) associations
$this->updateOpportunityAccount($opportunity, $associations['account_id']);
}
/**
* Remove all contact associations from an opportunity
*/
private function removeAllOpportunityContacts(Opportunity $opportunity): void
{
$currentCount = (int) $opportunity->contacts()->count();
if ($currentCount > 0) {
$opportunity->contacts()->detach();
$this->logger->info('[' . $this->getDisplayName() . '] Removed all contact associations', [
'opportunity_id' => $opportunity->getId(),
'removed_count' => $currentCount,
]);
}
}
private function updateOpportunityAccount(Opportunity $opportunity, ?int $accountId): void
{
if ($accountId === null) {
// No account ID provided - keep current account
return;
}
$currentAccountId = $opportunity->getAccountId();
// Only update if account has changed
if ($currentAccountId !== $accountId) {
$opportunity->account_id = $accountId;
$opportunity->save();
$this->logger->info('[' . $this->getDisplayName() . '] Updated opportunity account association', [
'opportunity_id' => $opportunity->getId(),
'old_account_id' => $currentAccountId,
'new_account_id' => $accountId,
]);
}
}
/**
* Find existing opportunities by external IDs (OPTIMIZED VERSION)
* Uses batch query for better performance
*/
private function findExistingOpportunities(array $crmIds): Collection
{
return $this->crmEntityRepository
->findOpportunitiesByExternalIds($this->config, $crmIds);
}
private function processOpportunityBatch(array $opportunities): int
{
$syncedOpportunities = $this->importOpportunityBatch($opportunities);
return count($syncedOpportunities['success'] ?? []);
}
/**
* Convert single deal associations from HubSpot format to internal format
* Handles both HubSpot SDK objects and array formats
*
* @param array $opportunityAssociations Raw associations from HubSpot API or pre-processed
*
* @return array Processed associations with DB IDs
*/
private function convertDealAssociations(array $opportunityAssociations): array
{
$associations = $this->initializeAssociationsStructure();
if (empty($opportunityAssociations)) {
return $associations;
}
$associationIds = $this->extractAssociationIds($opportunityAssociations);
$this->processCompanyAssociations($associationIds, $associations);
$this->processContactAssociations($associationIds, $associations);
return $associations;
}
private function initializeAssociationsStructure(): array
{
return [
'companies' => [],
'contacts' => [],
'account_id' => null, // Primary account for opportunity
];
}
private function extractAssociationIds(array $opportunityAssociations): array
{
$associationIds = [];
foreach ($opportunityAssociations as $type => $associationData) {
if (! empty($associationData)) {
$associationIds[$type] = $this->convertSingleDealAssociations($associationData);
}
}
return $associationIds;
}
private function processCompanyAssociations(array $associationIds, array &$associations): void
{
if (empty($associationIds['companies'])) {
return;
}
$companyId = $associationIds['companies'][0];
$account = $this->findOrSyncAccount($companyId);
if ($account instanceof Account) {
$associations['companies'][$companyId] = $account->getId();
$associations['account_id'] = $account->getId();
}
}
private function processContactAssociations(array $associationIds, array &$associations): void
{
if (empty($associationIds['contacts'])) {
return;
}
foreach ($associationIds['contacts'] as $contactId) {
$contact = $this->findOrSyncContact($contactId);
if ($contact instanceof Contact) {
$associations['contacts'][$contactId] = $contact->getId();
}
}
}
private function findOrSyncAccount(string $companyId): ?Account
{
$account = $this->crmEntityRepository->findAccountByExternalId($this->config, $companyId);
if (! $account instanceof Account) {
$account = $this->syncAccount($companyId);
}
return $account;
}
private function findOrSyncContact(string $contactId): ?Contact
{
$contact = $this->crmEntityRepository->findContactByExternalId($this->config, $contactId);
if (! $contact instanceof Contact) {
$contact = $this->syncContact($contactId);
}
return $contact;
}
private function convertSingleDealAssociations($opportunityAssociations = null): array
{
$associationData = [];
if ($opportunityAssociations === null) {
return $associationData;
}
// Handle array input (from extractAssociationIds)
if (is_array($opportunityAssociations)) {
return $opportunityAssociations;
}
// Handle CollectionResponseAssociatedId object
if ($opportunityAssociations instanceof CollectionResponseAssociatedId) {
foreach ($opportunityAssociations->getResults() as $association) {
$associationData[] = $association->getId();
}
}
return $associationData;
}
private function importOrUpdateOpportunity($crmData, ?bool $exists = null): ?Opportunity
{
if (empty($crmData['properties'])) {
return null;
}
$crmId = (string) $crmData['id'];
$properties = $crmData['properties'];
$associations = $crmData['associations'] ?? [];
$opportunityExists = $exists ?? (bool) $this->crmEntityRepository->findOpportunityByExternalId(
$this->config,
$crmId
);
if ($opportunityExists) {
return $this->updateOpportunity($crmId, $properties, $associations);
}
return $this->createOpportunity($crmId, $properties, $associations);
}
/**
* Create new opportunity
*/
private function createOpportunity(string $crmId, array $properties, array $associations): ?Opportunity
{
$accountId = $this->resolveAccountId($associations);
if (! $accountId) {
return null;
}
$businessProcess = $this->resolveBusinessProcess($properties['pipeline'] ?? null);
if (! $businessProcess) {
return null;
}
$stage = $this->resolveStage($businessProcess, $properties['dealstage'] ?? null);
if (! $stage) {
return null;
}
$data = $this->buildOpportunityData($properties, $accountId, $businessProcess, $stage);
$attributes = [
'crm_configuration_id' => $this->config->getId(),
'crm_provider_id' => $crmId,
];
$values = array_merge($attributes, $data);
$opportunity = $this->crmEntityRepository->upsertOpportunity($attributes, $values);
$this->importExternalFieldData($properties, $opportunity->getId());
$this->importOpportunityContacts($opportunity, $associations['contacts']);
if ($opportunity->wasRecentlyCreated) {
MatchActivitiesToNewOpportunity::dispatch($opportunity->getId());
}
return $opportunity;
}
/**
* Update existing opportunity
*/
private function updateOpportunity(string $crmId, array $properties, array $associations): Opportunity
{
$accountId = $this->resolveAccountId($associations);
$businessProcess = $this->resolveBusinessProcess($properties['pipeline'] ?? null);
$stage = $businessProcess ? $this->resolveStage($businessProcess, $properties['dealstage'] ?? null) : null;
$data = $this->buildOpportunityData($properties, $accountId, $businessProcess, $stage);
$attributes = [
'crm_configuration_id' => $this->config->getId(),
'crm_provider_id' => $crmId,
];
$values = array_merge($attributes, $data);
$opportunity = $this->crmEntityRepository->upsertOpportunity($attributes, $values);
$this->importExternalFieldData($properties, $opportunity->getId());
$this->updateOpportunityAssociations($opportunity, $associations);
return $opportunity;
}
private function resolveAccountId(array $associations): ?int
{
if (! empty($associations['account_id'])) {
return $associations['account_id'];
}
if (empty($associations)) {
return null;
}
// Fallback: use first company as account (currently SDK returns one company)
foreach ($associations['companies'] as $accountId) {
return $accountId;
}
return null;
}
private function buildOpportunityData(
array $properties,
?int $accountId,
?BusinessProcess $businessProcess,
?Stage $stage
): array {
$ownerId = null;
$profile = null;
if (! empty($properties['hubspot_owner_id'])) {
$ownerId = $properties['hubspot_owner_id'];
$profile = $this->crmEntityRepository->findProfileByExternalId($this->config, (string) $ownerId);
}
$name = 'Unknown';
if (isset($properties['dealname'])) {
$name = mb_strimwidth($properties['dealname'], 0, 128);
}
$amount = $this->resolveAmount($properties);
$currency = $properties['deal_currency_code'] ?? null;
$closeDate = null;
if (! empty($properties['closedate'])) {
$closeDate = Carbon::parse($properties['closedate'])->format('Y-m-d');
}
$remotelyCreatedAt = null;
if (! empty($properties['createdate']) && strtotime($properties['createdate'])) {
$date = $this->parseCleanDatetime($properties['createdate']);
$remotelyCreatedAt = $date?->format('Y-m-d H:i:s');
}
$closedStages = $this->getClosedDealStages();
$isWon = in_array($properties['dealstage'], $closedStages['won']);
$isLost = in_array($properties['dealstage'], $closedStages['lost']);
$data = [
'team_id' => $this->team->getId(),
'user_id' => $profile ? $profile->user_id : null,
'owner_id' => $ownerId,
'name' => $name,
'value' => ! empty($amount) ? $amount : null,
'currency_code' => CurrencyFormatter::formatCode($currency),
'close_date' => $closeDate,
'is_closed' => $isWon || $isLost,
'is_won' => $isWon,
'remotely_created_at' => $remotelyCreatedAt,
'probability' => $this->resolveDealProbability($properties['hs_deal_stage_probability']),
'forecast_category' => $this->resolveForecastCategory($properties['hs_manual_forecast_category']),
];
if ($accountId) {
$data['account_id'] = $accountId;
}
if ($stage) {
$data['stage_id'] = $stage->id;
}
if ($businessProcess) {
$recordType = $this->crmEntityRepository->getBusinessProcessRecordType($businessProcess);
if ($recordType) {
$data['record_type_id'] = $recordType->id;
}
}
return $data;
}
private function resolveBusinessProcess(?string $pipelineId): ?BusinessProcess
{
if ($pipelineId === null) {
return null;
}
$cacheKey = $this->getBusinessProcessCacheKey($pipelineId);
if (isset($this->cachedBusinessProcesses[$cacheKey])) {
return $this->cachedBusinessProcesses[$cacheKey];
}
$businessProcess = $this->getBusinessProcess($pipelineId);
if (! $businessProcess instanceof BusinessProcess) {
$this->importStages();
$businessProcess = $this->getBusinessProcess($pipelineId);
}
if (! $businessProcess instanceof BusinessProcess) {
$this->logger->info(
'[HubSpot] Deal is not attached to a pipeline',
[
'pipeline' => $pipelineId]
);
}
$this->cachedBusinessProcesses[$cacheKey] = $businessProcess;
return $businessProcess;
}
private function getBusinessProcess(string $pipelineId): ?BusinessProcess
{
return $this->crmEntityRepository->findBusinessProcessesByExternalId($this->config, $pipelineId);
}
private function getBusinessProcessCacheKey(string $pipelineId): string
{
return $this->config->getId() . '_' . $pipelineId;
}
private function resolveStage(BusinessProcess $businessProcess, ?string $stageId): ?Stage
{
if (empty($stageId)) {
return null;
}
$cacheKey = $businessProcess->getId() . ':' . $stageId;
if (isset($this->cachedStages[$cacheKey])) {
return $this->cachedStages[$cacheKey];
}
$stage = $this->crmEntityRepository->getPipelineStageByConditions(
$businessProcess,
[
'crm_provider_id' => $stageId,
'type' => Stage::TYPE_OPPORTUNITY,
]
);
if ($stage === null) {
$this->importStages(null, $stageId);
}
if ($stage === null) {
$this->logger->info('[HubSpot] Stage does not exist => ' . $stageId);
}
$this->cachedStages[$cacheKey] = $stage;
return $stage;
}
private function resolveAmount(array $properties): ?string
{
$amount = null;
if (! empty($properties['amount'])) {
$amount = str_replace(',', '', $properties['amount']);
}
if ($this->config->hasDefaultCurrencyFieldSet()) {
$valueFieldName = $this->config->getDefaultCurrencyField()->getCrmProviderId();
$amount = $properties[$valueFieldName] ?? $amount;
}
return $amount;
}
private function parseCleanDatetime(string $datetime): ?Carbon
{
// Treat pre-1980 values as invalid
$minValidDate = Carbon::parse('1980-01-01 00:00:00');
try {
$date = Carbon::parse($datetime);
if ($minValidDate->gt($date)) {
return null;
}
return $date;
} catch (Exception) {
return null; // On parse error, treat as null
}
}
private function resolveDealProbability(?string $stageProbability): int
{
if ($stageProbability === null) {
return 0;
}
$probability = (float) $stageProbability;
return $probability > 1 ? 0 : (int) ($probability * 100);
}
private function resolveForecastCategory(?string $forecastCategory): string
{
if (! $forecastCategory) {
return Forecast::FORECAST_CATEGORY_UNCATEGORIZED;
}
$forecastCategory = str_replace('_', ' ', $forecastCategory);
return ucwords(strtolower($forecastCategory));
}
private function importExternalFieldData(array $properties, int $opportunityId): void
{
$crmFields = $this->getOpportunitySyncableFields();
$this->importOpportunityCrmFieldData($properties, $crmFields, $opportunityId);
}
private function importOpportunityContacts(Opportunity $opportunity, array $associations): void
{
// Handle empty or missing contact associations
if (empty($associations)) {
// Remove all existing contact associations if none provided
$this->removeAllOpportunityContacts($opportunity);
return;
}
// Use differential sync approach for better performance and accuracy
$this->syncOpportunityContactsDifferential($opportunity, $associations);
}
/**
* Sync opportunity contacts using differential approach
* This compares current vs new associations and only makes necessary changes
*/
private function syncOpportunityContactsDifferential(Opportunity $opportunity, array $contactAssociations): void
{
$currentContactCrmIds = $this->getCurrentContactCrmIds($opportunity);
$contactAssociationIds = array_keys($contactAssociations);
$contactsToAdd = array_diff($contactAssociationIds, $currentContactCrmIds);
$contactsToRemove = array_diff($currentContactCrmIds, $contactAssociationIds);
if (empty($contactsToAdd) && empty($contactsToRemove)) {
return;
}
$this->logContactAssociationChanges($opportunity, $currentContactCrmIds, $contactAssociations, $contactsToAdd, $contactsToRemove);
$this->removeContactAssociations($opportunity, $contactsToRemove);
$this->addContactAssociations($opportunity, $contactsToAdd, $contactAssociations);
}
private function getCurrentContactCrmIds(Opportunity $opportunity): array
{
return $opportunity->contacts()
->pluck('contacts.crm_provider_id')
->toArray();
}
private function logContactAssociationChanges(
Opportunity $opportunity,
array $currentContactCrmIds,
array $contactAssociations,
array $contactsToAdd,
array $contactsToRemove
): void {
$this->logger->info('[' . $this->getDisplayName() . '] Contact association changes', [
'opportunity_id' => $opportunity->getId(),
'current_contacts' => $currentContactCrmIds,
'new_contacts' => $contactAssociations,
'contacts_to_add' => $contactsToAdd,
'contacts_to_remove' => $contactsToRemove,
]);
}
private function removeContactAssociations(Opportunity $opportunity, array $contactsToRemove): void
{
if (empty($contactsToRemove)) {
return;
}
$contactsToDetach = $opportunity->contacts()
->whereIn('contacts.crm_provider_id', $contactsToRemove)
->pluck('contacts.id')
->toArray();
if (! empty($contactsToDetach)) {
$opportunity->contacts()->detach($contactsToDetach);
$this->logger->info('[' . $this->getDisplayName() . '] Removed contact associations', [
'opportunity_id' => $opportunity->getId(),
'removed_contact_crm_ids' => $contactsToRemove,
'removed_contact_count' => count($contactsToDetach),
]);
}
}
private function addContactAssociations(Opportunity $opportunity, array $contactsToAdd, array $contactAssociations): void
{
if (empty($contactsToAdd)) {
return;
}
$contactsAdded = [];
foreach ($contactsToAdd as $crmId) {
$id = $contactAssociations[$crmId];
if ($this->attachSingleContact($opportunity, (string) $crmId, $id)) {
$contactsAdded[] = $crmId;
}
}
$this->logAddedContacts($opportunity, $contactsAdded);
}
private function attachSingleContact(Opportunity $opportunity, string $crmId, int $id): bool
{
try {
$contact = $this->crmEntityRepository->findContactByConfigurationAndId($this->config, $id);
if (! $contact) {
return false;
}
return $this->performContactAttachment($opportunity, $contact, $crmId);
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Failed to add contact association', [
'opportunity_id' => $opportunity->getId(),
'contact_crm_id' => $crmId,
'error' => $e->getMessage(),
]);
return false;
}
}
private function performContactAttachment(Opportunity $opportunity, Contact $contact, string $crmId): bool
{
try {
$opportunity->contacts()->attach($contact->getId(), [
'crm_provider_id' => $crmId,
]);
return true;
} catch (\Illuminate\Database\QueryException $e) {
if (str_contains($e->getMessage(), 'Duplicate entry')) {
$this->logger->info('[' . $this->getDisplayName() . '] Contact association already exists', [
'contact_id' => $contact->getId(),
'contact_crm_id' => $crmId,
'opportunity_id' => $opportunity->getId(),
]);
return false;
}
throw $e;
}
}
private function logAddedContacts(Opportunity $opportunity, array $contactsAdded): void
{
if (! empty($contactsAdded)) {
$this->logger->info('[' . $this->getDisplayName() . '] Added contact associations', [
'opportunity_id' => $opportunity->getId(),
'added_contact_crm_ids' => $contactsAdded,
'added_contacts_count' => count($contactsAdded),
]);
}
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Code changed:
Hide
Sync Changes
Hide This Notification
10
12
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 69;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_ca...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"It's the only usage in Project Files\nFind Options… (⌃⌥⌘N)","depth":2,"value":"It's the only usage in Project Files\nFind Options… (⌃⌥⌘N)","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11976 on JY-20553-debug-crm-sync-delays, menu","depth":5,"help_text":"Pull request #11976 exists for current branch JY-20553-debug-crm-sync-delays","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"RequestGenerateAskJiminnyReportJobTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"33","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Crm\\Hubspot\\ServiceTraits;\n\nuse Carbon\\Carbon;\nuse HubSpot\\Client\\Crm\\Deals\\Model\\CollectionResponseAssociatedId;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Models\\Account;\nuse Exception;\nuse Jiminny\\Component\\DealInsights\\Forecast\\Forecast;\nuse Jiminny\\Jobs\\Crm\\MatchActivitiesToNewOpportunity;\nuse Jiminny\\Models\\Contact;\nuse Jiminny\\Models\\Crm\\BusinessProcess;\nuse Jiminny\\Exceptions\\CrmException;\nuse Jiminny\\Models\\Opportunity;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Stage;\nuse Jiminny\\Repositories\\Crm\\CrmEntityRepository;\nuse Jiminny\\Services\\Crm\\Hubspot\\DealFieldsService;\nuse Jiminny\\Services\\Crm\\Hubspot\\OpportunitySyncStrategy\\HubspotSingleSyncStrategy;\nuse Jiminny\\Services\\Crm\\Hubspot\\WebhookSyncBatchProcessor;\nuse Jiminny\\Services\\Crm\\OpportunitySyncStrategyResolver;\nuse Jiminny\\Utils\\CurrencyFormatter;\n\n/**\n * Optimized sync methods for better performance\n * These methods can be integrated into SyncCrmEntitiesTrait for significant performance gains\n */\ntrait OpportunitySyncTrait\n{\n private const int BATCH_SIZE = 100;\n private const int BATCH_PROCESS_SIZE = 800;\n\n protected OpportunitySyncStrategyResolver $opportunitySyncStrategyResolver;\n protected CrmEntityRepository $crmEntityRepository;\n protected DealFieldsService $dealFieldsService;\n\n private ?array $cachedClosedDealStages = null;\n private array $cachedBusinessProcesses = [];\n private array $cachedStages = [];\n\n public function syncOpportunities(array $parameters, ?string $strategy = null): int\n {\n $startTime = microtime(true);\n $strategies = $this->opportunitySyncStrategyResolver->getStrategies($this->config, $strategy);\n $parameters['config'] = $this->config;\n $syncCount = 0;\n $reportedTotal = 0;\n $lastSyncedId = [];\n $strategyNames = [];\n\n try {\n foreach ($strategies as $strategyName => $syncStrategy) {\n $strategyNames[] = $strategyName;\n $this->logger->info(\n '[' . $this->getDisplayName() . '] Syncing opportunities using strategy: ' . $strategyName,\n ['team' => $this->team->getId()]\n );\n\n $total = 0;\n $lastId = null;\n $buffer = [];\n\n // HubspotWebhookBatchSyncStrategy returns empty generator, this is for other strategies\n foreach ($syncStrategy->fetchOpportunities($parameters, $total, $lastId) as $hsOpportunity) {\n $buffer[] = $hsOpportunity;\n\n // process every 800 rows (fits < 1 000 association limit)\n if (\\count($buffer) >= self::BATCH_PROCESS_SIZE) {\n $syncCount += $this->processOpportunityBatch($buffer);\n $buffer = [];\n }\n }\n\n // leftovers\n if ($buffer) {\n $syncCount += $this->processOpportunityBatch($buffer);\n }\n\n $reportedTotal += $total;\n $lastSyncedId = $lastId;\n }\n } catch (\\HubSpot\\Client\\Crm\\Deals\\ApiException | CrmException $e) {\n $this->handleSyncException($e, $parameters);\n }\n\n $durationMs = round((microtime(true) - $startTime) * 1000, 2);\n $this->logger->info(\n '[HubSpot] Synced opportunities',\n [\n 'team' => $this->team->getId(),\n 'strategies' => implode(',', $strategyNames),\n 'sync_count' => $syncCount,\n 'total' => $reportedTotal,\n 'last_synced_id' => $lastSyncedId,\n 'duration_ms' => $durationMs,\n ]\n );\n\n return $reportedTotal;\n }\n\n private function handleSyncException(\\Throwable $e, array $parameters): void\n {\n if (($parameters['since'] ?? null) instanceof Carbon) {\n $parameters['since'] = $parameters['since']->toDateTimeString();\n }\n $parameters['config'] = $this->config->getId();\n\n $this->logger->warning('[' . $this->getDisplayName() . '] Sync opportunities failed', [\n 'teamId' => $this->team->getUuid(),\n 'parameters' => $parameters,\n 'reason' => $e->getMessage(),\n ]);\n }\n\n /**\n * @inheritdoc\n */\n public function syncOpportunity(string $crmId): ?Opportunity\n {\n $strategy = $this->opportunitySyncStrategyResolver->resolve(\n $this->config,\n OpportunitySyncStrategyResolver::SINGLE_SYNC_OPPORTUNITY_STRATEGY,\n );\n\n $parameters = [\n 'config' => $this->config,\n 'crm_id' => $crmId,\n ];\n\n try {\n if (! $strategy instanceof HubspotSingleSyncStrategy) {\n throw new InvalidArgumentException('Strategy must by HubspotSingleSyncStrategy');\n }\n\n $hsOpportunity = $strategy->fetchOpportunity($parameters);\n } catch (\\HubSpot\\Client\\Crm\\Deals\\ApiException $e) {\n $this->logger->info('[' . $this->getDisplayName() . '] Opportunity not found', [\n 'teamId' => $this->team->getUuid(),\n 'crmId' => $crmId,\n 'reason' => $e->getMessage(),\n ]);\n\n return null;\n }\n\n $hsOpportunity['associations'] = $this->convertDealAssociations($hsOpportunity['associations'] ?? []);\n\n return $this->importOrUpdateOpportunity($hsOpportunity);\n }\n\n /**\n * Process webhook-collected opportunity batches.\n *\n * Drains Redis sets containing company CRM IDs collected from webhook events\n * and dispatches ImportOpportunityBatch jobs for batch processing.\n *\n * @return int Number of opportunity IDs dispatched to jobs\n */\n public function batchSyncOpportunities(): int\n {\n $configId = $this->team->getCrmConfiguration()->getId();\n\n return $this->batchProcessor->processBatchesForObjectType(\n WebhookSyncBatchProcessor::OBJECT_TYPE_DEAL,\n $configId\n );\n }\n\n /**\n * Import a batch of opportunities by their CRM IDs.\n * Fetches opportunity data from HubSpot API and delegates to importOpportunityBatch().\n *\n * @param array<string> $crmIds HubSpot deal CRM IDs\n *\n * @return array{success: array, failed_ids: array, errors?: array<string, string>}\n */\n public function importOpportunityBatchByIds(array $crmIds): array\n {\n $fields = $this->dealFieldsService->getFieldsForConfiguration($this->config);\n\n $allDeals = [];\n foreach (array_chunk($crmIds, self::BATCH_SIZE) as $chunk) {\n $deals = $this->client->getOpportunitiesByIds($chunk, $fields);\n foreach ($deals as $deal) {\n $allDeals[] = $deal;\n }\n }\n\n // IDs not returned by HubSpot are likely deleted or inaccessible deals.\n // These are not failures — retrying won't bring them back.\n $fetchedIds = array_map('strval', array_column($allDeals, 'id'));\n $notFoundIds = array_values(array_diff(array_map('strval', $crmIds), $fetchedIds));\n\n if (! empty($notFoundIds)) {\n $this->logger->info('[' . $this->getDisplayName() . '] CRM IDs not found in HubSpot (likely deleted)', [\n 'teamId' => $this->team->getId(),\n 'notFoundCount' => \\count($notFoundIds),\n 'notFoundIds' => $notFoundIds,\n 'requestedCount' => \\count($crmIds),\n 'fetchedCount' => \\count($allDeals),\n ]);\n }\n\n if (empty($allDeals)) {\n return ['success' => [], 'failed_ids' => []];\n }\n\n return $this->importOpportunityBatch($allDeals);\n }\n\n private function getClosedDealStages(): array\n {\n if ($this->cachedClosedDealStages !== null) {\n return $this->cachedClosedDealStages;\n }\n\n $stages = $this->crmEntityRepository->getOpportunityClosedStages($this->config);\n $data = [\n 'lost' => [],\n 'won' => [],\n ];\n\n foreach ($stages as $stage) {\n if ($stage->probability == 0.00) {\n $data['lost'][] = $stage->crm_provider_id;\n }\n if ($stage->probability == 100.00) {\n $data['won'][] = $stage->crm_provider_id;\n }\n }\n\n $this->cachedClosedDealStages = $data;\n\n return $data;\n }\n\n /**\n * Import deals into the database with pre-fetched associations.\n *\n * API calls here (getAssociationsData, getExistingOpportunityCrmIds) are NOT\n * caught — if they throw, the exception propagates to ImportOpportunityBatch::handle()\n * where Laravel retries the whole job with backoff. After all retries exhausted,\n * failed() requeues all IDs to Redis.\n *\n * The per-deal loop catches exceptions individually. A deal can end up in three states:\n * - success: imported/updated successfully\n * - failed_ids: exception thrown (DB constraint violation, corrupt data, etc.)\n * These are permanent issues — retrying won't fix them.\n * - skipped (null): missing dependencies (no account, unknown pipeline/stage).\n * This is acceptable — the deal cannot be imported until those exist.\n */\n private function importOpportunityBatch(array $deals): array\n {\n $syncedOpportunities = [\n 'success' => [],\n 'failed_ids' => [],\n ];\n $dealIds = array_column($deals, 'id');\n\n // Shared association/existing-ID preparation is batch-level state. If it fails, rethrow so the\n // queue job retries the whole batch and eventually requeues all deal IDs back to Redis.\n try {\n $companyAssociations = $this->client->getAssociationsData($dealIds, 'deals', 'companies');\n $contactAssociations = $this->client->getAssociationsData($dealIds, 'deals', 'contacts');\n\n $associationsData = $this->prepareAssociatedEntities($companyAssociations, $contactAssociations);\n\n $existingCrmIds = $this->crmEntityRepository->getExistingOpportunityCrmIds(\n $this->config,\n array_map('strval', $dealIds)\n );\n $existingCrmIdSet = array_flip($existingCrmIds);\n } catch (\\Throwable $e) {\n $this->logger->error('[' . $this->getDisplayName() . '] Failed to fetch associations or existing IDs', [\n 'teamId' => $this->team->getId(),\n 'dealCount' => count($dealIds),\n 'error' => $e->getMessage(),\n ]);\n\n throw $e;\n }\n\n foreach ($deals as $deal) {\n try {\n $deal['associations'] = $this->prepareAssociationsForOpportunity(\n $deal['id'],\n $companyAssociations,\n $contactAssociations,\n $associationsData\n );\n\n $syncedOpportunity = $this->importOrUpdateOpportunity(\n $deal,\n isset($existingCrmIdSet[(string) $deal['id']])\n );\n if ($syncedOpportunity) {\n $syncedOpportunities['success'][] = $syncedOpportunity;\n }\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Failed to import opportunity', [\n 'teamId' => $this->team->getId(),\n 'crmId' => $deal['id'],\n 'error' => $e->getMessage(),\n ]);\n $syncedOpportunities['failed_ids'][] = $deal['id'];\n $syncedOpportunities['errors'][$deal['id']] = $e->getMessage();\n }\n }\n\n return $syncedOpportunities;\n }\n\n /**\n * Prepare associated entities for opportunities with optimized batch processing\n * Returns structured data with CRM ID to DB ID mappings for each opportunity\n */\n private function prepareAssociatedEntities(array $companyAssociations, array $contactAssociations): array\n {\n // Step 1: Collect all unique company and contact IDs from associations\n $allCompanyIds = $this->flattenAssociationIds($companyAssociations);\n $allContactIds = $this->flattenAssociationIds($contactAssociations);\n\n // Step 2: Batch sync missing entities and get CRM ID to DB ID mappings\n $companyIdMappings = [];\n $contactIdMappings = [];\n\n if (! empty($allCompanyIds)) {\n $companyIdMappings = $this->prepareAssociatedAccounts($allCompanyIds);\n }\n\n if (! empty($allContactIds)) {\n $contactIdMappings = $this->prepareAssociatedContacts($allContactIds);\n }\n\n return [\n 'company_id_mappings' => $companyIdMappings,\n 'contact_id_mappings' => $contactIdMappings,\n ];\n }\n\n /**\n * Flatten association data to get unique IDs\n */\n private function flattenAssociationIds(array $associations): array\n {\n $ids = [];\n foreach ($associations as $dealAssociations) {\n if (is_array($dealAssociations)) {\n foreach ($dealAssociations as $id) {\n $ids[$id] = true;\n }\n }\n }\n\n return array_keys($ids);\n }\n\n /**\n * Batch sync missing accounts\n */\n private function prepareAssociatedAccounts(array $companyIds): array\n {\n // Find which accounts already exist\n $existingAccounts = $this->crmEntityRepository\n ->findAccountsByExternalIds($this->config, $companyIds);\n\n $existingCompanyIds = $existingAccounts->pluck('crm_provider_id')->toArray();\n\n $existingAccountsData = $existingAccounts->mapWithKeys(function ($account) {\n return [$account->getCrmProviderId() => $account->getId()];\n })->toArray();\n\n $missingCompanyIds = array_diff($companyIds, $existingCompanyIds);\n\n if (empty($missingCompanyIds)) {\n return $existingAccountsData;\n }\n\n $this->logger->info('[' . $this->getDisplayName() . '] Batch syncing missing accounts', [\n 'teamId' => $this->team->getUuid(),\n 'total_companies' => count($companyIds),\n 'existing_companies' => count($existingCompanyIds),\n 'missing_companies' => count($missingCompanyIds),\n ]);\n\n // we already have limit on opportunity ids count\n // Initialize variable before try block\n $syncedAccountsData = [];\n\n try {\n $syncedAccountsData = $this->batchSyncCrmObjects('companies', $missingCompanyIds);\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Failed to sync missing accounts', [\n 'size' => count($missingCompanyIds),\n 'error' => $e->getMessage(),\n ]);\n $syncedAccountsData = [];\n }\n\n return $existingAccountsData + $syncedAccountsData;\n }\n\n /**\n * Prepare associated contacts - find existing and sync missing ones\n * Returns mapping of CRM ID to DB ID\n */\n private function prepareAssociatedContacts(array $contactIds): array\n {\n // Find which contacts already exist\n $existingContacts = $this->crmEntityRepository\n ->findContactsByExternalIds($this->config, $contactIds);\n\n $existingContactIds = $existingContacts->pluck('crm_provider_id')->toArray();\n\n // Create mapping for existing contacts\n $existingContactsData = $existingContacts->mapWithKeys(function ($contact) {\n return [$contact->getCrmProviderId() => $contact->getId()];\n })->toArray();\n\n $missingContactIds = array_diff($contactIds, $existingContactIds);\n\n if (empty($missingContactIds)) {\n return $existingContactsData;\n }\n\n $this->logger->info('[' . $this->getDisplayName() . '] Batch syncing missing contacts', [\n 'teamId' => $this->team->getUuid(),\n 'total_contacts' => count($contactIds),\n 'existing_contacts' => count($existingContactIds),\n 'missing_contacts' => count($missingContactIds),\n ]);\n\n // Sync missing contacts using batch API\n try {\n $syncedContactsData = $this->batchSyncCrmObjects('contacts', $missingContactIds);\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Failed to sync missing contacts', [\n 'size' => count($missingContactIds),\n 'error' => $e->getMessage(),\n ]);\n $syncedContactsData = [];\n }\n\n return $existingContactsData + $syncedContactsData;\n }\n\n private function batchSyncCrmObjects(string $objectType, array $crmIds): array\n {\n $syncObjects = [];\n $crmObjectIds = array_values($crmIds);\n\n foreach (array_chunk($crmObjectIds, self::BATCH_SIZE) as $chunk) {\n try {\n $objects = $objectType === 'companies' ?\n $this->client->getCompaniesByIds($chunk, $this->getCompanyFields()) :\n $this->client->getContactsByIds($chunk, $this->getContactFields());\n\n foreach ($objects as $objectId => $objectData) {\n $this->importCrmObject($objectType, (string) $objectId, $objectData, $syncObjects);\n }\n\n $this->logger->info('[' . $this->getDisplayName() . '] Batch synced ' . $objectType, [\n 'requested_count' => count($chunk),\n 'synced_count' => count($objects),\n ]);\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Batch ' . $objectType . ' sync failed', [\n 'ids' => $chunk,\n 'error' => $e->getMessage(),\n ]);\n }\n }\n\n return $syncObjects;\n }\n\n private function importCrmObject(string $objectType, string $objectId, mixed $objectData, array &$syncObjects): void\n {\n try {\n $object = $objectType === 'companies' ?\n $this->importAccount($objectData) :\n $this->importContact($objectData);\n\n if ($object) {\n $syncObjects[$object->getCrmProviderId()] = $object->getId();\n }\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Failed to import batch ' . $objectType, [\n 'id' => $objectId,\n 'error' => $e->getMessage(),\n ]);\n }\n }\n\n /**\n * Prepare associations for a single opportunity\n *\n * The return value is an array with the following structure:\n * [\n * 'companies' => [\n * $companyCrmId => $companyId,\n * ...\n * ],\n * 'contacts' => [\n * $contactCrmId => $contactId,\n * ...\n * ],\n * 'account_id' => $accountId,\n * ]\n */\n private function prepareAssociationsForOpportunity(\n string $oppCrmId,\n array $companyAssociations,\n array $contactAssociations,\n array $associationsData\n ): array {\n $associations = [\n 'companies' => [],\n 'contacts' => [],\n 'account_id' => null, // Primary account for opportunity\n ];\n\n $oppCompanyIds = $companyAssociations[$oppCrmId] ?? [];\n foreach ($oppCompanyIds as $companyCrmId) {\n if (isset($associationsData['company_id_mappings'][$companyCrmId])) {\n $associations['companies'][$companyCrmId] = $associationsData['company_id_mappings'][$companyCrmId];\n\n // Set primary account (first company becomes primary account)\n if ($associations['account_id'] === null) {\n $associations['account_id'] = $associationsData['company_id_mappings'][$companyCrmId];\n }\n }\n }\n\n $oppContactIds = $contactAssociations[$oppCrmId] ?? [];\n foreach ($oppContactIds as $contactCrmId) {\n if (isset($associationsData['contact_id_mappings'][$contactCrmId])) {\n $associations['contacts'][$contactCrmId] = $associationsData['contact_id_mappings'][$contactCrmId];\n }\n }\n\n return $associations;\n }\n\n /**\n * Update only associations for an opportunity\n */\n private function updateOpportunityAssociations(Opportunity $opportunity, array $associations): void\n {\n // Update contact associations\n $this->importOpportunityContacts($opportunity, $associations['contacts']);\n\n // Update company (account) associations\n $this->updateOpportunityAccount($opportunity, $associations['account_id']);\n }\n\n /**\n * Remove all contact associations from an opportunity\n */\n private function removeAllOpportunityContacts(Opportunity $opportunity): void\n {\n $currentCount = (int) $opportunity->contacts()->count();\n\n if ($currentCount > 0) {\n $opportunity->contacts()->detach();\n\n $this->logger->info('[' . $this->getDisplayName() . '] Removed all contact associations', [\n 'opportunity_id' => $opportunity->getId(),\n 'removed_count' => $currentCount,\n ]);\n }\n }\n\n private function updateOpportunityAccount(Opportunity $opportunity, ?int $accountId): void\n {\n if ($accountId === null) {\n // No account ID provided - keep current account\n return;\n }\n\n $currentAccountId = $opportunity->getAccountId();\n\n // Only update if account has changed\n if ($currentAccountId !== $accountId) {\n $opportunity->account_id = $accountId;\n $opportunity->save();\n\n $this->logger->info('[' . $this->getDisplayName() . '] Updated opportunity account association', [\n 'opportunity_id' => $opportunity->getId(),\n 'old_account_id' => $currentAccountId,\n 'new_account_id' => $accountId,\n ]);\n }\n }\n\n /**\n * Find existing opportunities by external IDs (OPTIMIZED VERSION)\n * Uses batch query for better performance\n */\n private function findExistingOpportunities(array $crmIds): Collection\n {\n return $this->crmEntityRepository\n ->findOpportunitiesByExternalIds($this->config, $crmIds);\n }\n\n private function processOpportunityBatch(array $opportunities): int\n {\n $syncedOpportunities = $this->importOpportunityBatch($opportunities);\n\n return count($syncedOpportunities['success'] ?? []);\n }\n\n /**\n * Convert single deal associations from HubSpot format to internal format\n * Handles both HubSpot SDK objects and array formats\n *\n * @param array $opportunityAssociations Raw associations from HubSpot API or pre-processed\n *\n * @return array Processed associations with DB IDs\n */\n private function convertDealAssociations(array $opportunityAssociations): array\n {\n $associations = $this->initializeAssociationsStructure();\n\n if (empty($opportunityAssociations)) {\n return $associations;\n }\n\n $associationIds = $this->extractAssociationIds($opportunityAssociations);\n\n $this->processCompanyAssociations($associationIds, $associations);\n $this->processContactAssociations($associationIds, $associations);\n\n return $associations;\n }\n\n private function initializeAssociationsStructure(): array\n {\n return [\n 'companies' => [],\n 'contacts' => [],\n 'account_id' => null, // Primary account for opportunity\n ];\n }\n\n private function extractAssociationIds(array $opportunityAssociations): array\n {\n $associationIds = [];\n\n foreach ($opportunityAssociations as $type => $associationData) {\n if (! empty($associationData)) {\n $associationIds[$type] = $this->convertSingleDealAssociations($associationData);\n }\n }\n\n return $associationIds;\n }\n\n private function processCompanyAssociations(array $associationIds, array &$associations): void\n {\n if (empty($associationIds['companies'])) {\n return;\n }\n\n $companyId = $associationIds['companies'][0];\n $account = $this->findOrSyncAccount($companyId);\n\n if ($account instanceof Account) {\n $associations['companies'][$companyId] = $account->getId();\n $associations['account_id'] = $account->getId();\n }\n }\n\n private function processContactAssociations(array $associationIds, array &$associations): void\n {\n if (empty($associationIds['contacts'])) {\n return;\n }\n\n foreach ($associationIds['contacts'] as $contactId) {\n $contact = $this->findOrSyncContact($contactId);\n\n if ($contact instanceof Contact) {\n $associations['contacts'][$contactId] = $contact->getId();\n }\n }\n }\n\n private function findOrSyncAccount(string $companyId): ?Account\n {\n $account = $this->crmEntityRepository->findAccountByExternalId($this->config, $companyId);\n\n if (! $account instanceof Account) {\n $account = $this->syncAccount($companyId);\n }\n\n return $account;\n }\n\n private function findOrSyncContact(string $contactId): ?Contact\n {\n $contact = $this->crmEntityRepository->findContactByExternalId($this->config, $contactId);\n\n if (! $contact instanceof Contact) {\n $contact = $this->syncContact($contactId);\n }\n\n return $contact;\n }\n\n private function convertSingleDealAssociations($opportunityAssociations = null): array\n {\n $associationData = [];\n\n if ($opportunityAssociations === null) {\n return $associationData;\n }\n\n // Handle array input (from extractAssociationIds)\n if (is_array($opportunityAssociations)) {\n return $opportunityAssociations;\n }\n\n // Handle CollectionResponseAssociatedId object\n if ($opportunityAssociations instanceof CollectionResponseAssociatedId) {\n foreach ($opportunityAssociations->getResults() as $association) {\n $associationData[] = $association->getId();\n }\n }\n\n return $associationData;\n }\n\n private function importOrUpdateOpportunity($crmData, ?bool $exists = null): ?Opportunity\n {\n if (empty($crmData['properties'])) {\n return null;\n }\n\n $crmId = (string) $crmData['id'];\n $properties = $crmData['properties'];\n $associations = $crmData['associations'] ?? [];\n\n $opportunityExists = $exists ?? (bool) $this->crmEntityRepository->findOpportunityByExternalId(\n $this->config,\n $crmId\n );\n\n if ($opportunityExists) {\n return $this->updateOpportunity($crmId, $properties, $associations);\n }\n\n return $this->createOpportunity($crmId, $properties, $associations);\n }\n\n /**\n * Create new opportunity\n */\n private function createOpportunity(string $crmId, array $properties, array $associations): ?Opportunity\n {\n $accountId = $this->resolveAccountId($associations);\n if (! $accountId) {\n return null;\n }\n\n $businessProcess = $this->resolveBusinessProcess($properties['pipeline'] ?? null);\n if (! $businessProcess) {\n return null;\n }\n\n $stage = $this->resolveStage($businessProcess, $properties['dealstage'] ?? null);\n if (! $stage) {\n return null;\n }\n\n $data = $this->buildOpportunityData($properties, $accountId, $businessProcess, $stage);\n\n $attributes = [\n 'crm_configuration_id' => $this->config->getId(),\n 'crm_provider_id' => $crmId,\n ];\n\n $values = array_merge($attributes, $data);\n\n $opportunity = $this->crmEntityRepository->upsertOpportunity($attributes, $values);\n\n $this->importExternalFieldData($properties, $opportunity->getId());\n $this->importOpportunityContacts($opportunity, $associations['contacts']);\n\n if ($opportunity->wasRecentlyCreated) {\n MatchActivitiesToNewOpportunity::dispatch($opportunity->getId());\n }\n\n return $opportunity;\n }\n\n /**\n * Update existing opportunity\n */\n private function updateOpportunity(string $crmId, array $properties, array $associations): Opportunity\n {\n $accountId = $this->resolveAccountId($associations);\n $businessProcess = $this->resolveBusinessProcess($properties['pipeline'] ?? null);\n $stage = $businessProcess ? $this->resolveStage($businessProcess, $properties['dealstage'] ?? null) : null;\n\n $data = $this->buildOpportunityData($properties, $accountId, $businessProcess, $stage);\n\n $attributes = [\n 'crm_configuration_id' => $this->config->getId(),\n 'crm_provider_id' => $crmId,\n ];\n\n $values = array_merge($attributes, $data);\n $opportunity = $this->crmEntityRepository->upsertOpportunity($attributes, $values);\n\n $this->importExternalFieldData($properties, $opportunity->getId());\n $this->updateOpportunityAssociations($opportunity, $associations);\n\n return $opportunity;\n }\n\n private function resolveAccountId(array $associations): ?int\n {\n if (! empty($associations['account_id'])) {\n return $associations['account_id'];\n }\n\n if (empty($associations)) {\n return null;\n }\n\n // Fallback: use first company as account (currently SDK returns one company)\n foreach ($associations['companies'] as $accountId) {\n return $accountId;\n }\n\n return null;\n }\n\n private function buildOpportunityData(\n array $properties,\n ?int $accountId,\n ?BusinessProcess $businessProcess,\n ?Stage $stage\n ): array {\n $ownerId = null;\n $profile = null;\n if (! empty($properties['hubspot_owner_id'])) {\n $ownerId = $properties['hubspot_owner_id'];\n $profile = $this->crmEntityRepository->findProfileByExternalId($this->config, (string) $ownerId);\n }\n\n $name = 'Unknown';\n if (isset($properties['dealname'])) {\n $name = mb_strimwidth($properties['dealname'], 0, 128);\n }\n\n $amount = $this->resolveAmount($properties);\n $currency = $properties['deal_currency_code'] ?? null;\n\n $closeDate = null;\n if (! empty($properties['closedate'])) {\n $closeDate = Carbon::parse($properties['closedate'])->format('Y-m-d');\n }\n\n $remotelyCreatedAt = null;\n if (! empty($properties['createdate']) && strtotime($properties['createdate'])) {\n $date = $this->parseCleanDatetime($properties['createdate']);\n $remotelyCreatedAt = $date?->format('Y-m-d H:i:s');\n }\n\n $closedStages = $this->getClosedDealStages();\n $isWon = in_array($properties['dealstage'], $closedStages['won']);\n $isLost = in_array($properties['dealstage'], $closedStages['lost']);\n\n $data = [\n 'team_id' => $this->team->getId(),\n 'user_id' => $profile ? $profile->user_id : null,\n 'owner_id' => $ownerId,\n 'name' => $name,\n 'value' => ! empty($amount) ? $amount : null,\n 'currency_code' => CurrencyFormatter::formatCode($currency),\n 'close_date' => $closeDate,\n 'is_closed' => $isWon || $isLost,\n 'is_won' => $isWon,\n 'remotely_created_at' => $remotelyCreatedAt,\n 'probability' => $this->resolveDealProbability($properties['hs_deal_stage_probability']),\n 'forecast_category' => $this->resolveForecastCategory($properties['hs_manual_forecast_category']),\n ];\n\n if ($accountId) {\n $data['account_id'] = $accountId;\n }\n\n if ($stage) {\n $data['stage_id'] = $stage->id;\n }\n\n if ($businessProcess) {\n $recordType = $this->crmEntityRepository->getBusinessProcessRecordType($businessProcess);\n if ($recordType) {\n $data['record_type_id'] = $recordType->id;\n }\n }\n\n return $data;\n }\n\n private function resolveBusinessProcess(?string $pipelineId): ?BusinessProcess\n {\n if ($pipelineId === null) {\n return null;\n }\n\n $cacheKey = $this->getBusinessProcessCacheKey($pipelineId);\n if (isset($this->cachedBusinessProcesses[$cacheKey])) {\n return $this->cachedBusinessProcesses[$cacheKey];\n }\n\n $businessProcess = $this->getBusinessProcess($pipelineId);\n\n if (! $businessProcess instanceof BusinessProcess) {\n $this->importStages();\n $businessProcess = $this->getBusinessProcess($pipelineId);\n }\n\n if (! $businessProcess instanceof BusinessProcess) {\n $this->logger->info(\n '[HubSpot] Deal is not attached to a pipeline',\n [\n 'pipeline' => $pipelineId]\n );\n }\n\n $this->cachedBusinessProcesses[$cacheKey] = $businessProcess;\n\n return $businessProcess;\n }\n\n private function getBusinessProcess(string $pipelineId): ?BusinessProcess\n {\n return $this->crmEntityRepository->findBusinessProcessesByExternalId($this->config, $pipelineId);\n }\n\n private function getBusinessProcessCacheKey(string $pipelineId): string\n {\n return $this->config->getId() . '_' . $pipelineId;\n }\n\n private function resolveStage(BusinessProcess $businessProcess, ?string $stageId): ?Stage\n {\n if (empty($stageId)) {\n return null;\n }\n\n $cacheKey = $businessProcess->getId() . ':' . $stageId;\n if (isset($this->cachedStages[$cacheKey])) {\n return $this->cachedStages[$cacheKey];\n }\n\n $stage = $this->crmEntityRepository->getPipelineStageByConditions(\n $businessProcess,\n [\n 'crm_provider_id' => $stageId,\n 'type' => Stage::TYPE_OPPORTUNITY,\n ]\n );\n\n if ($stage === null) {\n $this->importStages(null, $stageId);\n }\n\n if ($stage === null) {\n $this->logger->info('[HubSpot] Stage does not exist => ' . $stageId);\n }\n\n $this->cachedStages[$cacheKey] = $stage;\n\n return $stage;\n }\n\n private function resolveAmount(array $properties): ?string\n {\n $amount = null;\n if (! empty($properties['amount'])) {\n $amount = str_replace(',', '', $properties['amount']);\n }\n\n if ($this->config->hasDefaultCurrencyFieldSet()) {\n $valueFieldName = $this->config->getDefaultCurrencyField()->getCrmProviderId();\n $amount = $properties[$valueFieldName] ?? $amount;\n }\n\n return $amount;\n }\n\n private function parseCleanDatetime(string $datetime): ?Carbon\n {\n // Treat pre-1980 values as invalid\n $minValidDate = Carbon::parse('1980-01-01 00:00:00');\n\n try {\n $date = Carbon::parse($datetime);\n\n if ($minValidDate->gt($date)) {\n return null;\n }\n\n return $date;\n } catch (Exception) {\n return null; // On parse error, treat as null\n }\n }\n\n private function resolveDealProbability(?string $stageProbability): int\n {\n if ($stageProbability === null) {\n return 0;\n }\n\n $probability = (float) $stageProbability;\n\n return $probability > 1 ? 0 : (int) ($probability * 100);\n }\n\n private function resolveForecastCategory(?string $forecastCategory): string\n {\n if (! $forecastCategory) {\n return Forecast::FORECAST_CATEGORY_UNCATEGORIZED;\n }\n\n $forecastCategory = str_replace('_', ' ', $forecastCategory);\n\n return ucwords(strtolower($forecastCategory));\n }\n\n private function importExternalFieldData(array $properties, int $opportunityId): void\n {\n $crmFields = $this->getOpportunitySyncableFields();\n $this->importOpportunityCrmFieldData($properties, $crmFields, $opportunityId);\n }\n\n private function importOpportunityContacts(Opportunity $opportunity, array $associations): void\n {\n // Handle empty or missing contact associations\n if (empty($associations)) {\n // Remove all existing contact associations if none provided\n $this->removeAllOpportunityContacts($opportunity);\n\n return;\n }\n\n // Use differential sync approach for better performance and accuracy\n $this->syncOpportunityContactsDifferential($opportunity, $associations);\n }\n\n /**\n * Sync opportunity contacts using differential approach\n * This compares current vs new associations and only makes necessary changes\n */\n private function syncOpportunityContactsDifferential(Opportunity $opportunity, array $contactAssociations): void\n {\n $currentContactCrmIds = $this->getCurrentContactCrmIds($opportunity);\n $contactAssociationIds = array_keys($contactAssociations);\n\n $contactsToAdd = array_diff($contactAssociationIds, $currentContactCrmIds);\n $contactsToRemove = array_diff($currentContactCrmIds, $contactAssociationIds);\n\n if (empty($contactsToAdd) && empty($contactsToRemove)) {\n return;\n }\n\n $this->logContactAssociationChanges($opportunity, $currentContactCrmIds, $contactAssociations, $contactsToAdd, $contactsToRemove);\n\n $this->removeContactAssociations($opportunity, $contactsToRemove);\n $this->addContactAssociations($opportunity, $contactsToAdd, $contactAssociations);\n }\n\n private function getCurrentContactCrmIds(Opportunity $opportunity): array\n {\n return $opportunity->contacts()\n ->pluck('contacts.crm_provider_id')\n ->toArray();\n }\n\n private function logContactAssociationChanges(\n Opportunity $opportunity,\n array $currentContactCrmIds,\n array $contactAssociations,\n array $contactsToAdd,\n array $contactsToRemove\n ): void {\n $this->logger->info('[' . $this->getDisplayName() . '] Contact association changes', [\n 'opportunity_id' => $opportunity->getId(),\n 'current_contacts' => $currentContactCrmIds,\n 'new_contacts' => $contactAssociations,\n 'contacts_to_add' => $contactsToAdd,\n 'contacts_to_remove' => $contactsToRemove,\n ]);\n }\n\n private function removeContactAssociations(Opportunity $opportunity, array $contactsToRemove): void\n {\n if (empty($contactsToRemove)) {\n return;\n }\n\n $contactsToDetach = $opportunity->contacts()\n ->whereIn('contacts.crm_provider_id', $contactsToRemove)\n ->pluck('contacts.id')\n ->toArray();\n\n if (! empty($contactsToDetach)) {\n $opportunity->contacts()->detach($contactsToDetach);\n\n $this->logger->info('[' . $this->getDisplayName() . '] Removed contact associations', [\n 'opportunity_id' => $opportunity->getId(),\n 'removed_contact_crm_ids' => $contactsToRemove,\n 'removed_contact_count' => count($contactsToDetach),\n ]);\n }\n }\n\n private function addContactAssociations(Opportunity $opportunity, array $contactsToAdd, array $contactAssociations): void\n {\n if (empty($contactsToAdd)) {\n return;\n }\n\n $contactsAdded = [];\n foreach ($contactsToAdd as $crmId) {\n $id = $contactAssociations[$crmId];\n\n if ($this->attachSingleContact($opportunity, (string) $crmId, $id)) {\n $contactsAdded[] = $crmId;\n }\n }\n\n $this->logAddedContacts($opportunity, $contactsAdded);\n }\n\n private function attachSingleContact(Opportunity $opportunity, string $crmId, int $id): bool\n {\n try {\n $contact = $this->crmEntityRepository->findContactByConfigurationAndId($this->config, $id);\n\n if (! $contact) {\n return false;\n }\n\n return $this->performContactAttachment($opportunity, $contact, $crmId);\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Failed to add contact association', [\n 'opportunity_id' => $opportunity->getId(),\n 'contact_crm_id' => $crmId,\n 'error' => $e->getMessage(),\n ]);\n\n return false;\n }\n }\n\n private function performContactAttachment(Opportunity $opportunity, Contact $contact, string $crmId): bool\n {\n try {\n $opportunity->contacts()->attach($contact->getId(), [\n 'crm_provider_id' => $crmId,\n ]);\n\n return true;\n } catch (\\Illuminate\\Database\\QueryException $e) {\n if (str_contains($e->getMessage(), 'Duplicate entry')) {\n $this->logger->info('[' . $this->getDisplayName() . '] Contact association already exists', [\n 'contact_id' => $contact->getId(),\n 'contact_crm_id' => $crmId,\n 'opportunity_id' => $opportunity->getId(),\n ]);\n\n return false;\n }\n\n throw $e;\n }\n }\n\n private function logAddedContacts(Opportunity $opportunity, array $contactsAdded): void\n {\n if (! empty($contactsAdded)) {\n $this->logger->info('[' . $this->getDisplayName() . '] Added contact associations', [\n 'opportunity_id' => $opportunity->getId(),\n 'added_contact_crm_ids' => $contactsAdded,\n 'added_contacts_count' => count($contactsAdded),\n ]);\n }\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Crm\\Hubspot\\ServiceTraits;\n\nuse Carbon\\Carbon;\nuse HubSpot\\Client\\Crm\\Deals\\Model\\CollectionResponseAssociatedId;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Models\\Account;\nuse Exception;\nuse Jiminny\\Component\\DealInsights\\Forecast\\Forecast;\nuse Jiminny\\Jobs\\Crm\\MatchActivitiesToNewOpportunity;\nuse Jiminny\\Models\\Contact;\nuse Jiminny\\Models\\Crm\\BusinessProcess;\nuse Jiminny\\Exceptions\\CrmException;\nuse Jiminny\\Models\\Opportunity;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Stage;\nuse Jiminny\\Repositories\\Crm\\CrmEntityRepository;\nuse Jiminny\\Services\\Crm\\Hubspot\\DealFieldsService;\nuse Jiminny\\Services\\Crm\\Hubspot\\OpportunitySyncStrategy\\HubspotSingleSyncStrategy;\nuse Jiminny\\Services\\Crm\\Hubspot\\WebhookSyncBatchProcessor;\nuse Jiminny\\Services\\Crm\\OpportunitySyncStrategyResolver;\nuse Jiminny\\Utils\\CurrencyFormatter;\n\n/**\n * Optimized sync methods for better performance\n * These methods can be integrated into SyncCrmEntitiesTrait for significant performance gains\n */\ntrait OpportunitySyncTrait\n{\n private const int BATCH_SIZE = 100;\n private const int BATCH_PROCESS_SIZE = 800;\n\n protected OpportunitySyncStrategyResolver $opportunitySyncStrategyResolver;\n protected CrmEntityRepository $crmEntityRepository;\n protected DealFieldsService $dealFieldsService;\n\n private ?array $cachedClosedDealStages = null;\n private array $cachedBusinessProcesses = [];\n private array $cachedStages = [];\n\n public function syncOpportunities(array $parameters, ?string $strategy = null): int\n {\n $startTime = microtime(true);\n $strategies = $this->opportunitySyncStrategyResolver->getStrategies($this->config, $strategy);\n $parameters['config'] = $this->config;\n $syncCount = 0;\n $reportedTotal = 0;\n $lastSyncedId = [];\n $strategyNames = [];\n\n try {\n foreach ($strategies as $strategyName => $syncStrategy) {\n $strategyNames[] = $strategyName;\n $this->logger->info(\n '[' . $this->getDisplayName() . '] Syncing opportunities using strategy: ' . $strategyName,\n ['team' => $this->team->getId()]\n );\n\n $total = 0;\n $lastId = null;\n $buffer = [];\n\n // HubspotWebhookBatchSyncStrategy returns empty generator, this is for other strategies\n foreach ($syncStrategy->fetchOpportunities($parameters, $total, $lastId) as $hsOpportunity) {\n $buffer[] = $hsOpportunity;\n\n // process every 800 rows (fits < 1 000 association limit)\n if (\\count($buffer) >= self::BATCH_PROCESS_SIZE) {\n $syncCount += $this->processOpportunityBatch($buffer);\n $buffer = [];\n }\n }\n\n // leftovers\n if ($buffer) {\n $syncCount += $this->processOpportunityBatch($buffer);\n }\n\n $reportedTotal += $total;\n $lastSyncedId = $lastId;\n }\n } catch (\\HubSpot\\Client\\Crm\\Deals\\ApiException | CrmException $e) {\n $this->handleSyncException($e, $parameters);\n }\n\n $durationMs = round((microtime(true) - $startTime) * 1000, 2);\n $this->logger->info(\n '[HubSpot] Synced opportunities',\n [\n 'team' => $this->team->getId(),\n 'strategies' => implode(',', $strategyNames),\n 'sync_count' => $syncCount,\n 'total' => $reportedTotal,\n 'last_synced_id' => $lastSyncedId,\n 'duration_ms' => $durationMs,\n ]\n );\n\n return $reportedTotal;\n }\n\n private function handleSyncException(\\Throwable $e, array $parameters): void\n {\n if (($parameters['since'] ?? null) instanceof Carbon) {\n $parameters['since'] = $parameters['since']->toDateTimeString();\n }\n $parameters['config'] = $this->config->getId();\n\n $this->logger->warning('[' . $this->getDisplayName() . '] Sync opportunities failed', [\n 'teamId' => $this->team->getUuid(),\n 'parameters' => $parameters,\n 'reason' => $e->getMessage(),\n ]);\n }\n\n /**\n * @inheritdoc\n */\n public function syncOpportunity(string $crmId): ?Opportunity\n {\n $strategy = $this->opportunitySyncStrategyResolver->resolve(\n $this->config,\n OpportunitySyncStrategyResolver::SINGLE_SYNC_OPPORTUNITY_STRATEGY,\n );\n\n $parameters = [\n 'config' => $this->config,\n 'crm_id' => $crmId,\n ];\n\n try {\n if (! $strategy instanceof HubspotSingleSyncStrategy) {\n throw new InvalidArgumentException('Strategy must by HubspotSingleSyncStrategy');\n }\n\n $hsOpportunity = $strategy->fetchOpportunity($parameters);\n } catch (\\HubSpot\\Client\\Crm\\Deals\\ApiException $e) {\n $this->logger->info('[' . $this->getDisplayName() . '] Opportunity not found', [\n 'teamId' => $this->team->getUuid(),\n 'crmId' => $crmId,\n 'reason' => $e->getMessage(),\n ]);\n\n return null;\n }\n\n $hsOpportunity['associations'] = $this->convertDealAssociations($hsOpportunity['associations'] ?? []);\n\n return $this->importOrUpdateOpportunity($hsOpportunity);\n }\n\n /**\n * Process webhook-collected opportunity batches.\n *\n * Drains Redis sets containing company CRM IDs collected from webhook events\n * and dispatches ImportOpportunityBatch jobs for batch processing.\n *\n * @return int Number of opportunity IDs dispatched to jobs\n */\n public function batchSyncOpportunities(): int\n {\n $configId = $this->team->getCrmConfiguration()->getId();\n\n return $this->batchProcessor->processBatchesForObjectType(\n WebhookSyncBatchProcessor::OBJECT_TYPE_DEAL,\n $configId\n );\n }\n\n /**\n * Import a batch of opportunities by their CRM IDs.\n * Fetches opportunity data from HubSpot API and delegates to importOpportunityBatch().\n *\n * @param array<string> $crmIds HubSpot deal CRM IDs\n *\n * @return array{success: array, failed_ids: array, errors?: array<string, string>}\n */\n public function importOpportunityBatchByIds(array $crmIds): array\n {\n $fields = $this->dealFieldsService->getFieldsForConfiguration($this->config);\n\n $allDeals = [];\n foreach (array_chunk($crmIds, self::BATCH_SIZE) as $chunk) {\n $deals = $this->client->getOpportunitiesByIds($chunk, $fields);\n foreach ($deals as $deal) {\n $allDeals[] = $deal;\n }\n }\n\n // IDs not returned by HubSpot are likely deleted or inaccessible deals.\n // These are not failures — retrying won't bring them back.\n $fetchedIds = array_map('strval', array_column($allDeals, 'id'));\n $notFoundIds = array_values(array_diff(array_map('strval', $crmIds), $fetchedIds));\n\n if (! empty($notFoundIds)) {\n $this->logger->info('[' . $this->getDisplayName() . '] CRM IDs not found in HubSpot (likely deleted)', [\n 'teamId' => $this->team->getId(),\n 'notFoundCount' => \\count($notFoundIds),\n 'notFoundIds' => $notFoundIds,\n 'requestedCount' => \\count($crmIds),\n 'fetchedCount' => \\count($allDeals),\n ]);\n }\n\n if (empty($allDeals)) {\n return ['success' => [], 'failed_ids' => []];\n }\n\n return $this->importOpportunityBatch($allDeals);\n }\n\n private function getClosedDealStages(): array\n {\n if ($this->cachedClosedDealStages !== null) {\n return $this->cachedClosedDealStages;\n }\n\n $stages = $this->crmEntityRepository->getOpportunityClosedStages($this->config);\n $data = [\n 'lost' => [],\n 'won' => [],\n ];\n\n foreach ($stages as $stage) {\n if ($stage->probability == 0.00) {\n $data['lost'][] = $stage->crm_provider_id;\n }\n if ($stage->probability == 100.00) {\n $data['won'][] = $stage->crm_provider_id;\n }\n }\n\n $this->cachedClosedDealStages = $data;\n\n return $data;\n }\n\n /**\n * Import deals into the database with pre-fetched associations.\n *\n * API calls here (getAssociationsData, getExistingOpportunityCrmIds) are NOT\n * caught — if they throw, the exception propagates to ImportOpportunityBatch::handle()\n * where Laravel retries the whole job with backoff. After all retries exhausted,\n * failed() requeues all IDs to Redis.\n *\n * The per-deal loop catches exceptions individually. A deal can end up in three states:\n * - success: imported/updated successfully\n * - failed_ids: exception thrown (DB constraint violation, corrupt data, etc.)\n * These are permanent issues — retrying won't fix them.\n * - skipped (null): missing dependencies (no account, unknown pipeline/stage).\n * This is acceptable — the deal cannot be imported until those exist.\n */\n private function importOpportunityBatch(array $deals): array\n {\n $syncedOpportunities = [\n 'success' => [],\n 'failed_ids' => [],\n ];\n $dealIds = array_column($deals, 'id');\n\n // Shared association/existing-ID preparation is batch-level state. If it fails, rethrow so the\n // queue job retries the whole batch and eventually requeues all deal IDs back to Redis.\n try {\n $companyAssociations = $this->client->getAssociationsData($dealIds, 'deals', 'companies');\n $contactAssociations = $this->client->getAssociationsData($dealIds, 'deals', 'contacts');\n\n $associationsData = $this->prepareAssociatedEntities($companyAssociations, $contactAssociations);\n\n $existingCrmIds = $this->crmEntityRepository->getExistingOpportunityCrmIds(\n $this->config,\n array_map('strval', $dealIds)\n );\n $existingCrmIdSet = array_flip($existingCrmIds);\n } catch (\\Throwable $e) {\n $this->logger->error('[' . $this->getDisplayName() . '] Failed to fetch associations or existing IDs', [\n 'teamId' => $this->team->getId(),\n 'dealCount' => count($dealIds),\n 'error' => $e->getMessage(),\n ]);\n\n throw $e;\n }\n\n foreach ($deals as $deal) {\n try {\n $deal['associations'] = $this->prepareAssociationsForOpportunity(\n $deal['id'],\n $companyAssociations,\n $contactAssociations,\n $associationsData\n );\n\n $syncedOpportunity = $this->importOrUpdateOpportunity(\n $deal,\n isset($existingCrmIdSet[(string) $deal['id']])\n );\n if ($syncedOpportunity) {\n $syncedOpportunities['success'][] = $syncedOpportunity;\n }\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Failed to import opportunity', [\n 'teamId' => $this->team->getId(),\n 'crmId' => $deal['id'],\n 'error' => $e->getMessage(),\n ]);\n $syncedOpportunities['failed_ids'][] = $deal['id'];\n $syncedOpportunities['errors'][$deal['id']] = $e->getMessage();\n }\n }\n\n return $syncedOpportunities;\n }\n\n /**\n * Prepare associated entities for opportunities with optimized batch processing\n * Returns structured data with CRM ID to DB ID mappings for each opportunity\n */\n private function prepareAssociatedEntities(array $companyAssociations, array $contactAssociations): array\n {\n // Step 1: Collect all unique company and contact IDs from associations\n $allCompanyIds = $this->flattenAssociationIds($companyAssociations);\n $allContactIds = $this->flattenAssociationIds($contactAssociations);\n\n // Step 2: Batch sync missing entities and get CRM ID to DB ID mappings\n $companyIdMappings = [];\n $contactIdMappings = [];\n\n if (! empty($allCompanyIds)) {\n $companyIdMappings = $this->prepareAssociatedAccounts($allCompanyIds);\n }\n\n if (! empty($allContactIds)) {\n $contactIdMappings = $this->prepareAssociatedContacts($allContactIds);\n }\n\n return [\n 'company_id_mappings' => $companyIdMappings,\n 'contact_id_mappings' => $contactIdMappings,\n ];\n }\n\n /**\n * Flatten association data to get unique IDs\n */\n private function flattenAssociationIds(array $associations): array\n {\n $ids = [];\n foreach ($associations as $dealAssociations) {\n if (is_array($dealAssociations)) {\n foreach ($dealAssociations as $id) {\n $ids[$id] = true;\n }\n }\n }\n\n return array_keys($ids);\n }\n\n /**\n * Batch sync missing accounts\n */\n private function prepareAssociatedAccounts(array $companyIds): array\n {\n // Find which accounts already exist\n $existingAccounts = $this->crmEntityRepository\n ->findAccountsByExternalIds($this->config, $companyIds);\n\n $existingCompanyIds = $existingAccounts->pluck('crm_provider_id')->toArray();\n\n $existingAccountsData = $existingAccounts->mapWithKeys(function ($account) {\n return [$account->getCrmProviderId() => $account->getId()];\n })->toArray();\n\n $missingCompanyIds = array_diff($companyIds, $existingCompanyIds);\n\n if (empty($missingCompanyIds)) {\n return $existingAccountsData;\n }\n\n $this->logger->info('[' . $this->getDisplayName() . '] Batch syncing missing accounts', [\n 'teamId' => $this->team->getUuid(),\n 'total_companies' => count($companyIds),\n 'existing_companies' => count($existingCompanyIds),\n 'missing_companies' => count($missingCompanyIds),\n ]);\n\n // we already have limit on opportunity ids count\n // Initialize variable before try block\n $syncedAccountsData = [];\n\n try {\n $syncedAccountsData = $this->batchSyncCrmObjects('companies', $missingCompanyIds);\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Failed to sync missing accounts', [\n 'size' => count($missingCompanyIds),\n 'error' => $e->getMessage(),\n ]);\n $syncedAccountsData = [];\n }\n\n return $existingAccountsData + $syncedAccountsData;\n }\n\n /**\n * Prepare associated contacts - find existing and sync missing ones\n * Returns mapping of CRM ID to DB ID\n */\n private function prepareAssociatedContacts(array $contactIds): array\n {\n // Find which contacts already exist\n $existingContacts = $this->crmEntityRepository\n ->findContactsByExternalIds($this->config, $contactIds);\n\n $existingContactIds = $existingContacts->pluck('crm_provider_id')->toArray();\n\n // Create mapping for existing contacts\n $existingContactsData = $existingContacts->mapWithKeys(function ($contact) {\n return [$contact->getCrmProviderId() => $contact->getId()];\n })->toArray();\n\n $missingContactIds = array_diff($contactIds, $existingContactIds);\n\n if (empty($missingContactIds)) {\n return $existingContactsData;\n }\n\n $this->logger->info('[' . $this->getDisplayName() . '] Batch syncing missing contacts', [\n 'teamId' => $this->team->getUuid(),\n 'total_contacts' => count($contactIds),\n 'existing_contacts' => count($existingContactIds),\n 'missing_contacts' => count($missingContactIds),\n ]);\n\n // Sync missing contacts using batch API\n try {\n $syncedContactsData = $this->batchSyncCrmObjects('contacts', $missingContactIds);\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Failed to sync missing contacts', [\n 'size' => count($missingContactIds),\n 'error' => $e->getMessage(),\n ]);\n $syncedContactsData = [];\n }\n\n return $existingContactsData + $syncedContactsData;\n }\n\n private function batchSyncCrmObjects(string $objectType, array $crmIds): array\n {\n $syncObjects = [];\n $crmObjectIds = array_values($crmIds);\n\n foreach (array_chunk($crmObjectIds, self::BATCH_SIZE) as $chunk) {\n try {\n $objects = $objectType === 'companies' ?\n $this->client->getCompaniesByIds($chunk, $this->getCompanyFields()) :\n $this->client->getContactsByIds($chunk, $this->getContactFields());\n\n foreach ($objects as $objectId => $objectData) {\n $this->importCrmObject($objectType, (string) $objectId, $objectData, $syncObjects);\n }\n\n $this->logger->info('[' . $this->getDisplayName() . '] Batch synced ' . $objectType, [\n 'requested_count' => count($chunk),\n 'synced_count' => count($objects),\n ]);\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Batch ' . $objectType . ' sync failed', [\n 'ids' => $chunk,\n 'error' => $e->getMessage(),\n ]);\n }\n }\n\n return $syncObjects;\n }\n\n private function importCrmObject(string $objectType, string $objectId, mixed $objectData, array &$syncObjects): void\n {\n try {\n $object = $objectType === 'companies' ?\n $this->importAccount($objectData) :\n $this->importContact($objectData);\n\n if ($object) {\n $syncObjects[$object->getCrmProviderId()] = $object->getId();\n }\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Failed to import batch ' . $objectType, [\n 'id' => $objectId,\n 'error' => $e->getMessage(),\n ]);\n }\n }\n\n /**\n * Prepare associations for a single opportunity\n *\n * The return value is an array with the following structure:\n * [\n * 'companies' => [\n * $companyCrmId => $companyId,\n * ...\n * ],\n * 'contacts' => [\n * $contactCrmId => $contactId,\n * ...\n * ],\n * 'account_id' => $accountId,\n * ]\n */\n private function prepareAssociationsForOpportunity(\n string $oppCrmId,\n array $companyAssociations,\n array $contactAssociations,\n array $associationsData\n ): array {\n $associations = [\n 'companies' => [],\n 'contacts' => [],\n 'account_id' => null, // Primary account for opportunity\n ];\n\n $oppCompanyIds = $companyAssociations[$oppCrmId] ?? [];\n foreach ($oppCompanyIds as $companyCrmId) {\n if (isset($associationsData['company_id_mappings'][$companyCrmId])) {\n $associations['companies'][$companyCrmId] = $associationsData['company_id_mappings'][$companyCrmId];\n\n // Set primary account (first company becomes primary account)\n if ($associations['account_id'] === null) {\n $associations['account_id'] = $associationsData['company_id_mappings'][$companyCrmId];\n }\n }\n }\n\n $oppContactIds = $contactAssociations[$oppCrmId] ?? [];\n foreach ($oppContactIds as $contactCrmId) {\n if (isset($associationsData['contact_id_mappings'][$contactCrmId])) {\n $associations['contacts'][$contactCrmId] = $associationsData['contact_id_mappings'][$contactCrmId];\n }\n }\n\n return $associations;\n }\n\n /**\n * Update only associations for an opportunity\n */\n private function updateOpportunityAssociations(Opportunity $opportunity, array $associations): void\n {\n // Update contact associations\n $this->importOpportunityContacts($opportunity, $associations['contacts']);\n\n // Update company (account) associations\n $this->updateOpportunityAccount($opportunity, $associations['account_id']);\n }\n\n /**\n * Remove all contact associations from an opportunity\n */\n private function removeAllOpportunityContacts(Opportunity $opportunity): void\n {\n $currentCount = (int) $opportunity->contacts()->count();\n\n if ($currentCount > 0) {\n $opportunity->contacts()->detach();\n\n $this->logger->info('[' . $this->getDisplayName() . '] Removed all contact associations', [\n 'opportunity_id' => $opportunity->getId(),\n 'removed_count' => $currentCount,\n ]);\n }\n }\n\n private function updateOpportunityAccount(Opportunity $opportunity, ?int $accountId): void\n {\n if ($accountId === null) {\n // No account ID provided - keep current account\n return;\n }\n\n $currentAccountId = $opportunity->getAccountId();\n\n // Only update if account has changed\n if ($currentAccountId !== $accountId) {\n $opportunity->account_id = $accountId;\n $opportunity->save();\n\n $this->logger->info('[' . $this->getDisplayName() . '] Updated opportunity account association', [\n 'opportunity_id' => $opportunity->getId(),\n 'old_account_id' => $currentAccountId,\n 'new_account_id' => $accountId,\n ]);\n }\n }\n\n /**\n * Find existing opportunities by external IDs (OPTIMIZED VERSION)\n * Uses batch query for better performance\n */\n private function findExistingOpportunities(array $crmIds): Collection\n {\n return $this->crmEntityRepository\n ->findOpportunitiesByExternalIds($this->config, $crmIds);\n }\n\n private function processOpportunityBatch(array $opportunities): int\n {\n $syncedOpportunities = $this->importOpportunityBatch($opportunities);\n\n return count($syncedOpportunities['success'] ?? []);\n }\n\n /**\n * Convert single deal associations from HubSpot format to internal format\n * Handles both HubSpot SDK objects and array formats\n *\n * @param array $opportunityAssociations Raw associations from HubSpot API or pre-processed\n *\n * @return array Processed associations with DB IDs\n */\n private function convertDealAssociations(array $opportunityAssociations): array\n {\n $associations = $this->initializeAssociationsStructure();\n\n if (empty($opportunityAssociations)) {\n return $associations;\n }\n\n $associationIds = $this->extractAssociationIds($opportunityAssociations);\n\n $this->processCompanyAssociations($associationIds, $associations);\n $this->processContactAssociations($associationIds, $associations);\n\n return $associations;\n }\n\n private function initializeAssociationsStructure(): array\n {\n return [\n 'companies' => [],\n 'contacts' => [],\n 'account_id' => null, // Primary account for opportunity\n ];\n }\n\n private function extractAssociationIds(array $opportunityAssociations): array\n {\n $associationIds = [];\n\n foreach ($opportunityAssociations as $type => $associationData) {\n if (! empty($associationData)) {\n $associationIds[$type] = $this->convertSingleDealAssociations($associationData);\n }\n }\n\n return $associationIds;\n }\n\n private function processCompanyAssociations(array $associationIds, array &$associations): void\n {\n if (empty($associationIds['companies'])) {\n return;\n }\n\n $companyId = $associationIds['companies'][0];\n $account = $this->findOrSyncAccount($companyId);\n\n if ($account instanceof Account) {\n $associations['companies'][$companyId] = $account->getId();\n $associations['account_id'] = $account->getId();\n }\n }\n\n private function processContactAssociations(array $associationIds, array &$associations): void\n {\n if (empty($associationIds['contacts'])) {\n return;\n }\n\n foreach ($associationIds['contacts'] as $contactId) {\n $contact = $this->findOrSyncContact($contactId);\n\n if ($contact instanceof Contact) {\n $associations['contacts'][$contactId] = $contact->getId();\n }\n }\n }\n\n private function findOrSyncAccount(string $companyId): ?Account\n {\n $account = $this->crmEntityRepository->findAccountByExternalId($this->config, $companyId);\n\n if (! $account instanceof Account) {\n $account = $this->syncAccount($companyId);\n }\n\n return $account;\n }\n\n private function findOrSyncContact(string $contactId): ?Contact\n {\n $contact = $this->crmEntityRepository->findContactByExternalId($this->config, $contactId);\n\n if (! $contact instanceof Contact) {\n $contact = $this->syncContact($contactId);\n }\n\n return $contact;\n }\n\n private function convertSingleDealAssociations($opportunityAssociations = null): array\n {\n $associationData = [];\n\n if ($opportunityAssociations === null) {\n return $associationData;\n }\n\n // Handle array input (from extractAssociationIds)\n if (is_array($opportunityAssociations)) {\n return $opportunityAssociations;\n }\n\n // Handle CollectionResponseAssociatedId object\n if ($opportunityAssociations instanceof CollectionResponseAssociatedId) {\n foreach ($opportunityAssociations->getResults() as $association) {\n $associationData[] = $association->getId();\n }\n }\n\n return $associationData;\n }\n\n private function importOrUpdateOpportunity($crmData, ?bool $exists = null): ?Opportunity\n {\n if (empty($crmData['properties'])) {\n return null;\n }\n\n $crmId = (string) $crmData['id'];\n $properties = $crmData['properties'];\n $associations = $crmData['associations'] ?? [];\n\n $opportunityExists = $exists ?? (bool) $this->crmEntityRepository->findOpportunityByExternalId(\n $this->config,\n $crmId\n );\n\n if ($opportunityExists) {\n return $this->updateOpportunity($crmId, $properties, $associations);\n }\n\n return $this->createOpportunity($crmId, $properties, $associations);\n }\n\n /**\n * Create new opportunity\n */\n private function createOpportunity(string $crmId, array $properties, array $associations): ?Opportunity\n {\n $accountId = $this->resolveAccountId($associations);\n if (! $accountId) {\n return null;\n }\n\n $businessProcess = $this->resolveBusinessProcess($properties['pipeline'] ?? null);\n if (! $businessProcess) {\n return null;\n }\n\n $stage = $this->resolveStage($businessProcess, $properties['dealstage'] ?? null);\n if (! $stage) {\n return null;\n }\n\n $data = $this->buildOpportunityData($properties, $accountId, $businessProcess, $stage);\n\n $attributes = [\n 'crm_configuration_id' => $this->config->getId(),\n 'crm_provider_id' => $crmId,\n ];\n\n $values = array_merge($attributes, $data);\n\n $opportunity = $this->crmEntityRepository->upsertOpportunity($attributes, $values);\n\n $this->importExternalFieldData($properties, $opportunity->getId());\n $this->importOpportunityContacts($opportunity, $associations['contacts']);\n\n if ($opportunity->wasRecentlyCreated) {\n MatchActivitiesToNewOpportunity::dispatch($opportunity->getId());\n }\n\n return $opportunity;\n }\n\n /**\n * Update existing opportunity\n */\n private function updateOpportunity(string $crmId, array $properties, array $associations): Opportunity\n {\n $accountId = $this->resolveAccountId($associations);\n $businessProcess = $this->resolveBusinessProcess($properties['pipeline'] ?? null);\n $stage = $businessProcess ? $this->resolveStage($businessProcess, $properties['dealstage'] ?? null) : null;\n\n $data = $this->buildOpportunityData($properties, $accountId, $businessProcess, $stage);\n\n $attributes = [\n 'crm_configuration_id' => $this->config->getId(),\n 'crm_provider_id' => $crmId,\n ];\n\n $values = array_merge($attributes, $data);\n $opportunity = $this->crmEntityRepository->upsertOpportunity($attributes, $values);\n\n $this->importExternalFieldData($properties, $opportunity->getId());\n $this->updateOpportunityAssociations($opportunity, $associations);\n\n return $opportunity;\n }\n\n private function resolveAccountId(array $associations): ?int\n {\n if (! empty($associations['account_id'])) {\n return $associations['account_id'];\n }\n\n if (empty($associations)) {\n return null;\n }\n\n // Fallback: use first company as account (currently SDK returns one company)\n foreach ($associations['companies'] as $accountId) {\n return $accountId;\n }\n\n return null;\n }\n\n private function buildOpportunityData(\n array $properties,\n ?int $accountId,\n ?BusinessProcess $businessProcess,\n ?Stage $stage\n ): array {\n $ownerId = null;\n $profile = null;\n if (! empty($properties['hubspot_owner_id'])) {\n $ownerId = $properties['hubspot_owner_id'];\n $profile = $this->crmEntityRepository->findProfileByExternalId($this->config, (string) $ownerId);\n }\n\n $name = 'Unknown';\n if (isset($properties['dealname'])) {\n $name = mb_strimwidth($properties['dealname'], 0, 128);\n }\n\n $amount = $this->resolveAmount($properties);\n $currency = $properties['deal_currency_code'] ?? null;\n\n $closeDate = null;\n if (! empty($properties['closedate'])) {\n $closeDate = Carbon::parse($properties['closedate'])->format('Y-m-d');\n }\n\n $remotelyCreatedAt = null;\n if (! empty($properties['createdate']) && strtotime($properties['createdate'])) {\n $date = $this->parseCleanDatetime($properties['createdate']);\n $remotelyCreatedAt = $date?->format('Y-m-d H:i:s');\n }\n\n $closedStages = $this->getClosedDealStages();\n $isWon = in_array($properties['dealstage'], $closedStages['won']);\n $isLost = in_array($properties['dealstage'], $closedStages['lost']);\n\n $data = [\n 'team_id' => $this->team->getId(),\n 'user_id' => $profile ? $profile->user_id : null,\n 'owner_id' => $ownerId,\n 'name' => $name,\n 'value' => ! empty($amount) ? $amount : null,\n 'currency_code' => CurrencyFormatter::formatCode($currency),\n 'close_date' => $closeDate,\n 'is_closed' => $isWon || $isLost,\n 'is_won' => $isWon,\n 'remotely_created_at' => $remotelyCreatedAt,\n 'probability' => $this->resolveDealProbability($properties['hs_deal_stage_probability']),\n 'forecast_category' => $this->resolveForecastCategory($properties['hs_manual_forecast_category']),\n ];\n\n if ($accountId) {\n $data['account_id'] = $accountId;\n }\n\n if ($stage) {\n $data['stage_id'] = $stage->id;\n }\n\n if ($businessProcess) {\n $recordType = $this->crmEntityRepository->getBusinessProcessRecordType($businessProcess);\n if ($recordType) {\n $data['record_type_id'] = $recordType->id;\n }\n }\n\n return $data;\n }\n\n private function resolveBusinessProcess(?string $pipelineId): ?BusinessProcess\n {\n if ($pipelineId === null) {\n return null;\n }\n\n $cacheKey = $this->getBusinessProcessCacheKey($pipelineId);\n if (isset($this->cachedBusinessProcesses[$cacheKey])) {\n return $this->cachedBusinessProcesses[$cacheKey];\n }\n\n $businessProcess = $this->getBusinessProcess($pipelineId);\n\n if (! $businessProcess instanceof BusinessProcess) {\n $this->importStages();\n $businessProcess = $this->getBusinessProcess($pipelineId);\n }\n\n if (! $businessProcess instanceof BusinessProcess) {\n $this->logger->info(\n '[HubSpot] Deal is not attached to a pipeline',\n [\n 'pipeline' => $pipelineId]\n );\n }\n\n $this->cachedBusinessProcesses[$cacheKey] = $businessProcess;\n\n return $businessProcess;\n }\n\n private function getBusinessProcess(string $pipelineId): ?BusinessProcess\n {\n return $this->crmEntityRepository->findBusinessProcessesByExternalId($this->config, $pipelineId);\n }\n\n private function getBusinessProcessCacheKey(string $pipelineId): string\n {\n return $this->config->getId() . '_' . $pipelineId;\n }\n\n private function resolveStage(BusinessProcess $businessProcess, ?string $stageId): ?Stage\n {\n if (empty($stageId)) {\n return null;\n }\n\n $cacheKey = $businessProcess->getId() . ':' . $stageId;\n if (isset($this->cachedStages[$cacheKey])) {\n return $this->cachedStages[$cacheKey];\n }\n\n $stage = $this->crmEntityRepository->getPipelineStageByConditions(\n $businessProcess,\n [\n 'crm_provider_id' => $stageId,\n 'type' => Stage::TYPE_OPPORTUNITY,\n ]\n );\n\n if ($stage === null) {\n $this->importStages(null, $stageId);\n }\n\n if ($stage === null) {\n $this->logger->info('[HubSpot] Stage does not exist => ' . $stageId);\n }\n\n $this->cachedStages[$cacheKey] = $stage;\n\n return $stage;\n }\n\n private function resolveAmount(array $properties): ?string\n {\n $amount = null;\n if (! empty($properties['amount'])) {\n $amount = str_replace(',', '', $properties['amount']);\n }\n\n if ($this->config->hasDefaultCurrencyFieldSet()) {\n $valueFieldName = $this->config->getDefaultCurrencyField()->getCrmProviderId();\n $amount = $properties[$valueFieldName] ?? $amount;\n }\n\n return $amount;\n }\n\n private function parseCleanDatetime(string $datetime): ?Carbon\n {\n // Treat pre-1980 values as invalid\n $minValidDate = Carbon::parse('1980-01-01 00:00:00');\n\n try {\n $date = Carbon::parse($datetime);\n\n if ($minValidDate->gt($date)) {\n return null;\n }\n\n return $date;\n } catch (Exception) {\n return null; // On parse error, treat as null\n }\n }\n\n private function resolveDealProbability(?string $stageProbability): int\n {\n if ($stageProbability === null) {\n return 0;\n }\n\n $probability = (float) $stageProbability;\n\n return $probability > 1 ? 0 : (int) ($probability * 100);\n }\n\n private function resolveForecastCategory(?string $forecastCategory): string\n {\n if (! $forecastCategory) {\n return Forecast::FORECAST_CATEGORY_UNCATEGORIZED;\n }\n\n $forecastCategory = str_replace('_', ' ', $forecastCategory);\n\n return ucwords(strtolower($forecastCategory));\n }\n\n private function importExternalFieldData(array $properties, int $opportunityId): void\n {\n $crmFields = $this->getOpportunitySyncableFields();\n $this->importOpportunityCrmFieldData($properties, $crmFields, $opportunityId);\n }\n\n private function importOpportunityContacts(Opportunity $opportunity, array $associations): void\n {\n // Handle empty or missing contact associations\n if (empty($associations)) {\n // Remove all existing contact associations if none provided\n $this->removeAllOpportunityContacts($opportunity);\n\n return;\n }\n\n // Use differential sync approach for better performance and accuracy\n $this->syncOpportunityContactsDifferential($opportunity, $associations);\n }\n\n /**\n * Sync opportunity contacts using differential approach\n * This compares current vs new associations and only makes necessary changes\n */\n private function syncOpportunityContactsDifferential(Opportunity $opportunity, array $contactAssociations): void\n {\n $currentContactCrmIds = $this->getCurrentContactCrmIds($opportunity);\n $contactAssociationIds = array_keys($contactAssociations);\n\n $contactsToAdd = array_diff($contactAssociationIds, $currentContactCrmIds);\n $contactsToRemove = array_diff($currentContactCrmIds, $contactAssociationIds);\n\n if (empty($contactsToAdd) && empty($contactsToRemove)) {\n return;\n }\n\n $this->logContactAssociationChanges($opportunity, $currentContactCrmIds, $contactAssociations, $contactsToAdd, $contactsToRemove);\n\n $this->removeContactAssociations($opportunity, $contactsToRemove);\n $this->addContactAssociations($opportunity, $contactsToAdd, $contactAssociations);\n }\n\n private function getCurrentContactCrmIds(Opportunity $opportunity): array\n {\n return $opportunity->contacts()\n ->pluck('contacts.crm_provider_id')\n ->toArray();\n }\n\n private function logContactAssociationChanges(\n Opportunity $opportunity,\n array $currentContactCrmIds,\n array $contactAssociations,\n array $contactsToAdd,\n array $contactsToRemove\n ): void {\n $this->logger->info('[' . $this->getDisplayName() . '] Contact association changes', [\n 'opportunity_id' => $opportunity->getId(),\n 'current_contacts' => $currentContactCrmIds,\n 'new_contacts' => $contactAssociations,\n 'contacts_to_add' => $contactsToAdd,\n 'contacts_to_remove' => $contactsToRemove,\n ]);\n }\n\n private function removeContactAssociations(Opportunity $opportunity, array $contactsToRemove): void\n {\n if (empty($contactsToRemove)) {\n return;\n }\n\n $contactsToDetach = $opportunity->contacts()\n ->whereIn('contacts.crm_provider_id', $contactsToRemove)\n ->pluck('contacts.id')\n ->toArray();\n\n if (! empty($contactsToDetach)) {\n $opportunity->contacts()->detach($contactsToDetach);\n\n $this->logger->info('[' . $this->getDisplayName() . '] Removed contact associations', [\n 'opportunity_id' => $opportunity->getId(),\n 'removed_contact_crm_ids' => $contactsToRemove,\n 'removed_contact_count' => count($contactsToDetach),\n ]);\n }\n }\n\n private function addContactAssociations(Opportunity $opportunity, array $contactsToAdd, array $contactAssociations): void\n {\n if (empty($contactsToAdd)) {\n return;\n }\n\n $contactsAdded = [];\n foreach ($contactsToAdd as $crmId) {\n $id = $contactAssociations[$crmId];\n\n if ($this->attachSingleContact($opportunity, (string) $crmId, $id)) {\n $contactsAdded[] = $crmId;\n }\n }\n\n $this->logAddedContacts($opportunity, $contactsAdded);\n }\n\n private function attachSingleContact(Opportunity $opportunity, string $crmId, int $id): bool\n {\n try {\n $contact = $this->crmEntityRepository->findContactByConfigurationAndId($this->config, $id);\n\n if (! $contact) {\n return false;\n }\n\n return $this->performContactAttachment($opportunity, $contact, $crmId);\n } catch (\\Throwable $e) {\n $this->logger->warning('[' . $this->getDisplayName() . '] Failed to add contact association', [\n 'opportunity_id' => $opportunity->getId(),\n 'contact_crm_id' => $crmId,\n 'error' => $e->getMessage(),\n ]);\n\n return false;\n }\n }\n\n private function performContactAttachment(Opportunity $opportunity, Contact $contact, string $crmId): bool\n {\n try {\n $opportunity->contacts()->attach($contact->getId(), [\n 'crm_provider_id' => $crmId,\n ]);\n\n return true;\n } catch (\\Illuminate\\Database\\QueryException $e) {\n if (str_contains($e->getMessage(), 'Duplicate entry')) {\n $this->logger->info('[' . $this->getDisplayName() . '] Contact association already exists', [\n 'contact_id' => $contact->getId(),\n 'contact_crm_id' => $crmId,\n 'opportunity_id' => $opportunity->getId(),\n ]);\n\n return false;\n }\n\n throw $e;\n }\n }\n\n private function logAddedContacts(Opportunity $opportunity, array $contactsAdded): void\n {\n if (! empty($contactsAdded)) {\n $this->logger->info('[' . $this->getDisplayName() . '] Added contact associations', [\n 'opportunity_id' => $opportunity->getId(),\n 'added_contact_crm_ids' => $contactsAdded,\n 'added_contacts_count' => count($contactsAdded),\n ]);\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"10","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"12","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 69;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01'\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;","depth":4,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM automated_reports where id = 69;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01'\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
460206003225534968
|
-8157820444944723612
|
click
|
accessibility
|
NULL
|
It's the only usage in Project Files
Find Opti It's the only usage in Project Files
Find Options… (⌃⌥⌘N)
text/html
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
#11976 on JY-20553-debug-crm-sync-delays, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
33
2
19
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot\ServiceTraits;
use Carbon\Carbon;
use HubSpot\Client\Crm\Deals\Model\CollectionResponseAssociatedId;
use Jiminny\Exceptions\InvalidArgumentException;
use Jiminny\Models\Account;
use Exception;
use Jiminny\Component\DealInsights\Forecast\Forecast;
use Jiminny\Jobs\Crm\MatchActivitiesToNewOpportunity;
use Jiminny\Models\Contact;
use Jiminny\Models\Crm\BusinessProcess;
use Jiminny\Exceptions\CrmException;
use Jiminny\Models\Opportunity;
use Illuminate\Support\Collection;
use Jiminny\Models\Stage;
use Jiminny\Repositories\Crm\CrmEntityRepository;
use Jiminny\Services\Crm\Hubspot\DealFieldsService;
use Jiminny\Services\Crm\Hubspot\OpportunitySyncStrategy\HubspotSingleSyncStrategy;
use Jiminny\Services\Crm\Hubspot\WebhookSyncBatchProcessor;
use Jiminny\Services\Crm\OpportunitySyncStrategyResolver;
use Jiminny\Utils\CurrencyFormatter;
/**
* Optimized sync methods for better performance
* These methods can be integrated into SyncCrmEntitiesTrait for significant performance gains
*/
trait OpportunitySyncTrait
{
private const int BATCH_SIZE = 100;
private const int BATCH_PROCESS_SIZE = 800;
protected OpportunitySyncStrategyResolver $opportunitySyncStrategyResolver;
protected CrmEntityRepository $crmEntityRepository;
protected DealFieldsService $dealFieldsService;
private ?array $cachedClosedDealStages = null;
private array $cachedBusinessProcesses = [];
private array $cachedStages = [];
public function syncOpportunities(array $parameters, ?string $strategy = null): int
{
$startTime = microtime(true);
$strategies = $this->opportunitySyncStrategyResolver->getStrategies($this->config, $strategy);
$parameters['config'] = $this->config;
$syncCount = 0;
$reportedTotal = 0;
$lastSyncedId = [];
$strategyNames = [];
try {
foreach ($strategies as $strategyName => $syncStrategy) {
$strategyNames[] = $strategyName;
$this->logger->info(
'[' . $this->getDisplayName() . '] Syncing opportunities using strategy: ' . $strategyName,
['team' => $this->team->getId()]
);
$total = 0;
$lastId = null;
$buffer = [];
// HubspotWebhookBatchSyncStrategy returns empty generator, this is for other strategies
foreach ($syncStrategy->fetchOpportunities($parameters, $total, $lastId) as $hsOpportunity) {
$buffer[] = $hsOpportunity;
// process every 800 rows (fits < 1 000 association limit)
if (\count($buffer) >= self::BATCH_PROCESS_SIZE) {
$syncCount += $this->processOpportunityBatch($buffer);
$buffer = [];
}
}
// leftovers
if ($buffer) {
$syncCount += $this->processOpportunityBatch($buffer);
}
$reportedTotal += $total;
$lastSyncedId = $lastId;
}
} catch (\HubSpot\Client\Crm\Deals\ApiException | CrmException $e) {
$this->handleSyncException($e, $parameters);
}
$durationMs = round((microtime(true) - $startTime) * 1000, 2);
$this->logger->info(
'[HubSpot] Synced opportunities',
[
'team' => $this->team->getId(),
'strategies' => implode(',', $strategyNames),
'sync_count' => $syncCount,
'total' => $reportedTotal,
'last_synced_id' => $lastSyncedId,
'duration_ms' => $durationMs,
]
);
return $reportedTotal;
}
private function handleSyncException(\Throwable $e, array $parameters): void
{
if (($parameters['since'] ?? null) instanceof Carbon) {
$parameters['since'] = $parameters['since']->toDateTimeString();
}
$parameters['config'] = $this->config->getId();
$this->logger->warning('[' . $this->getDisplayName() . '] Sync opportunities failed', [
'teamId' => $this->team->getUuid(),
'parameters' => $parameters,
'reason' => $e->getMessage(),
]);
}
/**
* @inheritdoc
*/
public function syncOpportunity(string $crmId): ?Opportunity
{
$strategy = $this->opportunitySyncStrategyResolver->resolve(
$this->config,
OpportunitySyncStrategyResolver::SINGLE_SYNC_OPPORTUNITY_STRATEGY,
);
$parameters = [
'config' => $this->config,
'crm_id' => $crmId,
];
try {
if (! $strategy instanceof HubspotSingleSyncStrategy) {
throw new InvalidArgumentException('Strategy must by HubspotSingleSyncStrategy');
}
$hsOpportunity = $strategy->fetchOpportunity($parameters);
} catch (\HubSpot\Client\Crm\Deals\ApiException $e) {
$this->logger->info('[' . $this->getDisplayName() . '] Opportunity not found', [
'teamId' => $this->team->getUuid(),
'crmId' => $crmId,
'reason' => $e->getMessage(),
]);
return null;
}
$hsOpportunity['associations'] = $this->convertDealAssociations($hsOpportunity['associations'] ?? []);
return $this->importOrUpdateOpportunity($hsOpportunity);
}
/**
* Process webhook-collected opportunity batches.
*
* Drains Redis sets containing company CRM IDs collected from webhook events
* and dispatches ImportOpportunityBatch jobs for batch processing.
*
* @return int Number of opportunity IDs dispatched to jobs
*/
public function batchSyncOpportunities(): int
{
$configId = $this->team->getCrmConfiguration()->getId();
return $this->batchProcessor->processBatchesForObjectType(
WebhookSyncBatchProcessor::OBJECT_TYPE_DEAL,
$configId
);
}
/**
* Import a batch of opportunities by their CRM IDs.
* Fetches opportunity data from HubSpot API and delegates to importOpportunityBatch().
*
* @param array<string> $crmIds HubSpot deal CRM IDs
*
* @return array{success: array, failed_ids: array, errors?: array<string, string>}
*/
public function importOpportunityBatchByIds(array $crmIds): array
{
$fields = $this->dealFieldsService->getFieldsForConfiguration($this->config);
$allDeals = [];
foreach (array_chunk($crmIds, self::BATCH_SIZE) as $chunk) {
$deals = $this->client->getOpportunitiesByIds($chunk, $fields);
foreach ($deals as $deal) {
$allDeals[] = $deal;
}
}
// IDs not returned by HubSpot are likely deleted or inaccessible deals.
// These are not failures — retrying won't bring them back.
$fetchedIds = array_map('strval', array_column($allDeals, 'id'));
$notFoundIds = array_values(array_diff(array_map('strval', $crmIds), $fetchedIds));
if (! empty($notFoundIds)) {
$this->logger->info('[' . $this->getDisplayName() . '] CRM IDs not found in HubSpot (likely deleted)', [
'teamId' => $this->team->getId(),
'notFoundCount' => \count($notFoundIds),
'notFoundIds' => $notFoundIds,
'requestedCount' => \count($crmIds),
'fetchedCount' => \count($allDeals),
]);
}
if (empty($allDeals)) {
return ['success' => [], 'failed_ids' => []];
}
return $this->importOpportunityBatch($allDeals);
}
private function getClosedDealStages(): array
{
if ($this->cachedClosedDealStages !== null) {
return $this->cachedClosedDealStages;
}
$stages = $this->crmEntityRepository->getOpportunityClosedStages($this->config);
$data = [
'lost' => [],
'won' => [],
];
foreach ($stages as $stage) {
if ($stage->probability == 0.00) {
$data['lost'][] = $stage->crm_provider_id;
}
if ($stage->probability == 100.00) {
$data['won'][] = $stage->crm_provider_id;
}
}
$this->cachedClosedDealStages = $data;
return $data;
}
/**
* Import deals into the database with pre-fetched associations.
*
* API calls here (getAssociationsData, getExistingOpportunityCrmIds) are NOT
* caught — if they throw, the exception propagates to ImportOpportunityBatch::handle()
* where Laravel retries the whole job with backoff. After all retries exhausted,
* failed() requeues all IDs to Redis.
*
* The per-deal loop catches exceptions individually. A deal can end up in three states:
* - success: imported/updated successfully
* - failed_ids: exception thrown (DB constraint violation, corrupt data, etc.)
* These are permanent issues — retrying won't fix them.
* - skipped (null): missing dependencies (no account, unknown pipeline/stage).
* This is acceptable — the deal cannot be imported until those exist.
*/
private function importOpportunityBatch(array $deals): array
{
$syncedOpportunities = [
'success' => [],
'failed_ids' => [],
];
$dealIds = array_column($deals, 'id');
// Shared association/existing-ID preparation is batch-level state. If it fails, rethrow so the
// queue job retries the whole batch and eventually requeues all deal IDs back to Redis.
try {
$companyAssociations = $this->client->getAssociationsData($dealIds, 'deals', 'companies');
$contactAssociations = $this->client->getAssociationsData($dealIds, 'deals', 'contacts');
$associationsData = $this->prepareAssociatedEntities($companyAssociations, $contactAssociations);
$existingCrmIds = $this->crmEntityRepository->getExistingOpportunityCrmIds(
$this->config,
array_map('strval', $dealIds)
);
$existingCrmIdSet = array_flip($existingCrmIds);
} catch (\Throwable $e) {
$this->logger->error('[' . $this->getDisplayName() . '] Failed to fetch associations or existing IDs', [
'teamId' => $this->team->getId(),
'dealCount' => count($dealIds),
'error' => $e->getMessage(),
]);
throw $e;
}
foreach ($deals as $deal) {
try {
$deal['associations'] = $this->prepareAssociationsForOpportunity(
$deal['id'],
$companyAssociations,
$contactAssociations,
$associationsData
);
$syncedOpportunity = $this->importOrUpdateOpportunity(
$deal,
isset($existingCrmIdSet[(string) $deal['id']])
);
if ($syncedOpportunity) {
$syncedOpportunities['success'][] = $syncedOpportunity;
}
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Failed to import opportunity', [
'teamId' => $this->team->getId(),
'crmId' => $deal['id'],
'error' => $e->getMessage(),
]);
$syncedOpportunities['failed_ids'][] = $deal['id'];
$syncedOpportunities['errors'][$deal['id']] = $e->getMessage();
}
}
return $syncedOpportunities;
}
/**
* Prepare associated entities for opportunities with optimized batch processing
* Returns structured data with CRM ID to DB ID mappings for each opportunity
*/
private function prepareAssociatedEntities(array $companyAssociations, array $contactAssociations): array
{
// Step 1: Collect all unique company and contact IDs from associations
$allCompanyIds = $this->flattenAssociationIds($companyAssociations);
$allContactIds = $this->flattenAssociationIds($contactAssociations);
// Step 2: Batch sync missing entities and get CRM ID to DB ID mappings
$companyIdMappings = [];
$contactIdMappings = [];
if (! empty($allCompanyIds)) {
$companyIdMappings = $this->prepareAssociatedAccounts($allCompanyIds);
}
if (! empty($allContactIds)) {
$contactIdMappings = $this->prepareAssociatedContacts($allContactIds);
}
return [
'company_id_mappings' => $companyIdMappings,
'contact_id_mappings' => $contactIdMappings,
];
}
/**
* Flatten association data to get unique IDs
*/
private function flattenAssociationIds(array $associations): array
{
$ids = [];
foreach ($associations as $dealAssociations) {
if (is_array($dealAssociations)) {
foreach ($dealAssociations as $id) {
$ids[$id] = true;
}
}
}
return array_keys($ids);
}
/**
* Batch sync missing accounts
*/
private function prepareAssociatedAccounts(array $companyIds): array
{
// Find which accounts already exist
$existingAccounts = $this->crmEntityRepository
->findAccountsByExternalIds($this->config, $companyIds);
$existingCompanyIds = $existingAccounts->pluck('crm_provider_id')->toArray();
$existingAccountsData = $existingAccounts->mapWithKeys(function ($account) {
return [$account->getCrmProviderId() => $account->getId()];
})->toArray();
$missingCompanyIds = array_diff($companyIds, $existingCompanyIds);
if (empty($missingCompanyIds)) {
return $existingAccountsData;
}
$this->logger->info('[' . $this->getDisplayName() . '] Batch syncing missing accounts', [
'teamId' => $this->team->getUuid(),
'total_companies' => count($companyIds),
'existing_companies' => count($existingCompanyIds),
'missing_companies' => count($missingCompanyIds),
]);
// we already have limit on opportunity ids count
// Initialize variable before try block
$syncedAccountsData = [];
try {
$syncedAccountsData = $this->batchSyncCrmObjects('companies', $missingCompanyIds);
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Failed to sync missing accounts', [
'size' => count($missingCompanyIds),
'error' => $e->getMessage(),
]);
$syncedAccountsData = [];
}
return $existingAccountsData + $syncedAccountsData;
}
/**
* Prepare associated contacts - find existing and sync missing ones
* Returns mapping of CRM ID to DB ID
*/
private function prepareAssociatedContacts(array $contactIds): array
{
// Find which contacts already exist
$existingContacts = $this->crmEntityRepository
->findContactsByExternalIds($this->config, $contactIds);
$existingContactIds = $existingContacts->pluck('crm_provider_id')->toArray();
// Create mapping for existing contacts
$existingContactsData = $existingContacts->mapWithKeys(function ($contact) {
return [$contact->getCrmProviderId() => $contact->getId()];
})->toArray();
$missingContactIds = array_diff($contactIds, $existingContactIds);
if (empty($missingContactIds)) {
return $existingContactsData;
}
$this->logger->info('[' . $this->getDisplayName() . '] Batch syncing missing contacts', [
'teamId' => $this->team->getUuid(),
'total_contacts' => count($contactIds),
'existing_contacts' => count($existingContactIds),
'missing_contacts' => count($missingContactIds),
]);
// Sync missing contacts using batch API
try {
$syncedContactsData = $this->batchSyncCrmObjects('contacts', $missingContactIds);
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Failed to sync missing contacts', [
'size' => count($missingContactIds),
'error' => $e->getMessage(),
]);
$syncedContactsData = [];
}
return $existingContactsData + $syncedContactsData;
}
private function batchSyncCrmObjects(string $objectType, array $crmIds): array
{
$syncObjects = [];
$crmObjectIds = array_values($crmIds);
foreach (array_chunk($crmObjectIds, self::BATCH_SIZE) as $chunk) {
try {
$objects = $objectType === 'companies' ?
$this->client->getCompaniesByIds($chunk, $this->getCompanyFields()) :
$this->client->getContactsByIds($chunk, $this->getContactFields());
foreach ($objects as $objectId => $objectData) {
$this->importCrmObject($objectType, (string) $objectId, $objectData, $syncObjects);
}
$this->logger->info('[' . $this->getDisplayName() . '] Batch synced ' . $objectType, [
'requested_count' => count($chunk),
'synced_count' => count($objects),
]);
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Batch ' . $objectType . ' sync failed', [
'ids' => $chunk,
'error' => $e->getMessage(),
]);
}
}
return $syncObjects;
}
private function importCrmObject(string $objectType, string $objectId, mixed $objectData, array &$syncObjects): void
{
try {
$object = $objectType === 'companies' ?
$this->importAccount($objectData) :
$this->importContact($objectData);
if ($object) {
$syncObjects[$object->getCrmProviderId()] = $object->getId();
}
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Failed to import batch ' . $objectType, [
'id' => $objectId,
'error' => $e->getMessage(),
]);
}
}
/**
* Prepare associations for a single opportunity
*
* The return value is an array with the following structure:
* [
* 'companies' => [
* $companyCrmId => $companyId,
* ...
* ],
* 'contacts' => [
* $contactCrmId => $contactId,
* ...
* ],
* 'account_id' => $accountId,
* ]
*/
private function prepareAssociationsForOpportunity(
string $oppCrmId,
array $companyAssociations,
array $contactAssociations,
array $associationsData
): array {
$associations = [
'companies' => [],
'contacts' => [],
'account_id' => null, // Primary account for opportunity
];
$oppCompanyIds = $companyAssociations[$oppCrmId] ?? [];
foreach ($oppCompanyIds as $companyCrmId) {
if (isset($associationsData['company_id_mappings'][$companyCrmId])) {
$associations['companies'][$companyCrmId] = $associationsData['company_id_mappings'][$companyCrmId];
// Set primary account (first company becomes primary account)
if ($associations['account_id'] === null) {
$associations['account_id'] = $associationsData['company_id_mappings'][$companyCrmId];
}
}
}
$oppContactIds = $contactAssociations[$oppCrmId] ?? [];
foreach ($oppContactIds as $contactCrmId) {
if (isset($associationsData['contact_id_mappings'][$contactCrmId])) {
$associations['contacts'][$contactCrmId] = $associationsData['contact_id_mappings'][$contactCrmId];
}
}
return $associations;
}
/**
* Update only associations for an opportunity
*/
private function updateOpportunityAssociations(Opportunity $opportunity, array $associations): void
{
// Update contact associations
$this->importOpportunityContacts($opportunity, $associations['contacts']);
// Update company (account) associations
$this->updateOpportunityAccount($opportunity, $associations['account_id']);
}
/**
* Remove all contact associations from an opportunity
*/
private function removeAllOpportunityContacts(Opportunity $opportunity): void
{
$currentCount = (int) $opportunity->contacts()->count();
if ($currentCount > 0) {
$opportunity->contacts()->detach();
$this->logger->info('[' . $this->getDisplayName() . '] Removed all contact associations', [
'opportunity_id' => $opportunity->getId(),
'removed_count' => $currentCount,
]);
}
}
private function updateOpportunityAccount(Opportunity $opportunity, ?int $accountId): void
{
if ($accountId === null) {
// No account ID provided - keep current account
return;
}
$currentAccountId = $opportunity->getAccountId();
// Only update if account has changed
if ($currentAccountId !== $accountId) {
$opportunity->account_id = $accountId;
$opportunity->save();
$this->logger->info('[' . $this->getDisplayName() . '] Updated opportunity account association', [
'opportunity_id' => $opportunity->getId(),
'old_account_id' => $currentAccountId,
'new_account_id' => $accountId,
]);
}
}
/**
* Find existing opportunities by external IDs (OPTIMIZED VERSION)
* Uses batch query for better performance
*/
private function findExistingOpportunities(array $crmIds): Collection
{
return $this->crmEntityRepository
->findOpportunitiesByExternalIds($this->config, $crmIds);
}
private function processOpportunityBatch(array $opportunities): int
{
$syncedOpportunities = $this->importOpportunityBatch($opportunities);
return count($syncedOpportunities['success'] ?? []);
}
/**
* Convert single deal associations from HubSpot format to internal format
* Handles both HubSpot SDK objects and array formats
*
* @param array $opportunityAssociations Raw associations from HubSpot API or pre-processed
*
* @return array Processed associations with DB IDs
*/
private function convertDealAssociations(array $opportunityAssociations): array
{
$associations = $this->initializeAssociationsStructure();
if (empty($opportunityAssociations)) {
return $associations;
}
$associationIds = $this->extractAssociationIds($opportunityAssociations);
$this->processCompanyAssociations($associationIds, $associations);
$this->processContactAssociations($associationIds, $associations);
return $associations;
}
private function initializeAssociationsStructure(): array
{
return [
'companies' => [],
'contacts' => [],
'account_id' => null, // Primary account for opportunity
];
}
private function extractAssociationIds(array $opportunityAssociations): array
{
$associationIds = [];
foreach ($opportunityAssociations as $type => $associationData) {
if (! empty($associationData)) {
$associationIds[$type] = $this->convertSingleDealAssociations($associationData);
}
}
return $associationIds;
}
private function processCompanyAssociations(array $associationIds, array &$associations): void
{
if (empty($associationIds['companies'])) {
return;
}
$companyId = $associationIds['companies'][0];
$account = $this->findOrSyncAccount($companyId);
if ($account instanceof Account) {
$associations['companies'][$companyId] = $account->getId();
$associations['account_id'] = $account->getId();
}
}
private function processContactAssociations(array $associationIds, array &$associations): void
{
if (empty($associationIds['contacts'])) {
return;
}
foreach ($associationIds['contacts'] as $contactId) {
$contact = $this->findOrSyncContact($contactId);
if ($contact instanceof Contact) {
$associations['contacts'][$contactId] = $contact->getId();
}
}
}
private function findOrSyncAccount(string $companyId): ?Account
{
$account = $this->crmEntityRepository->findAccountByExternalId($this->config, $companyId);
if (! $account instanceof Account) {
$account = $this->syncAccount($companyId);
}
return $account;
}
private function findOrSyncContact(string $contactId): ?Contact
{
$contact = $this->crmEntityRepository->findContactByExternalId($this->config, $contactId);
if (! $contact instanceof Contact) {
$contact = $this->syncContact($contactId);
}
return $contact;
}
private function convertSingleDealAssociations($opportunityAssociations = null): array
{
$associationData = [];
if ($opportunityAssociations === null) {
return $associationData;
}
// Handle array input (from extractAssociationIds)
if (is_array($opportunityAssociations)) {
return $opportunityAssociations;
}
// Handle CollectionResponseAssociatedId object
if ($opportunityAssociations instanceof CollectionResponseAssociatedId) {
foreach ($opportunityAssociations->getResults() as $association) {
$associationData[] = $association->getId();
}
}
return $associationData;
}
private function importOrUpdateOpportunity($crmData, ?bool $exists = null): ?Opportunity
{
if (empty($crmData['properties'])) {
return null;
}
$crmId = (string) $crmData['id'];
$properties = $crmData['properties'];
$associations = $crmData['associations'] ?? [];
$opportunityExists = $exists ?? (bool) $this->crmEntityRepository->findOpportunityByExternalId(
$this->config,
$crmId
);
if ($opportunityExists) {
return $this->updateOpportunity($crmId, $properties, $associations);
}
return $this->createOpportunity($crmId, $properties, $associations);
}
/**
* Create new opportunity
*/
private function createOpportunity(string $crmId, array $properties, array $associations): ?Opportunity
{
$accountId = $this->resolveAccountId($associations);
if (! $accountId) {
return null;
}
$businessProcess = $this->resolveBusinessProcess($properties['pipeline'] ?? null);
if (! $businessProcess) {
return null;
}
$stage = $this->resolveStage($businessProcess, $properties['dealstage'] ?? null);
if (! $stage) {
return null;
}
$data = $this->buildOpportunityData($properties, $accountId, $businessProcess, $stage);
$attributes = [
'crm_configuration_id' => $this->config->getId(),
'crm_provider_id' => $crmId,
];
$values = array_merge($attributes, $data);
$opportunity = $this->crmEntityRepository->upsertOpportunity($attributes, $values);
$this->importExternalFieldData($properties, $opportunity->getId());
$this->importOpportunityContacts($opportunity, $associations['contacts']);
if ($opportunity->wasRecentlyCreated) {
MatchActivitiesToNewOpportunity::dispatch($opportunity->getId());
}
return $opportunity;
}
/**
* Update existing opportunity
*/
private function updateOpportunity(string $crmId, array $properties, array $associations): Opportunity
{
$accountId = $this->resolveAccountId($associations);
$businessProcess = $this->resolveBusinessProcess($properties['pipeline'] ?? null);
$stage = $businessProcess ? $this->resolveStage($businessProcess, $properties['dealstage'] ?? null) : null;
$data = $this->buildOpportunityData($properties, $accountId, $businessProcess, $stage);
$attributes = [
'crm_configuration_id' => $this->config->getId(),
'crm_provider_id' => $crmId,
];
$values = array_merge($attributes, $data);
$opportunity = $this->crmEntityRepository->upsertOpportunity($attributes, $values);
$this->importExternalFieldData($properties, $opportunity->getId());
$this->updateOpportunityAssociations($opportunity, $associations);
return $opportunity;
}
private function resolveAccountId(array $associations): ?int
{
if (! empty($associations['account_id'])) {
return $associations['account_id'];
}
if (empty($associations)) {
return null;
}
// Fallback: use first company as account (currently SDK returns one company)
foreach ($associations['companies'] as $accountId) {
return $accountId;
}
return null;
}
private function buildOpportunityData(
array $properties,
?int $accountId,
?BusinessProcess $businessProcess,
?Stage $stage
): array {
$ownerId = null;
$profile = null;
if (! empty($properties['hubspot_owner_id'])) {
$ownerId = $properties['hubspot_owner_id'];
$profile = $this->crmEntityRepository->findProfileByExternalId($this->config, (string) $ownerId);
}
$name = 'Unknown';
if (isset($properties['dealname'])) {
$name = mb_strimwidth($properties['dealname'], 0, 128);
}
$amount = $this->resolveAmount($properties);
$currency = $properties['deal_currency_code'] ?? null;
$closeDate = null;
if (! empty($properties['closedate'])) {
$closeDate = Carbon::parse($properties['closedate'])->format('Y-m-d');
}
$remotelyCreatedAt = null;
if (! empty($properties['createdate']) && strtotime($properties['createdate'])) {
$date = $this->parseCleanDatetime($properties['createdate']);
$remotelyCreatedAt = $date?->format('Y-m-d H:i:s');
}
$closedStages = $this->getClosedDealStages();
$isWon = in_array($properties['dealstage'], $closedStages['won']);
$isLost = in_array($properties['dealstage'], $closedStages['lost']);
$data = [
'team_id' => $this->team->getId(),
'user_id' => $profile ? $profile->user_id : null,
'owner_id' => $ownerId,
'name' => $name,
'value' => ! empty($amount) ? $amount : null,
'currency_code' => CurrencyFormatter::formatCode($currency),
'close_date' => $closeDate,
'is_closed' => $isWon || $isLost,
'is_won' => $isWon,
'remotely_created_at' => $remotelyCreatedAt,
'probability' => $this->resolveDealProbability($properties['hs_deal_stage_probability']),
'forecast_category' => $this->resolveForecastCategory($properties['hs_manual_forecast_category']),
];
if ($accountId) {
$data['account_id'] = $accountId;
}
if ($stage) {
$data['stage_id'] = $stage->id;
}
if ($businessProcess) {
$recordType = $this->crmEntityRepository->getBusinessProcessRecordType($businessProcess);
if ($recordType) {
$data['record_type_id'] = $recordType->id;
}
}
return $data;
}
private function resolveBusinessProcess(?string $pipelineId): ?BusinessProcess
{
if ($pipelineId === null) {
return null;
}
$cacheKey = $this->getBusinessProcessCacheKey($pipelineId);
if (isset($this->cachedBusinessProcesses[$cacheKey])) {
return $this->cachedBusinessProcesses[$cacheKey];
}
$businessProcess = $this->getBusinessProcess($pipelineId);
if (! $businessProcess instanceof BusinessProcess) {
$this->importStages();
$businessProcess = $this->getBusinessProcess($pipelineId);
}
if (! $businessProcess instanceof BusinessProcess) {
$this->logger->info(
'[HubSpot] Deal is not attached to a pipeline',
[
'pipeline' => $pipelineId]
);
}
$this->cachedBusinessProcesses[$cacheKey] = $businessProcess;
return $businessProcess;
}
private function getBusinessProcess(string $pipelineId): ?BusinessProcess
{
return $this->crmEntityRepository->findBusinessProcessesByExternalId($this->config, $pipelineId);
}
private function getBusinessProcessCacheKey(string $pipelineId): string
{
return $this->config->getId() . '_' . $pipelineId;
}
private function resolveStage(BusinessProcess $businessProcess, ?string $stageId): ?Stage
{
if (empty($stageId)) {
return null;
}
$cacheKey = $businessProcess->getId() . ':' . $stageId;
if (isset($this->cachedStages[$cacheKey])) {
return $this->cachedStages[$cacheKey];
}
$stage = $this->crmEntityRepository->getPipelineStageByConditions(
$businessProcess,
[
'crm_provider_id' => $stageId,
'type' => Stage::TYPE_OPPORTUNITY,
]
);
if ($stage === null) {
$this->importStages(null, $stageId);
}
if ($stage === null) {
$this->logger->info('[HubSpot] Stage does not exist => ' . $stageId);
}
$this->cachedStages[$cacheKey] = $stage;
return $stage;
}
private function resolveAmount(array $properties): ?string
{
$amount = null;
if (! empty($properties['amount'])) {
$amount = str_replace(',', '', $properties['amount']);
}
if ($this->config->hasDefaultCurrencyFieldSet()) {
$valueFieldName = $this->config->getDefaultCurrencyField()->getCrmProviderId();
$amount = $properties[$valueFieldName] ?? $amount;
}
return $amount;
}
private function parseCleanDatetime(string $datetime): ?Carbon
{
// Treat pre-1980 values as invalid
$minValidDate = Carbon::parse('1980-01-01 00:00:00');
try {
$date = Carbon::parse($datetime);
if ($minValidDate->gt($date)) {
return null;
}
return $date;
} catch (Exception) {
return null; // On parse error, treat as null
}
}
private function resolveDealProbability(?string $stageProbability): int
{
if ($stageProbability === null) {
return 0;
}
$probability = (float) $stageProbability;
return $probability > 1 ? 0 : (int) ($probability * 100);
}
private function resolveForecastCategory(?string $forecastCategory): string
{
if (! $forecastCategory) {
return Forecast::FORECAST_CATEGORY_UNCATEGORIZED;
}
$forecastCategory = str_replace('_', ' ', $forecastCategory);
return ucwords(strtolower($forecastCategory));
}
private function importExternalFieldData(array $properties, int $opportunityId): void
{
$crmFields = $this->getOpportunitySyncableFields();
$this->importOpportunityCrmFieldData($properties, $crmFields, $opportunityId);
}
private function importOpportunityContacts(Opportunity $opportunity, array $associations): void
{
// Handle empty or missing contact associations
if (empty($associations)) {
// Remove all existing contact associations if none provided
$this->removeAllOpportunityContacts($opportunity);
return;
}
// Use differential sync approach for better performance and accuracy
$this->syncOpportunityContactsDifferential($opportunity, $associations);
}
/**
* Sync opportunity contacts using differential approach
* This compares current vs new associations and only makes necessary changes
*/
private function syncOpportunityContactsDifferential(Opportunity $opportunity, array $contactAssociations): void
{
$currentContactCrmIds = $this->getCurrentContactCrmIds($opportunity);
$contactAssociationIds = array_keys($contactAssociations);
$contactsToAdd = array_diff($contactAssociationIds, $currentContactCrmIds);
$contactsToRemove = array_diff($currentContactCrmIds, $contactAssociationIds);
if (empty($contactsToAdd) && empty($contactsToRemove)) {
return;
}
$this->logContactAssociationChanges($opportunity, $currentContactCrmIds, $contactAssociations, $contactsToAdd, $contactsToRemove);
$this->removeContactAssociations($opportunity, $contactsToRemove);
$this->addContactAssociations($opportunity, $contactsToAdd, $contactAssociations);
}
private function getCurrentContactCrmIds(Opportunity $opportunity): array
{
return $opportunity->contacts()
->pluck('contacts.crm_provider_id')
->toArray();
}
private function logContactAssociationChanges(
Opportunity $opportunity,
array $currentContactCrmIds,
array $contactAssociations,
array $contactsToAdd,
array $contactsToRemove
): void {
$this->logger->info('[' . $this->getDisplayName() . '] Contact association changes', [
'opportunity_id' => $opportunity->getId(),
'current_contacts' => $currentContactCrmIds,
'new_contacts' => $contactAssociations,
'contacts_to_add' => $contactsToAdd,
'contacts_to_remove' => $contactsToRemove,
]);
}
private function removeContactAssociations(Opportunity $opportunity, array $contactsToRemove): void
{
if (empty($contactsToRemove)) {
return;
}
$contactsToDetach = $opportunity->contacts()
->whereIn('contacts.crm_provider_id', $contactsToRemove)
->pluck('contacts.id')
->toArray();
if (! empty($contactsToDetach)) {
$opportunity->contacts()->detach($contactsToDetach);
$this->logger->info('[' . $this->getDisplayName() . '] Removed contact associations', [
'opportunity_id' => $opportunity->getId(),
'removed_contact_crm_ids' => $contactsToRemove,
'removed_contact_count' => count($contactsToDetach),
]);
}
}
private function addContactAssociations(Opportunity $opportunity, array $contactsToAdd, array $contactAssociations): void
{
if (empty($contactsToAdd)) {
return;
}
$contactsAdded = [];
foreach ($contactsToAdd as $crmId) {
$id = $contactAssociations[$crmId];
if ($this->attachSingleContact($opportunity, (string) $crmId, $id)) {
$contactsAdded[] = $crmId;
}
}
$this->logAddedContacts($opportunity, $contactsAdded);
}
private function attachSingleContact(Opportunity $opportunity, string $crmId, int $id): bool
{
try {
$contact = $this->crmEntityRepository->findContactByConfigurationAndId($this->config, $id);
if (! $contact) {
return false;
}
return $this->performContactAttachment($opportunity, $contact, $crmId);
} catch (\Throwable $e) {
$this->logger->warning('[' . $this->getDisplayName() . '] Failed to add contact association', [
'opportunity_id' => $opportunity->getId(),
'contact_crm_id' => $crmId,
'error' => $e->getMessage(),
]);
return false;
}
}
private function performContactAttachment(Opportunity $opportunity, Contact $contact, string $crmId): bool
{
try {
$opportunity->contacts()->attach($contact->getId(), [
'crm_provider_id' => $crmId,
]);
return true;
} catch (\Illuminate\Database\QueryException $e) {
if (str_contains($e->getMessage(), 'Duplicate entry')) {
$this->logger->info('[' . $this->getDisplayName() . '] Contact association already exists', [
'contact_id' => $contact->getId(),
'contact_crm_id' => $crmId,
'opportunity_id' => $opportunity->getId(),
]);
return false;
}
throw $e;
}
}
private function logAddedContacts(Opportunity $opportunity, array $contactsAdded): void
{
if (! empty($contactsAdded)) {
$this->logger->info('[' . $this->getDisplayName() . '] Added contact associations', [
'opportunity_id' => $opportunity->getId(),
'added_contact_crm_ids' => $contactsAdded,
'added_contacts_count' => count($contactsAdded),
]);
}
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Code changed:
Hide
Sync Changes
Hide This Notification
10
12
2
4
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM automated_reports where id = 69;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_ca...
|
55432
|
|
54306
|
1174
|
3
|
2026-04-20T08:52:41.528869+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-20/1776 /Users/lukas/.screenpipe/data/data/2026-04-20/1776675161528_m2.jpg...
|
PhpStorm
|
faVsco.js – AskJiminnyReportActivityService.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
It's the only usage in Project Files
Find Opti It's the only usage in Project Files
Find Options… (⌃⌥⌘N)
text/html
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Kiosk\AutomatedReports;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityActualDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityUpdatedDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\DealInsights\ClosingPeriodFilter;
use Jiminny\Component\ActivitySearch\Service\ActivitySearch;
use Jiminny\Models\Activity\Search;
use Jiminny\Models\User;
use Jiminny\Repositories\ElasticActivityRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
use Psr\Log\LoggerInterface;
class AskJiminnyReportActivityService
{
private const int DEFAULT_TOP_ACTIVITIES_COUNT = 100;
private const array DATE_FILTER_KEYS = [
ActivityActualDate::PARAM_START_DATE,
ActivityActualDate::PARAM_END_DATE,
ActivityUpdatedDate::PARAM_UPDATED_FROM,
ActivityUpdatedDate::PARAM_UPDATED_TO,
ClosingPeriodFilter::KEY_START_DATE,
ClosingPeriodFilter::KEY_END_DATE,
];
public function __construct(
private readonly ActivitySearch $activitySearch,
private readonly ElasticActivityRepository $elasticRepository,
private readonly LoggerInterface $logger,
) {
}
/**
* Fetch activity IDs for a saved search, passing its filters as-is to Criteria.
* Date filters stored on the saved search are excluded; if no other filters exist,
* no date constraint is applied — matching the behaviour of getContextForAskAnythingByFilter.
*
* @return string[] Activity IDs
*/
public function getActivityIdsForSavedSearch(
Search $savedSearch,
User $user,
): array {
$requestParams = $this->buildRequestParamsFromSearch($savedSearch, $user);
$criteria = Criteria::createFromRequest(
array_merge($requestParams, [
'limit' => self::DEFAULT_TOP_ACTIVITIES_COUNT,
'page' => 1,
'sequence_number' => 1,
]),
$user->getTimezone()
);
$filterSet = $this->activitySearch->getOnDemandPageFilterSet($criteria, $user);
$activityIds = $this->elasticRepository->onDemandSearchIdsOnly($user, $criteria, $filterSet);
$this->logger->info('[AskJiminnyReport] Fetched activity IDs for saved search', [
'saved_search_id' => $savedSearch->getId(),
'user_id' => $user->getId(),
'activity_count' => count($activityIds),
]);
return $activityIds;
}
private function buildRequestParamsFromSearch(Search $savedSearch, User $user): array
{
$params = [];
$arrayFilterKeys = $this->activitySearch->getArrayFilterKeys($user);
foreach ($savedSearch->getFilters() as $filter) {
$key = $filter->getFilterProperty();
$value = $filter->getFilterValue();
if (in_array($key, self::DATE_FILTER_KEYS, true)) {
continue;
}
if (isset($params[$key])) {
$params[$key][] = $value;
} elseif (in_array($key, $arrayFilterKeys, true)) {
$params[$key] = [$value];
} else {
$params[$key] = $value;
}
}
return $params;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a.actual_end_time DESC;
SELECT * FROM tracks WHERE activity_id = 26485995;
select a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 202
# and a.is_internal = 0
and (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type IN ("softphone","softphone-inbound","conference","sms-inbound")
and a.status IN ('completed', 'failed')
# and a.external_id is not null
order by a.actual_end_time desc;
select * from activities a where a.crm_configuration_id = 202
and a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'
# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM teams WHERE name LIKE '%Tourlane%';
SELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_field_data WHERE crm_field_id = 98809;
select * from users where status = 1 AND timezone = 'MDT';
select * from opportunities where id = 3769814;
select * from deal_risks where opportunity_id = 3769814;
select cp.* from crm_profiles cp
join users u on cp.user_id = u.id
join crm_configurations crm on cp.crm_configuration_id = crm.id
where crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';
select * from crm_fields where id = 154575;
select * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';
SELECT * FROM teams WHERE id = 176; # crm 148
select * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;
select * from activity_providers where provider = 'amazon-connect';
select * from crm_fields cf
join crm_configurations crm on crm.id = cf.crm_configuration_id
where crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');
# [PASSWORD_DOTS]
SELECT * FROM users WHERE id IN (15415, 15418);
SELECT * FROM groups WHERE id IN (1805,1806);
SELECT * FROM playbooks WHERE id = 1860;
SELECT * FROM playbook_categories WHERE id = 38634;
SELECT * FROM crm_fields WHERE id = 189962;
SELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 [EMAIL]
SELECT * FROM crm_profiles WHERE user_id = 15415;
SELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';
select * from sidekick_settings where team_id = 472;
SELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418
SELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, [EMAIL]
select * from crm_configurations where id = 218;
SELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765
SELECT * FROM users WHERE id IN (13232, 13230);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
0057R00000EPL5HQAX Inez Ekblad
1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur
SELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);
############################################################################################
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id IN (94491,94493,94498);
SELECT * FROM users WHERE id = 13658;
SELECT * FROM teams WHERE id = 109;
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, [EMAIL]
SELECT * FROM stages WHERE crm_configuration_id = 390;
select * from business_processes where team_id = 481 and crm_configuration_id = 390;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 481
and sa.provider = 'salesforce';
SELECT * FROM users WHERE id = 15780; # team 462
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 462
and sa.provider = 'hubspot';
select * from teams where id = 495;
SELECT * FROM users WHERE id = 15794;
select * from social_accounts where sociable_id = 15794;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752
SELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794
SELECT * FROM activities WHERE crm_configuration_id = 407
and status = 'completed' and type = 'conference'
order by id desc;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from permission_role;
select * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;
SELECT * FROM activities WHERE id = 29512773;
SELECT * FROM activities WHERE id IN (29042721,28991325,29002874);
SELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 407
# and a.id IN (29042721,28991325,29002874);
SELECT * FROM users WHERE id = 15794;
SELECT * FROM users WHERE team_id = 495;
SELECT * FROM social_accounts WHERE sociable_id = 15794;
SELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';
SELECT * FROM contacts WHERE team_id = 495;
SELECT * FROM leads WHERE team_id = 495;
SELECT * FROM accounts WHERE team_id = 495;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 407;
SELECT * FROM crm_fields WHERE crm_configuration_id = 407;
SELECT * FROM crm_configurations WHERE id = 407;
SELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'
and user_id IS NOT NULL and is_closed = 1 and is_won = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103
SELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064
SELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 325
and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085
SELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733
SELECT * FROM activity_summary_logs where activity_id = 28719733;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444
SELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';
SELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630
select * from activities where crm_configuration_id = 356 and lead_id = 841732;
SELECT * from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 356;
select * from activities where crm_configuration_id = 356
and actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'
order by id desc;
select * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;
select * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from team_features where team_id = 260;
select * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;
select * from crm_fields;
select * from crm_layout_entities;
SELECT * FROM teams WHERE name LIKE '%Optable%';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id in (94491,94493,94498);
select * from teams where crm_id IS NULL;
SELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;
# [PASSWORD_DOTS]
select * from team_domains where team_id = 399;
SELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207
select * from calendar_events where id = 5163781;
SELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896
SELECT * FROM participants WHERE activity_id = 29443896;
select * from contacts where crm_configuration_id = 318 and email = '[EMAIL]';
select * from leads where crm_configuration_id = 318 and email = '[EMAIL]';
select * from activities where user_id = 14937 order by created_at ;
select * from users where id = 14937;
select * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';
select * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';
select * from activities a join participants p on a.id = p.activity_id
where crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';
# [PASSWORD_DOTS]
SELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';
SELECT * FROM opportunities WHERE team_id = 379 order by id desc;
SELECT * FROM teams WHERE id = 379;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379 and sociable_id = 13852
and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE id = 307;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 307;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;
SELECT * FROM crm_fields WHERE crm_configuration_id = 307
and id IN (144750,144855,145158,155227);
SELECT * FROM activities;
select * from activities
where created_at > '2025-07-01 00:00:00'
# and created_at < '2025-08-01 00:00:00'
and type not in ('email-outbound', 'email-inbound')
and account_id is null
and contact_id is null
and lead_id is null
and opportunity_id is not null
;
SELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);
SELECT * FROM crm_configurations WHERE id in (335,301,200);
select * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';
SELECT * FROM teams WHERE name LIKE '%Resights%';
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_configurations where provider = 'bullhorn'; # 344
select * from teams where id IN (442);
select * from activities
where crm_configuration_id = 177
and provider = 'amazon-connect'
order by id desc;
# and source <> 'gong';
select * from activity_providers where provider = 'amazon-connect';
SELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;
select * from crm_configurations where store_transcript = 1;
SELECT * FROM teams WHERE id IN (80);
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594
select * from ...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"It's the only usage in Project Files\nFind Options… (⌃⌥⌘N)","depth":2,"bounds":{"left":0.21609043,"top":0.4557063,"width":0.06815159,"height":0.027134877},"value":"It's the only usage in Project Files\nFind Options… (⌃⌥⌘N)","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"bounds":{"left":0.21609043,"top":0.4557063,"width":0.06815159,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"bounds":{"left":0.21609043,"top":0.46927375,"width":0.029587766,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"bounds":{"left":0.24567819,"top":0.46927375,"width":0.019946808,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.12134308,"height":0.025538707},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.7972075,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"RequestGenerateAskJiminnyReportJobTest","depth":6,"bounds":{"left":0.8125,"top":0.019952115,"width":0.10305851,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.37034574,"top":0.2490024,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.38031915,"top":0.2490024,"width":0.00731383,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.38929522,"top":0.24740623,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.39660904,"top":0.24740623,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Kiosk\\AutomatedReports;\n\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityActualDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityUpdatedDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\DealInsights\\ClosingPeriodFilter;\nuse Jiminny\\Component\\ActivitySearch\\Service\\ActivitySearch;\nuse Jiminny\\Models\\Activity\\Search;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ElasticActivityRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\nuse Psr\\Log\\LoggerInterface;\n\nclass AskJiminnyReportActivityService\n{\n private const int DEFAULT_TOP_ACTIVITIES_COUNT = 100;\n\n private const array DATE_FILTER_KEYS = [\n ActivityActualDate::PARAM_START_DATE,\n ActivityActualDate::PARAM_END_DATE,\n ActivityUpdatedDate::PARAM_UPDATED_FROM,\n ActivityUpdatedDate::PARAM_UPDATED_TO,\n ClosingPeriodFilter::KEY_START_DATE,\n ClosingPeriodFilter::KEY_END_DATE,\n ];\n\n public function __construct(\n private readonly ActivitySearch $activitySearch,\n private readonly ElasticActivityRepository $elasticRepository,\n private readonly LoggerInterface $logger,\n ) {\n }\n\n /**\n * Fetch activity IDs for a saved search, passing its filters as-is to Criteria.\n * Date filters stored on the saved search are excluded; if no other filters exist,\n * no date constraint is applied — matching the behaviour of getContextForAskAnythingByFilter.\n *\n * @return string[] Activity IDs\n */\n public function getActivityIdsForSavedSearch(\n Search $savedSearch,\n User $user,\n ): array {\n $requestParams = $this->buildRequestParamsFromSearch($savedSearch, $user);\n\n $criteria = Criteria::createFromRequest(\n array_merge($requestParams, [\n 'limit' => self::DEFAULT_TOP_ACTIVITIES_COUNT,\n 'page' => 1,\n 'sequence_number' => 1,\n ]),\n $user->getTimezone()\n );\n\n $filterSet = $this->activitySearch->getOnDemandPageFilterSet($criteria, $user);\n\n $activityIds = $this->elasticRepository->onDemandSearchIdsOnly($user, $criteria, $filterSet);\n\n $this->logger->info('[AskJiminnyReport] Fetched activity IDs for saved search', [\n 'saved_search_id' => $savedSearch->getId(),\n 'user_id' => $user->getId(),\n 'activity_count' => count($activityIds),\n ]);\n\n return $activityIds;\n }\n\n private function buildRequestParamsFromSearch(Search $savedSearch, User $user): array\n {\n $params = [];\n $arrayFilterKeys = $this->activitySearch->getArrayFilterKeys($user);\n\n foreach ($savedSearch->getFilters() as $filter) {\n $key = $filter->getFilterProperty();\n $value = $filter->getFilterValue();\n\n if (in_array($key, self::DATE_FILTER_KEYS, true)) {\n continue;\n }\n\n if (isset($params[$key])) {\n $params[$key][] = $value;\n } elseif (in_array($key, $arrayFilterKeys, true)) {\n $params[$key] = [$value];\n } else {\n $params[$key] = $value;\n }\n }\n\n return $params;\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Kiosk\\AutomatedReports;\n\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityActualDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\ActivityUpdatedDate;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinition\\DealInsights\\ClosingPeriodFilter;\nuse Jiminny\\Component\\ActivitySearch\\Service\\ActivitySearch;\nuse Jiminny\\Models\\Activity\\Search;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ElasticActivityRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\nuse Psr\\Log\\LoggerInterface;\n\nclass AskJiminnyReportActivityService\n{\n private const int DEFAULT_TOP_ACTIVITIES_COUNT = 100;\n\n private const array DATE_FILTER_KEYS = [\n ActivityActualDate::PARAM_START_DATE,\n ActivityActualDate::PARAM_END_DATE,\n ActivityUpdatedDate::PARAM_UPDATED_FROM,\n ActivityUpdatedDate::PARAM_UPDATED_TO,\n ClosingPeriodFilter::KEY_START_DATE,\n ClosingPeriodFilter::KEY_END_DATE,\n ];\n\n public function __construct(\n private readonly ActivitySearch $activitySearch,\n private readonly ElasticActivityRepository $elasticRepository,\n private readonly LoggerInterface $logger,\n ) {\n }\n\n /**\n * Fetch activity IDs for a saved search, passing its filters as-is to Criteria.\n * Date filters stored on the saved search are excluded; if no other filters exist,\n * no date constraint is applied — matching the behaviour of getContextForAskAnythingByFilter.\n *\n * @return string[] Activity IDs\n */\n public function getActivityIdsForSavedSearch(\n Search $savedSearch,\n User $user,\n ): array {\n $requestParams = $this->buildRequestParamsFromSearch($savedSearch, $user);\n\n $criteria = Criteria::createFromRequest(\n array_merge($requestParams, [\n 'limit' => self::DEFAULT_TOP_ACTIVITIES_COUNT,\n 'page' => 1,\n 'sequence_number' => 1,\n ]),\n $user->getTimezone()\n );\n\n $filterSet = $this->activitySearch->getOnDemandPageFilterSet($criteria, $user);\n\n $activityIds = $this->elasticRepository->onDemandSearchIdsOnly($user, $criteria, $filterSet);\n\n $this->logger->info('[AskJiminnyReport] Fetched activity IDs for saved search', [\n 'saved_search_id' => $savedSearch->getId(),\n 'user_id' => $user->getId(),\n 'activity_count' => count($activityIds),\n ]);\n\n return $activityIds;\n }\n\n private function buildRequestParamsFromSearch(Search $savedSearch, User $user): array\n {\n $params = [];\n $arrayFilterKeys = $this->activitySearch->getArrayFilterKeys($user);\n\n foreach ($savedSearch->getFilters() as $filter) {\n $key = $filter->getFilterProperty();\n $value = $filter->getFilterValue();\n\n if (in_array($key, self::DATE_FILTER_KEYS, true)) {\n continue;\n }\n\n if (isset($params[$key])) {\n $params[$key][] = $value;\n } elseif (in_array($key, $arrayFilterKeys, true)) {\n $params[$key] = [$value];\n } else {\n $params[$key] = $value;\n }\n }\n\n return $params;\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.40492022,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.41356382,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.4331782,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.4418218,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.45279256,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.4637633,"top":0.09896249,"width":0.024268618,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.49035904,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.5013298,"top":0.09896249,"width":0.029587766,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.69913566,"top":0.09896249,"width":0.02825798,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"27","depth":4,"bounds":{"left":0.6565825,"top":0.123703115,"width":0.009973404,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"bounds":{"left":0.66855055,"top":0.123703115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"23","depth":4,"bounds":{"left":0.67852396,"top":0.123703115,"width":0.010305851,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.69082445,"top":0.123703115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"105","depth":4,"bounds":{"left":0.70079786,"top":0.123703115,"width":0.011968086,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.7144282,"top":0.12210695,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.72174203,"top":0.12210695,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 2288;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","depth":4,"value":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 2288;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5950084694732905755
|
2146738311620114029
|
visual_change
|
accessibility
|
NULL
|
It's the only usage in Project Files
Find Opti It's the only usage in Project Files
Find Options… (⌃⌥⌘N)
text/html
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Kiosk\AutomatedReports;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityActualDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\ActivityUpdatedDate;
use Jiminny\Component\ActivitySearch\FilterDefinition\DealInsights\ClosingPeriodFilter;
use Jiminny\Component\ActivitySearch\Service\ActivitySearch;
use Jiminny\Models\Activity\Search;
use Jiminny\Models\User;
use Jiminny\Repositories\ElasticActivityRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
use Psr\Log\LoggerInterface;
class AskJiminnyReportActivityService
{
private const int DEFAULT_TOP_ACTIVITIES_COUNT = 100;
private const array DATE_FILTER_KEYS = [
ActivityActualDate::PARAM_START_DATE,
ActivityActualDate::PARAM_END_DATE,
ActivityUpdatedDate::PARAM_UPDATED_FROM,
ActivityUpdatedDate::PARAM_UPDATED_TO,
ClosingPeriodFilter::KEY_START_DATE,
ClosingPeriodFilter::KEY_END_DATE,
];
public function __construct(
private readonly ActivitySearch $activitySearch,
private readonly ElasticActivityRepository $elasticRepository,
private readonly LoggerInterface $logger,
) {
}
/**
* Fetch activity IDs for a saved search, passing its filters as-is to Criteria.
* Date filters stored on the saved search are excluded; if no other filters exist,
* no date constraint is applied — matching the behaviour of getContextForAskAnythingByFilter.
*
* @return string[] Activity IDs
*/
public function getActivityIdsForSavedSearch(
Search $savedSearch,
User $user,
): array {
$requestParams = $this->buildRequestParamsFromSearch($savedSearch, $user);
$criteria = Criteria::createFromRequest(
array_merge($requestParams, [
'limit' => self::DEFAULT_TOP_ACTIVITIES_COUNT,
'page' => 1,
'sequence_number' => 1,
]),
$user->getTimezone()
);
$filterSet = $this->activitySearch->getOnDemandPageFilterSet($criteria, $user);
$activityIds = $this->elasticRepository->onDemandSearchIdsOnly($user, $criteria, $filterSet);
$this->logger->info('[AskJiminnyReport] Fetched activity IDs for saved search', [
'saved_search_id' => $savedSearch->getId(),
'user_id' => $user->getId(),
'activity_count' => count($activityIds),
]);
return $activityIds;
}
private function buildRequestParamsFromSearch(Search $savedSearch, User $user): array
{
$params = [];
$arrayFilterKeys = $this->activitySearch->getArrayFilterKeys($user);
foreach ($savedSearch->getFilters() as $filter) {
$key = $filter->getFilterProperty();
$value = $filter->getFilterValue();
if (in_array($key, self::DATE_FILTER_KEYS, true)) {
continue;
}
if (isset($params[$key])) {
$params[$key][] = $value;
} elseif (in_array($key, $arrayFilterKeys, true)) {
$params[$key] = [$value];
} else {
$params[$key] = $value;
}
}
return $params;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a.actual_end_time DESC;
SELECT * FROM tracks WHERE activity_id = 26485995;
select a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 202
# and a.is_internal = 0
and (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type IN ("softphone","softphone-inbound","conference","sms-inbound")
and a.status IN ('completed', 'failed')
# and a.external_id is not null
order by a.actual_end_time desc;
select * from activities a where a.crm_configuration_id = 202
and a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'
# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM teams WHERE name LIKE '%Tourlane%';
SELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_field_data WHERE crm_field_id = 98809;
select * from users where status = 1 AND timezone = 'MDT';
select * from opportunities where id = 3769814;
select * from deal_risks where opportunity_id = 3769814;
select cp.* from crm_profiles cp
join users u on cp.user_id = u.id
join crm_configurations crm on cp.crm_configuration_id = crm.id
where crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';
select * from crm_fields where id = 154575;
select * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';
SELECT * FROM teams WHERE id = 176; # crm 148
select * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;
select * from activity_providers where provider = 'amazon-connect';
select * from crm_fields cf
join crm_configurations crm on crm.id = cf.crm_configuration_id
where crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');
# [PASSWORD_DOTS]
SELECT * FROM users WHERE id IN (15415, 15418);
SELECT * FROM groups WHERE id IN (1805,1806);
SELECT * FROM playbooks WHERE id = 1860;
SELECT * FROM playbook_categories WHERE id = 38634;
SELECT * FROM crm_fields WHERE id = 189962;
SELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 [EMAIL]
SELECT * FROM crm_profiles WHERE user_id = 15415;
SELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';
select * from sidekick_settings where team_id = 472;
SELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418
SELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, [EMAIL]
select * from crm_configurations where id = 218;
SELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765
SELECT * FROM users WHERE id IN (13232, 13230);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
0057R00000EPL5HQAX Inez Ekblad
1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur
SELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);
############################################################################################
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id IN (94491,94493,94498);
SELECT * FROM users WHERE id = 13658;
SELECT * FROM teams WHERE id = 109;
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, [EMAIL]
SELECT * FROM stages WHERE crm_configuration_id = 390;
select * from business_processes where team_id = 481 and crm_configuration_id = 390;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 481
and sa.provider = 'salesforce';
SELECT * FROM users WHERE id = 15780; # team 462
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 462
and sa.provider = 'hubspot';
select * from teams where id = 495;
SELECT * FROM users WHERE id = 15794;
select * from social_accounts where sociable_id = 15794;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752
SELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794
SELECT * FROM activities WHERE crm_configuration_id = 407
and status = 'completed' and type = 'conference'
order by id desc;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from permission_role;
select * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;
SELECT * FROM activities WHERE id = 29512773;
SELECT * FROM activities WHERE id IN (29042721,28991325,29002874);
SELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 407
# and a.id IN (29042721,28991325,29002874);
SELECT * FROM users WHERE id = 15794;
SELECT * FROM users WHERE team_id = 495;
SELECT * FROM social_accounts WHERE sociable_id = 15794;
SELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';
SELECT * FROM contacts WHERE team_id = 495;
SELECT * FROM leads WHERE team_id = 495;
SELECT * FROM accounts WHERE team_id = 495;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 407;
SELECT * FROM crm_fields WHERE crm_configuration_id = 407;
SELECT * FROM crm_configurations WHERE id = 407;
SELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'
and user_id IS NOT NULL and is_closed = 1 and is_won = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103
SELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064
SELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 325
and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085
SELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733
SELECT * FROM activity_summary_logs where activity_id = 28719733;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444
SELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';
SELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630
select * from activities where crm_configuration_id = 356 and lead_id = 841732;
SELECT * from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 356;
select * from activities where crm_configuration_id = 356
and actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'
order by id desc;
select * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;
select * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from team_features where team_id = 260;
select * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;
select * from crm_fields;
select * from crm_layout_entities;
SELECT * FROM teams WHERE name LIKE '%Optable%';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id in (94491,94493,94498);
select * from teams where crm_id IS NULL;
SELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;
# [PASSWORD_DOTS]
select * from team_domains where team_id = 399;
SELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207
select * from calendar_events where id = 5163781;
SELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896
SELECT * FROM participants WHERE activity_id = 29443896;
select * from contacts where crm_configuration_id = 318 and email = '[EMAIL]';
select * from leads where crm_configuration_id = 318 and email = '[EMAIL]';
select * from activities where user_id = 14937 order by created_at ;
select * from users where id = 14937;
select * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';
select * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';
select * from activities a join participants p on a.id = p.activity_id
where crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';
# [PASSWORD_DOTS]
SELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';
SELECT * FROM opportunities WHERE team_id = 379 order by id desc;
SELECT * FROM teams WHERE id = 379;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379 and sociable_id = 13852
and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE id = 307;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 307;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;
SELECT * FROM crm_fields WHERE crm_configuration_id = 307
and id IN (144750,144855,145158,155227);
SELECT * FROM activities;
select * from activities
where created_at > '2025-07-01 00:00:00'
# and created_at < '2025-08-01 00:00:00'
and type not in ('email-outbound', 'email-inbound')
and account_id is null
and contact_id is null
and lead_id is null
and opportunity_id is not null
;
SELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);
SELECT * FROM crm_configurations WHERE id in (335,301,200);
select * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';
SELECT * FROM teams WHERE name LIKE '%Resights%';
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_configurations where provider = 'bullhorn'; # 344
select * from teams where id IN (442);
select * from activities
where crm_configuration_id = 177
and provider = 'amazon-connect'
order by id desc;
# and source <> 'gong';
select * from activity_providers where provider = 'amazon-connect';
SELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;
select * from crm_configurations where store_transcript = 1;
SELECT * FROM teams WHERE id IN (80);
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594
select * from ...
|
54305
|
|
55628
|
1200
|
4
|
2026-04-20T09:59:36.481161+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-20/1776 /Users/lukas/.screenpipe/data/data/2026-04-20/1776679176481_m2.jpg...
|
PhpStorm
|
faVsco.js – BaseService.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
It's the only usage in Project Files
Find Opti It's the only usage in Project Files
Find Options… (⌃⌥⌘N)
text/html
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
#11976 on JY-20553-debug-crm-sync-delays, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
19
2
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Services\Crm;
use Illuminate\Support\Collection;
use Jiminny\Component\Transcription\Service\TranscriptionService;
use Jiminny\Contracts\Services\Crm\ClientInterface;
use Jiminny\Contracts\Services\Crm\ConnectionStateInterface;
use Jiminny\Contracts\Services\Crm\Provider\HubspotInterface;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\Contracts\Services\Crm\SettingsInterface;
use Jiminny\Contracts\Services\Crm\SupportsObjectTypeParseInterface;
use Jiminny\Contracts\Services\Crm\SyncCrmEntitiesInterface;
use Jiminny\Exceptions\HttpBadRequestException;
use Jiminny\Exceptions\HttpNotFoundException;
use Jiminny\Exceptions\LogicException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Integrations\PlaybookResolver;
use Jiminny\Jobs\Crm\SyncFieldMetadata;
use Jiminny\Models;
use Jiminny\Models\Activity;
use Jiminny\Models\Crm\Configuration;
use Jiminny\Models\Crm\Field;
use Jiminny\Models\Crm\FieldData;
use Jiminny\Models\Crm\FieldValue;
use Jiminny\Models\Crm\Layout;
use Jiminny\Models\Crm\Profile;
use Jiminny\Models\Lead;
use Jiminny\Models\Playbook;
use Jiminny\Models\PlaybookCategory;
use Jiminny\Models\SocialAccount;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\Crm\Helpers\ConnectionStateTrait;
use Jiminny\Services\Crm\Helpers\OpportunitySyncableFieldsTrait;
use Jiminny\Services\TeamService;
use Psr\Log\LoggerInterface;
use Sentry\State\Scope;
abstract class BaseService implements
ServiceInterface,
SettingsInterface,
SyncCrmEntitiesInterface,
ConnectionStateInterface
{
use ConnectionStateTrait;
use OpportunitySyncableFieldsTrait;
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const int SOFT_DELETE_CHUNK = 100;
public const int HARD_DELETE_CHUNK = 1000;
public ?Configuration $config;
public ?Profile $profile;
public ?Team $team = null;
/**
* @var ClientInterface
*/
protected $client;
/**
* @var TeamService
*/
protected TeamService $teamService;
/**
* @var int
*/
protected int $limit;
/**
* @var int
*/
protected int $offset;
/**
* Transcription Service instance.
*
* @var TranscriptionService
*/
protected TranscriptionService $transcriptionService;
protected LoggerInterface $logger;
/**
* Cache for opportunity fields to avoid N+1 queries during batch imports.
* Key: crm_provider_id, Value: Field model with entities relation.
* Cleared when configuration changes.
*
* @var Collection<string, Field>|null
*/
private ?Collection $cachedOpportunityFields = null;
public function __construct()
{
$this->teamService = app(TeamService::class);
$this->transcriptionService = app(TranscriptionService::class);
$this->logger = app(LoggerInterface::class);
}
/**
* @param User $user
*
* @throws SocialAccountTokenInvalidException
*/
public function setUser(User $user): void
{
$this->configureSentryScope($user);
$this->team = $user->team;
$this->teamService->setTeam($user->team);
$this->setConfiguration($user->team->crm);
// Reset state.
$this->profile = $user->crmProfile;
/**
* DO NOT DELETE THIS `clearTokens` CALL
* The purpose of purging tokens is to fix a problem in importing calendar events.
* Calendar Import doesn't always respect "SocialAccountInvalidTokenException" exception
* and may try to recycle old SF instance, with wrong credentials (by ignoring the exception).
*
* This code guarantees the CRM Service is unusable, unless always provided with a valid social account.
*/
if (method_exists($this->client, 'clearTokens')) {
$this->client->clearTokens();
}
$account = $this->getOAuthAccount($user);
$this->validateUserAccountExists($user, $account);
if (method_exists($this->client, 'setOAuthAccount')) {
$this->client->setOAuthAccount($account);
}
if (method_exists($this->client, 'setLogger')) {
$this->client->setLogger($this->logger);
}
if ($this->profile === null) {
// Try to fetch their profile, maybe it was not yet imported?
$cacheKey = sprintf('crm_profile_sync-%s', $user->getId());
$lock = \Cache::lock($cacheKey, 300);
if ($lock->get()) {
$this->profile = $this->getProfile($user);
}
}
// The CRM Service is properly bootstrapped, and supports remote operations
$this->connect();
}
protected function configureSentryScope(User $user): void
{
\Sentry\configureScope(function (Scope $scope) use ($user): void {
$scope->setTag('team_id', (string) $user->getTeamId());
$scope->setUser([
'id' => $user->getId(),
'email' => $user->getEmailAddress(),
]);
});
}
/**
* @param User $user
*
* @return Profile|null
*/
protected function getProfile(User $user): ?Profile
{
return $this->syncProfiles($user);
}
public function getConfiguration(): Configuration
{
return $this->config;
}
public function setConfiguration(Configuration $config): void
{
$this->config = $config;
$this->client->setConfiguration($config);
// Clear field cache when configuration changes to ensure fresh data for new team/config
$this->cachedOpportunityFields = null;
if ($this->team === null) {
$this->team = $config->team;
}
}
public function setPage(int $limit, int $offset): void
{
$this->limit = $limit;
$this->offset = $offset;
}
abstract protected function getOAuthAccount(User $user): ?SocialAccount;
abstract protected function getDefaultFollowupLayoutFields(string $activityType): array;
abstract protected function getFieldTypes(): array;
abstract protected function getFields(string $fieldType): array;
public function syncFields(): void
{
foreach ($this->getFieldTypes() as $fieldType) {
$currentFields = $this->getFields($fieldType);
// TODO: only sync the field once a day if we don't use it in any layout. If we do, sync hourly?
foreach ($currentFields as $field) {
/** @var Models\Crm\Field $field */
$field = $this->config->fields()->updateOrCreate([
'crm_provider_id' => mb_strimwidth($field['name'], 0, 128),
'object_type' => $fieldType,
], [
'label' => mb_strimwidth($field['label'], 0, Field::LABEL_MAX_LENGTH),
]);
try {
$this->syncField($field);
if ($field->type === Models\Crm\Field::TYPE_PICKLIST) {
$this->importPicklistValues($field);
}
} catch (HttpNotFoundException $e) {
$this->logger->error('[sync-fields] Field not found', [
'provider' => $this->getDisplayName(),
'crm_field' => $field->crm_provider_id,
'object_type' => $field->object_type,
'team_id' => $this->team->id,
]);
} catch (HttpBadRequestException $e) {
$this->logger->error('[sync-fields] Field not supported', [
'provider' => $this->getDisplayName(),
'crm_field' => $field->crm_provider_id,
'object_type' => $field->object_type,
'team_id' => $this->team->id,
]);
}
}
}
}
/**
* @param string $objectId
* @param ?string $objectType
*
* @return array
*/
public function parseRecords(string $objectId, ?string $objectType = null): array
{
if ($objectType === null && $this instanceof SupportsObjectTypeParseInterface) {
$objectType = $this->parseObjectType($objectId);
}
$lead = null;
$contact = null;
$opportunity = null;
$account = null;
$stage = null;
$countryCode = null;
// Gather the prospect data to store on activity/participant.
switch ($objectType) {
case self::OBJECT_LEAD:
/** @var ?Lead $lead */
$lead = $this->config->leads()->where('crm_provider_id', $objectId)->first();
if ($lead === null) {
$lead = $this->syncLead($objectId);
}
if ($lead?->country_code) {
$countryCode = $lead->country_code;
}
$stage = $lead?->stage;
break;
case self::OBJECT_ACCOUNT:
$account = $this->config->accounts()->where('crm_provider_id', $objectId)->first();
if ($account === null) {
$account = $this->syncAccount($objectId);
}
if ($account->country_code) {
$countryCode = $account->country_code;
}
break;
case self::OBJECT_CONTACT:
$contact = $this->config->contacts()->where('crm_provider_id', $objectId)->first();
if ($contact === null) {
$contact = $this->syncContact($objectId);
}
if ($contact?->country_code) {
$countryCode = $contact->country_code;
}
$account = $contact?->account;
break;
case self::OBJECT_OPPORTUNITY:
$opportunity = $this->config->opportunities()->where('crm_provider_id', $objectId)->first();
if ($opportunity === null) {
$opportunity = $this->syncOpportunity($objectId);
}
if ($opportunity !== null) {
$stage = $opportunity->stage;
$account = $opportunity->account;
if ($account->country_code) {
$countryCode = $account->country_code;
}
}
break;
}
return [
$lead,
$account,
$opportunity,
$contact,
$stage,
$countryCode,
];
}
/**
* @param null|string $name
*
* @return null|string
*/
public function convertCountryNameToCode(?string $name): ?string
{
return app(CountryCodeResolver::class)->resolveCountryCode($name);
}
/**
* @param PlaybookCategory $category
*
* @return bool
*/
public function matchesCrmType(PlaybookCategory $category): bool
{
if ($category->playbook === null) {
return false;
}
if ($category->getPlaybook()->getActivityField() === null) {
return false;
}
$fieldValue = $category
->playbook
->activityField
->values()
->where('label', $category->name);
// Check the field values for a matching option.
return $fieldValue->exists();
}
/**
* @param PlaybookCategory $category
*
* @return FieldValue|null
*/
public function getCrmType(PlaybookCategory $category): ?FieldValue
{
$fieldValue = $category
->playbook
->activityField
->values()
->where('label', $category->name);
return $fieldValue->first();
}
/**
* @return int|float|string
*/
public function getMinimumApiVersion(): int|float|string
{
return $this->client->getMinimumApiVersion();
}
/**
* @param string $accountId
*
* @return bool
*/
protected function hasAccount(string $accountId): bool
{
return $this->config->accounts()->where('crm_provider_id', $accountId)->exists();
}
/**
* @param string $opportunityId
*
* @return bool
*/
protected function hasOpportunity(string $opportunityId): bool
{
return $this->config->opportunities()->where('crm_provider_id', $opportunityId)->exists();
}
/**
* @param string $contactId
*
* @return bool
*/
protected function hasContact(string $contactId): bool
{
return $this->config->contacts()->where('crm_provider_id', $contactId)->exists();
}
/**
* @param string $leadId
*
* @return bool
*/
protected function hasLead(string $leadId): bool
{
return $this->config->leads()->where('crm_provider_id', $leadId)->exists();
}
public function fetchAndAssociateRelatedActivity(Activity $activity): ?Activity
{
return null;
}
public function getJobDelay(): int
{
return 0;
}
public function getPlaybookFromActivity(Activity $activity): ?Playbook
{
if ($activity->hasActivityType() && $activity->getActivityType()->hasPlaybook()) {
return $activity->getActivityType()->getPlaybook();
}
return $this->getPlaybook($activity->getUser());
}
/**
* Gets the playbook for the user
*/
protected function getPlaybook(User $user): ?Playbook
{
$playbookResolver = app(PlaybookResolver::class);
return $playbookResolver->resolvePlaybookByUser($user);
}
/**
* @param Models\Playbook $playbook
* @param string $categoryName
*
* @return Models\PlaybookCategory|null
*/
protected function getPlaybookCategory(Models\Playbook $playbook, string $categoryName): ?Models\PlaybookCategory
{
return $playbook->categories()
->where('name', trim($categoryName))
->latest()
->first();
}
public function buildLayout(Layout $layout, ?string $activityType): void
{
if ($activityType) {
// Base section. Currently, the fields within are hard coded so this is empty for now.
/** @var Models\Crm\LayoutEntity $activitySection */
$activitySection = $layout->entities()->create([
'label' => 'activity-summary',
'description' => 'Activity Summary',
'sequence' => 0,
]);
if ($this instanceof HubspotInterface) {
$activityFields = $this->getDefaultActivityLayoutFields($activityType, $layout->type);
foreach ($activityFields as $i => $field) {
$layout->entities()->create([
'parent_entity_id' => $activitySection->getId(),
'crm_field_id' => $field->getId(),
'sequence' => $i,
]);
}
}
// Follow-up section. These are all dynamic fields.
$sectionTitle = ($layout->type === Layout::TYPE_CONFERENCE_SUMMARY ? 'Next Steps...' : 'Follow up?');
/** @var Models\Crm\LayoutEntity $followupSection */
$followupSection = $layout->entities()->create([
'label' => 'follow-up',
'description' => $sectionTitle,
'sequence' => 1,
]);
$followupFields = $this->getDefaultFollowupLayoutFields($activityType);
foreach ($followupFields as $i => $field) {
$layout->entities()->create([
'parent_entity_id' => $followupSection->getId(),
'crm_field_id' => $field->getId(),
'sequence' => $i,
]);
}
} elseif ($layout->type == Layout::TYPE_DEAL_INSIGHTS) {
$this->populateLayoutEntities($layout);
}
}
protected function populateLayoutEntities(Layout $layout): void
{
$dealFields = $this->getDefaultDealLayoutFields();
foreach ($dealFields as $i => $field) {
$readOnly = $field->getType() === Field::TYPE_CURRENCY
|| $this->isBusinessTypeField($field);
$layout->entities()->updateOrCreate([
'crm_field_id' => $field->id,
], [
'sequence' => $i,
'read_only' => $readOnly,
]);
}
}
public function prepareValueForUpdate(array $params): array
{
$fieldName = $params['fieldName'];
$fieldValue = $params['fieldValue'];
return [$fieldName => $fieldValue];
}
protected function getDefaultDealLayoutFields(): array
{
$fieldData = $this->getDealInsightsFields();
$fields = [];
foreach ($fieldData as $data) {
/** @var Field $field */
$field = $this->config->fields()->updateOrCreate([
'crm_provider_id' => $data['crm_provider_id'],
'object_type' => $data['object_type'],
], ['label' => $data['crm_provider_id']]);
try {
dispatch_sync(new SyncFieldMetadata($this->config->team, $field));
$field->refresh();
} catch (\Throwable $throwable) {
\Sentry::captureException($throwable);
}
$fields[] = $field;
}
return $fields;
}
public function importOpportunityCrmFieldData(array $crmData, array $crmFields, int $opportunityId): void
{
// Pre-fetch all opportunity fields once per batch to avoid N+1 queries.
// During webhook floods, this reduces DB queries from O(fields × deals) to O(1) for field lookups.
$fieldsMap = $this->getOpportunityFieldsMap();
foreach ($crmFields as $fieldName) {
$field = $fieldsMap->get($fieldName);
if (! $field instanceof Field) {
$this->logger->warning('Field not found', [
'field' => $fieldName,
'opportunity_id' => $opportunityId,
]);
continue;
}
// A CRM field data will be synced only if the field exists as part of at least one layout,
// i.e. an entity related to the field exists.
$entity = $field->entities->first();
if (! $entity instanceof Models\Crm\LayoutEntity) {
continue;
}
$fieldValue = $crmData[$fieldName] ?? '';
if (is_object($fieldValue)) {
$this->logger->warning('Field value is an object', [
'field' => $fieldName,
]);
continue;
}
$value = $this->normalizeValue($field->type, $fieldValue, true);
FieldData::updateOrCreate([
'crm_layout_entity_id' => $entity->id,
'crm_field_id' => $field->id,
'object_type' => 'opportunity',
'object_id' => $opportunityId,
], ['value' => $value]);
}
}
/**
* Get cached opportunity fields map for efficient lookups during batch imports.
*
* This method fetches all opportunity fields with their entities relation ONCE
* and caches them for the lifetime of this service instance. This eliminates
* the N+1 query problem where each field was fetched individually per deal.
*
* Performance impact:
* - Before: 10 fields × 100 deals = 1,000 field queries per batch
* - After: 1 query per batch (regardless of deal count)
*
* @return Collection<string, Field> Fields keyed by crm_provider_id
*/
private function getOpportunityFieldsMap(): Collection
{
if ($this->cachedOpportunityFields === null) {
$this->cachedOpportunityFields = $this->config->fields()
->with('entities')
->where('object_type', '=', self::OBJECT_OPPORTUNITY)
->get()
->keyBy('crm_provider_id');
}
return $this->cachedOpportunityFields;
}
/**
* @param array<mixed> $crmData
* @param Collection $crmFields
* @param int $objectId
*
* @return void
*/
public function importCrmFieldData(array $crmData, Collection $crmFields, int $objectId): void
{
/** @var Field $crmField */
foreach ($crmFields as $crmField) {
// If the field name does not match one we are interested in, skip.
if (array_key_exists($crmField->crm_provider_id, $crmData) === false) {
continue;
}
/** @var string $fieldValue */
$fieldValue = $crmData[$crmField->crm_provider_id];
$value = $this->normalizeValue($crmField->type, $fieldValue, true);
FieldData::updateOrCreate([
'crm_field_id' => $crmField->id,
'object_type' => $crmField->object_type,
'object_id' => $objectId,
], ['value' => $value]);
}
}
protected function getTeam(): Team
{
if (! $this->team instanceof Team) {
throw new LogicException('Expecting team model instance');
}
return $this->team;
}
public function isBusinessTypeField(Field $field): bool
{
return in_array($field->crm_provider_id, Field::BUSINESS_TYPE_FIELDS)
&& $field->object_type === Field::OBJECT_OPPORTUNITY;
}
/**
* @return mixed[]
*/
public function fetchRelatedActivity(Activity $activity): array
{
return [];
}
/**
* @throws SocialAccountTokenInvalidException
*/
private function validateUserAccountExists(User $user, ?SocialAccount $account = null): void
{
if ($account instanceof SocialAccount && $account->state === SocialAccount::STATE_CONNECTED) {
return;
}
$this->logger->warning(
sprintf('[%s] Account not connected for user', $this->getDisplayName()),
[
'userId' => $user->getIdString(),
'account' => $account,
]
);
// If their profile was never setup in the first place
if ($this->profile === null) {
// Create a dummy in-memory profile just to be able to run
$this->profile = new Profile();
}
if (! $account instanceof SocialAccount) {
throw new SocialAccountTokenInvalidException(
sprintf(
'Social account for %s cannot be found. Please login to Jiminny to connect.',
$this->getDisplayName()
)
);
}
throw new SocialAccountTokenInvalidException(
sprintf(
'Your %s account has become disconnected. Please login to Jiminny to reconnect.',
$this->getDisplayName()
)
);
}
public function listSupportedObjectTypes(): array
{
return $this->getFieldTypes();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Code changed:
Hide
Sync Changes
Hide This Notification
6
1
6
Previous Highlighted Error
Next Highlighted Error
# [PASSWORD_DOTS] HS [PASSWORD_DOTS]
select * from teams where id = 2; # 2
select * from features; # 2
select * from team_features where team_id = 2; # 2
select * from crm_configurations where id = 2; # 2
select * from users where team_id = 2; #
select * from playbooks where team_id = 2; # event 38
select * from playbook_categories where playbook_id = 38; #
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id is not null order by id desc;
https://app.hubspot.com/contacts/4392066/deal/16964514951/?engagement=96069102624
https://app.staging.jiminny.com/playback/d5df34dc-bd66-4ff5-a7b3-8d3be30322a0
SELECT * FROM activities WHERE uuid_to_bin('04fdcd0d-818f-4c53-92dc-6f18bc753ffd') = uuid;
# 609126 softphone tr. 11241
SELECT * FROM activities WHERE uuid_to_bin('6521bfcd-5a30-46e5-9f74-5440fd48befd') = uuid;
# 608874 conference tr. 11226 crmId: 103422236596
select * from ai_prompts where transcription_id IN (11241, 11226);
select * from activity_summary_logs where activity_id = 608874;
select * from sidekick_settings;
select * from default_activity_types;
select * from crm_field_data where activity_id = 1223;
select * from crm_layouts where crm_configuration_id = 2;
SELECT * FROM crm_layout_entities WHERE crm_layout_id IN (554);
select * from crm_fields where crm_configuration_id = 11 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id IN (1455,1450);
SELECT * FROM crm_field_data WHERE crm_layout_entity_id = 971;
SELECT * FROM crm_field_data WHERE crm_layout_entity_id IN (6494,6495,6496,6497,6498,6499);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u
on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 2 and sa.provider = 'hubspot';
select * from opportunities where team_id = 2
and crm_provider_id IN ('51317301383');
select * from contacts where id = 85;
select * from opportunities where team_id = 2 order by id desc;
select * from opportunities where team_id = 2 and crm_provider_id = '51317301383'; # 5112
select * from opportunities where team_id = 2 and crm_provider_id = '55976759904'; # 5112
select * from opportunity_contacts where opportunity_id = 5117;
select * from crm_field_data where object_id = 1365;
SELECT * FROM crm_fields WHERE id IN (1405, 1407, 1972, 2128);
select * from features;
select * from team_features where team_id IN (1);
select * from team_features where feature_id IN (36);
SHOW CREATE TABLE opportunity_contacts;
SELECT * FROM opportunity_contacts WHERE crm_provider_id = '111751';
# $slug = 'HUBSPOT_WEBHOOK_SYNC';
# $team = Jiminny\Models\Team::find(2);
# $feature = Feature::query()->where('slug', $slug)->first();
# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);
# hubspot_webhook_metrics
select * from opportunities where team_id = 2 and crm_provider_id IN ('374720564','14527423589','49908861993','50435771779'); # 1365
SELECT * FROM opportunity_contacts WHERE opportunity_id = '414';
SELECT * FROM opportunity_contacts WHERE crm_provider_id = '131501';
select * from contacts where id in (414, 464);
select * from activities where crm_configuration_id = 2;
select settings from crm_configurations where id = 11;
select * from teams; # 1, 2
select * from users;
select * from crm_configurations where id = 39;
select * from team_features where team_id = 2;
select * from features;
# SELECT * FROM opportunities WHERE crm_configuration_id = 2
# order by id desc;
# and crm_provider_id = '49908861993';
select * from activity_providers where id IN (443, 202, 203, 227);
select * from activity_imports where id = 795889;
select c.id, c.provider, c.settings, t.* from teams t join crm_configurations c on t.id = c.team_id
where c.provider = 'hubspot';
select * from crm_configurations crm JOIN teams t on crm.team_id = t.id
where provider = 'hubspot';
SELECT * FROM teams WHERE id = 31;
SELECT * FROM users WHERE id = 257;
SELECT * FROM opportunities WHERE team_id = 2;
select * from opportunity_contacts where opportunity_id = 5124;
select * from contacts where id IN (3850,3853,3851,4073,4140,4155,4480,4530,4623,5986,513,687,1806,1523,3613)
select * from activities where crm_configuration_id = 13;
SELECT * FROM activities WHERE uuid_to_bin('826619ce-ec8e-4e59-8467-a01f5f6ad71e') = uuid; # 418141
select id, team_id, crm_provider_id from crm_configurations where provider = 'hubspot' and crm_provider_id IS NOT NULL;
SELECT * FROM accounts WHERE team_id = 2 and crm_provider_id = '1212213464' order by id desc;
SELECT * FROM contacts WHERE team_id = 2 and account_id = 5189 order by id desc;
SELECT * FROM contacts WHERE team_id = 2 order by id desc;
select * from opportunity_contacts where contact_id = 6223;
SELECT * FROM opportunities WHERE team_id = 2 and account_id = 5189 order by id desc;
select * from crm_profiles where crm_configuration_id = 2;
select * from activities where account_id = 46;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"It's the only usage in Project Files\nFind Options… (⌃⌥⌘N)","depth":2,"bounds":{"left":0.2137633,"top":0.4557063,"width":0.06815159,"height":0.027134877},"value":"It's the only usage in Project Files\nFind Options… (⌃⌥⌘N)","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"bounds":{"left":0.2137633,"top":0.4557063,"width":0.06815159,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"bounds":{"left":0.2137633,"top":0.46927375,"width":0.029587766,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"bounds":{"left":0.24335106,"top":0.46927375,"width":0.019946808,"height":0.013567438},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":3,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11976 on JY-20553-debug-crm-sync-delays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.10837766,"height":0.025538707},"help_text":"Pull request #11976 exists for current branch JY-20553-debug-crm-sync-delays","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.7972075,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"RequestGenerateAskJiminnyReportJobTest","depth":6,"bounds":{"left":0.8125,"top":0.019952115,"width":0.10305851,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.3587101,"top":0.2490024,"width":0.00731383,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"bounds":{"left":0.36801863,"top":0.2490024,"width":0.009640957,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.37965426,"top":0.2490024,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.38929522,"top":0.24740623,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.39660904,"top":0.24740623,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\nnamespace Jiminny\\Services\\Crm;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\Transcription\\Service\\TranscriptionService;\nuse Jiminny\\Contracts\\Services\\Crm\\ClientInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\ConnectionStateInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\Provider\\HubspotInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\ServiceInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\SettingsInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\SupportsObjectTypeParseInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\SyncCrmEntitiesInterface;\nuse Jiminny\\Exceptions\\HttpBadRequestException;\nuse Jiminny\\Exceptions\\HttpNotFoundException;\nuse Jiminny\\Exceptions\\LogicException;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Integrations\\PlaybookResolver;\nuse Jiminny\\Jobs\\Crm\\SyncFieldMetadata;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Models\\Crm\\Field;\nuse Jiminny\\Models\\Crm\\FieldData;\nuse Jiminny\\Models\\Crm\\FieldValue;\nuse Jiminny\\Models\\Crm\\Layout;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Models\\Lead;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Models\\PlaybookCategory;\nuse Jiminny\\Models\\SocialAccount;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Crm\\Helpers\\ConnectionStateTrait;\nuse Jiminny\\Services\\Crm\\Helpers\\OpportunitySyncableFieldsTrait;\nuse Jiminny\\Services\\TeamService;\nuse Psr\\Log\\LoggerInterface;\nuse Sentry\\State\\Scope;\n\nabstract class BaseService implements\n ServiceInterface,\n SettingsInterface,\n SyncCrmEntitiesInterface,\n ConnectionStateInterface\n{\n use ConnectionStateTrait;\n use OpportunitySyncableFieldsTrait;\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n\n public const int SOFT_DELETE_CHUNK = 100;\n public const int HARD_DELETE_CHUNK = 1000;\n\n public ?Configuration $config;\n\n public ?Profile $profile;\n\n public ?Team $team = null;\n\n /**\n * @var ClientInterface\n */\n protected $client;\n\n /**\n * @var TeamService\n */\n protected TeamService $teamService;\n\n /**\n * @var int\n */\n protected int $limit;\n\n /**\n * @var int\n */\n protected int $offset;\n\n /**\n * Transcription Service instance.\n *\n * @var TranscriptionService\n */\n protected TranscriptionService $transcriptionService;\n\n protected LoggerInterface $logger;\n\n /**\n * Cache for opportunity fields to avoid N+1 queries during batch imports.\n * Key: crm_provider_id, Value: Field model with entities relation.\n * Cleared when configuration changes.\n *\n * @var Collection<string, Field>|null\n */\n private ?Collection $cachedOpportunityFields = null;\n\n public function __construct()\n {\n $this->teamService = app(TeamService::class);\n $this->transcriptionService = app(TranscriptionService::class);\n $this->logger = app(LoggerInterface::class);\n }\n\n /**\n * @param User $user\n *\n * @throws SocialAccountTokenInvalidException\n */\n public function setUser(User $user): void\n {\n $this->configureSentryScope($user);\n\n $this->team = $user->team;\n $this->teamService->setTeam($user->team);\n $this->setConfiguration($user->team->crm);\n\n // Reset state.\n $this->profile = $user->crmProfile;\n\n /**\n * DO NOT DELETE THIS `clearTokens` CALL\n * The purpose of purging tokens is to fix a problem in importing calendar events.\n * Calendar Import doesn't always respect \"SocialAccountInvalidTokenException\" exception\n * and may try to recycle old SF instance, with wrong credentials (by ignoring the exception).\n *\n * This code guarantees the CRM Service is unusable, unless always provided with a valid social account.\n */\n if (method_exists($this->client, 'clearTokens')) {\n $this->client->clearTokens();\n }\n\n $account = $this->getOAuthAccount($user);\n\n $this->validateUserAccountExists($user, $account);\n\n if (method_exists($this->client, 'setOAuthAccount')) {\n $this->client->setOAuthAccount($account);\n }\n if (method_exists($this->client, 'setLogger')) {\n $this->client->setLogger($this->logger);\n }\n\n if ($this->profile === null) {\n // Try to fetch their profile, maybe it was not yet imported?\n $cacheKey = sprintf('crm_profile_sync-%s', $user->getId());\n $lock = \\Cache::lock($cacheKey, 300);\n if ($lock->get()) {\n $this->profile = $this->getProfile($user);\n }\n }\n\n // The CRM Service is properly bootstrapped, and supports remote operations\n $this->connect();\n }\n\n protected function configureSentryScope(User $user): void\n {\n \\Sentry\\configureScope(function (Scope $scope) use ($user): void {\n $scope->setTag('team_id', (string) $user->getTeamId());\n $scope->setUser([\n 'id' => $user->getId(),\n 'email' => $user->getEmailAddress(),\n ]);\n });\n }\n\n /**\n * @param User $user\n *\n * @return Profile|null\n */\n protected function getProfile(User $user): ?Profile\n {\n return $this->syncProfiles($user);\n }\n\n public function getConfiguration(): Configuration\n {\n return $this->config;\n }\n\n public function setConfiguration(Configuration $config): void\n {\n $this->config = $config;\n $this->client->setConfiguration($config);\n\n // Clear field cache when configuration changes to ensure fresh data for new team/config\n $this->cachedOpportunityFields = null;\n\n if ($this->team === null) {\n $this->team = $config->team;\n }\n }\n\n public function setPage(int $limit, int $offset): void\n {\n $this->limit = $limit;\n $this->offset = $offset;\n }\n\n abstract protected function getOAuthAccount(User $user): ?SocialAccount;\n abstract protected function getDefaultFollowupLayoutFields(string $activityType): array;\n abstract protected function getFieldTypes(): array;\n abstract protected function getFields(string $fieldType): array;\n\n public function syncFields(): void\n {\n foreach ($this->getFieldTypes() as $fieldType) {\n $currentFields = $this->getFields($fieldType);\n\n // TODO: only sync the field once a day if we don't use it in any layout. If we do, sync hourly?\n foreach ($currentFields as $field) {\n /** @var Models\\Crm\\Field $field */\n $field = $this->config->fields()->updateOrCreate([\n 'crm_provider_id' => mb_strimwidth($field['name'], 0, 128),\n 'object_type' => $fieldType,\n ], [\n 'label' => mb_strimwidth($field['label'], 0, Field::LABEL_MAX_LENGTH),\n ]);\n\n try {\n $this->syncField($field);\n\n if ($field->type === Models\\Crm\\Field::TYPE_PICKLIST) {\n $this->importPicklistValues($field);\n }\n } catch (HttpNotFoundException $e) {\n $this->logger->error('[sync-fields] Field not found', [\n 'provider' => $this->getDisplayName(),\n 'crm_field' => $field->crm_provider_id,\n 'object_type' => $field->object_type,\n 'team_id' => $this->team->id,\n ]);\n } catch (HttpBadRequestException $e) {\n $this->logger->error('[sync-fields] Field not supported', [\n 'provider' => $this->getDisplayName(),\n 'crm_field' => $field->crm_provider_id,\n 'object_type' => $field->object_type,\n 'team_id' => $this->team->id,\n ]);\n }\n }\n }\n }\n\n /**\n * @param string $objectId\n * @param ?string $objectType\n *\n * @return array\n */\n public function parseRecords(string $objectId, ?string $objectType = null): array\n {\n if ($objectType === null && $this instanceof SupportsObjectTypeParseInterface) {\n $objectType = $this->parseObjectType($objectId);\n }\n\n $lead = null;\n $contact = null;\n $opportunity = null;\n $account = null;\n $stage = null;\n $countryCode = null;\n\n // Gather the prospect data to store on activity/participant.\n switch ($objectType) {\n case self::OBJECT_LEAD:\n /** @var ?Lead $lead */\n $lead = $this->config->leads()->where('crm_provider_id', $objectId)->first();\n\n if ($lead === null) {\n $lead = $this->syncLead($objectId);\n }\n\n if ($lead?->country_code) {\n $countryCode = $lead->country_code;\n }\n\n $stage = $lead?->stage;\n\n break;\n\n case self::OBJECT_ACCOUNT:\n $account = $this->config->accounts()->where('crm_provider_id', $objectId)->first();\n\n if ($account === null) {\n $account = $this->syncAccount($objectId);\n }\n\n if ($account->country_code) {\n $countryCode = $account->country_code;\n }\n\n break;\n\n case self::OBJECT_CONTACT:\n $contact = $this->config->contacts()->where('crm_provider_id', $objectId)->first();\n\n if ($contact === null) {\n $contact = $this->syncContact($objectId);\n }\n\n if ($contact?->country_code) {\n $countryCode = $contact->country_code;\n }\n\n $account = $contact?->account;\n\n break;\n\n case self::OBJECT_OPPORTUNITY:\n $opportunity = $this->config->opportunities()->where('crm_provider_id', $objectId)->first();\n\n if ($opportunity === null) {\n $opportunity = $this->syncOpportunity($objectId);\n }\n\n if ($opportunity !== null) {\n $stage = $opportunity->stage;\n\n $account = $opportunity->account;\n\n if ($account->country_code) {\n $countryCode = $account->country_code;\n }\n }\n\n break;\n }\n\n return [\n $lead,\n $account,\n $opportunity,\n $contact,\n $stage,\n $countryCode,\n ];\n }\n\n /**\n * @param null|string $name\n *\n * @return null|string\n */\n public function convertCountryNameToCode(?string $name): ?string\n {\n return app(CountryCodeResolver::class)->resolveCountryCode($name);\n }\n\n /**\n * @param PlaybookCategory $category\n *\n * @return bool\n */\n public function matchesCrmType(PlaybookCategory $category): bool\n {\n if ($category->playbook === null) {\n return false;\n }\n\n if ($category->getPlaybook()->getActivityField() === null) {\n return false;\n }\n\n $fieldValue = $category\n ->playbook\n ->activityField\n ->values()\n ->where('label', $category->name);\n\n // Check the field values for a matching option.\n return $fieldValue->exists();\n }\n\n /**\n * @param PlaybookCategory $category\n *\n * @return FieldValue|null\n */\n public function getCrmType(PlaybookCategory $category): ?FieldValue\n {\n $fieldValue = $category\n ->playbook\n ->activityField\n ->values()\n ->where('label', $category->name);\n\n return $fieldValue->first();\n }\n\n\n /**\n * @return int|float|string\n */\n public function getMinimumApiVersion(): int|float|string\n {\n return $this->client->getMinimumApiVersion();\n }\n\n /**\n * @param string $accountId\n *\n * @return bool\n */\n protected function hasAccount(string $accountId): bool\n {\n return $this->config->accounts()->where('crm_provider_id', $accountId)->exists();\n }\n\n /**\n * @param string $opportunityId\n *\n * @return bool\n */\n protected function hasOpportunity(string $opportunityId): bool\n {\n return $this->config->opportunities()->where('crm_provider_id', $opportunityId)->exists();\n }\n\n /**\n * @param string $contactId\n *\n * @return bool\n */\n protected function hasContact(string $contactId): bool\n {\n return $this->config->contacts()->where('crm_provider_id', $contactId)->exists();\n }\n\n /**\n * @param string $leadId\n *\n * @return bool\n */\n protected function hasLead(string $leadId): bool\n {\n return $this->config->leads()->where('crm_provider_id', $leadId)->exists();\n }\n\n public function fetchAndAssociateRelatedActivity(Activity $activity): ?Activity\n {\n return null;\n }\n\n public function getJobDelay(): int\n {\n return 0;\n }\n\n public function getPlaybookFromActivity(Activity $activity): ?Playbook\n {\n if ($activity->hasActivityType() && $activity->getActivityType()->hasPlaybook()) {\n return $activity->getActivityType()->getPlaybook();\n }\n\n return $this->getPlaybook($activity->getUser());\n }\n\n /**\n * Gets the playbook for the user\n */\n protected function getPlaybook(User $user): ?Playbook\n {\n $playbookResolver = app(PlaybookResolver::class);\n\n return $playbookResolver->resolvePlaybookByUser($user);\n }\n\n /**\n * @param Models\\Playbook $playbook\n * @param string $categoryName\n *\n * @return Models\\PlaybookCategory|null\n */\n protected function getPlaybookCategory(Models\\Playbook $playbook, string $categoryName): ?Models\\PlaybookCategory\n {\n return $playbook->categories()\n ->where('name', trim($categoryName))\n ->latest()\n ->first();\n }\n\n public function buildLayout(Layout $layout, ?string $activityType): void\n {\n if ($activityType) {\n // Base section. Currently, the fields within are hard coded so this is empty for now.\n /** @var Models\\Crm\\LayoutEntity $activitySection */\n $activitySection = $layout->entities()->create([\n 'label' => 'activity-summary',\n 'description' => 'Activity Summary',\n 'sequence' => 0,\n ]);\n\n if ($this instanceof HubspotInterface) {\n $activityFields = $this->getDefaultActivityLayoutFields($activityType, $layout->type);\n\n foreach ($activityFields as $i => $field) {\n $layout->entities()->create([\n 'parent_entity_id' => $activitySection->getId(),\n 'crm_field_id' => $field->getId(),\n 'sequence' => $i,\n ]);\n }\n }\n\n // Follow-up section. These are all dynamic fields.\n $sectionTitle = ($layout->type === Layout::TYPE_CONFERENCE_SUMMARY ? 'Next Steps...' : 'Follow up?');\n /** @var Models\\Crm\\LayoutEntity $followupSection */\n $followupSection = $layout->entities()->create([\n 'label' => 'follow-up',\n 'description' => $sectionTitle,\n 'sequence' => 1,\n ]);\n\n $followupFields = $this->getDefaultFollowupLayoutFields($activityType);\n\n foreach ($followupFields as $i => $field) {\n $layout->entities()->create([\n 'parent_entity_id' => $followupSection->getId(),\n 'crm_field_id' => $field->getId(),\n 'sequence' => $i,\n ]);\n }\n } elseif ($layout->type == Layout::TYPE_DEAL_INSIGHTS) {\n $this->populateLayoutEntities($layout);\n }\n }\n\n protected function populateLayoutEntities(Layout $layout): void\n {\n $dealFields = $this->getDefaultDealLayoutFields();\n\n foreach ($dealFields as $i => $field) {\n $readOnly = $field->getType() === Field::TYPE_CURRENCY\n || $this->isBusinessTypeField($field);\n\n $layout->entities()->updateOrCreate([\n 'crm_field_id' => $field->id,\n ], [\n 'sequence' => $i,\n 'read_only' => $readOnly,\n ]);\n }\n }\n\n public function prepareValueForUpdate(array $params): array\n {\n $fieldName = $params['fieldName'];\n $fieldValue = $params['fieldValue'];\n\n return [$fieldName => $fieldValue];\n }\n\n protected function getDefaultDealLayoutFields(): array\n {\n $fieldData = $this->getDealInsightsFields();\n\n $fields = [];\n foreach ($fieldData as $data) {\n /** @var Field $field */\n $field = $this->config->fields()->updateOrCreate([\n 'crm_provider_id' => $data['crm_provider_id'],\n 'object_type' => $data['object_type'],\n ], ['label' => $data['crm_provider_id']]);\n\n try {\n dispatch_sync(new SyncFieldMetadata($this->config->team, $field));\n $field->refresh();\n } catch (\\Throwable $throwable) {\n \\Sentry::captureException($throwable);\n }\n\n $fields[] = $field;\n }\n\n return $fields;\n }\n\n public function importOpportunityCrmFieldData(array $crmData, array $crmFields, int $opportunityId): void\n {\n // Pre-fetch all opportunity fields once per batch to avoid N+1 queries.\n // During webhook floods, this reduces DB queries from O(fields × deals) to O(1) for field lookups.\n $fieldsMap = $this->getOpportunityFieldsMap();\n\n foreach ($crmFields as $fieldName) {\n $field = $fieldsMap->get($fieldName);\n\n if (! $field instanceof Field) {\n $this->logger->warning('Field not found', [\n 'field' => $fieldName,\n 'opportunity_id' => $opportunityId,\n ]);\n\n continue;\n }\n\n // A CRM field data will be synced only if the field exists as part of at least one layout,\n // i.e. an entity related to the field exists.\n $entity = $field->entities->first();\n if (! $entity instanceof Models\\Crm\\LayoutEntity) {\n continue;\n }\n\n $fieldValue = $crmData[$fieldName] ?? '';\n\n if (is_object($fieldValue)) {\n $this->logger->warning('Field value is an object', [\n 'field' => $fieldName,\n ]);\n\n continue;\n }\n\n $value = $this->normalizeValue($field->type, $fieldValue, true);\n\n FieldData::updateOrCreate([\n 'crm_layout_entity_id' => $entity->id,\n 'crm_field_id' => $field->id,\n 'object_type' => 'opportunity',\n 'object_id' => $opportunityId,\n ], ['value' => $value]);\n }\n }\n\n /**\n * Get cached opportunity fields map for efficient lookups during batch imports.\n *\n * This method fetches all opportunity fields with their entities relation ONCE\n * and caches them for the lifetime of this service instance. This eliminates\n * the N+1 query problem where each field was fetched individually per deal.\n *\n * Performance impact:\n * - Before: 10 fields × 100 deals = 1,000 field queries per batch\n * - After: 1 query per batch (regardless of deal count)\n *\n * @return Collection<string, Field> Fields keyed by crm_provider_id\n */\n private function getOpportunityFieldsMap(): Collection\n {\n if ($this->cachedOpportunityFields === null) {\n $this->cachedOpportunityFields = $this->config->fields()\n ->with('entities')\n ->where('object_type', '=', self::OBJECT_OPPORTUNITY)\n ->get()\n ->keyBy('crm_provider_id');\n }\n\n return $this->cachedOpportunityFields;\n }\n\n /**\n * @param array<mixed> $crmData\n * @param Collection $crmFields\n * @param int $objectId\n *\n * @return void\n */\n public function importCrmFieldData(array $crmData, Collection $crmFields, int $objectId): void\n {\n /** @var Field $crmField */\n foreach ($crmFields as $crmField) {\n // If the field name does not match one we are interested in, skip.\n if (array_key_exists($crmField->crm_provider_id, $crmData) === false) {\n continue;\n }\n\n /** @var string $fieldValue */\n $fieldValue = $crmData[$crmField->crm_provider_id];\n\n $value = $this->normalizeValue($crmField->type, $fieldValue, true);\n\n FieldData::updateOrCreate([\n 'crm_field_id' => $crmField->id,\n 'object_type' => $crmField->object_type,\n 'object_id' => $objectId,\n ], ['value' => $value]);\n }\n }\n\n protected function getTeam(): Team\n {\n if (! $this->team instanceof Team) {\n throw new LogicException('Expecting team model instance');\n }\n\n return $this->team;\n }\n\n public function isBusinessTypeField(Field $field): bool\n {\n return in_array($field->crm_provider_id, Field::BUSINESS_TYPE_FIELDS)\n && $field->object_type === Field::OBJECT_OPPORTUNITY;\n }\n\n /**\n * @return mixed[]\n */\n public function fetchRelatedActivity(Activity $activity): array\n {\n return [];\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n private function validateUserAccountExists(User $user, ?SocialAccount $account = null): void\n {\n if ($account instanceof SocialAccount && $account->state === SocialAccount::STATE_CONNECTED) {\n return;\n }\n\n $this->logger->warning(\n sprintf('[%s] Account not connected for user', $this->getDisplayName()),\n [\n 'userId' => $user->getIdString(),\n 'account' => $account,\n ]\n );\n\n // If their profile was never setup in the first place\n if ($this->profile === null) {\n // Create a dummy in-memory profile just to be able to run\n $this->profile = new Profile();\n }\n\n if (! $account instanceof SocialAccount) {\n throw new SocialAccountTokenInvalidException(\n sprintf(\n 'Social account for %s cannot be found. Please login to Jiminny to connect.',\n $this->getDisplayName()\n )\n );\n }\n\n throw new SocialAccountTokenInvalidException(\n sprintf(\n 'Your %s account has become disconnected. Please login to Jiminny to reconnect.',\n $this->getDisplayName()\n )\n );\n }\n\n public function listSupportedObjectTypes(): array\n {\n return $this->getFieldTypes();\n }\n}","depth":4,"value":"<?php\n\nnamespace Jiminny\\Services\\Crm;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\Transcription\\Service\\TranscriptionService;\nuse Jiminny\\Contracts\\Services\\Crm\\ClientInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\ConnectionStateInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\Provider\\HubspotInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\ServiceInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\SettingsInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\SupportsObjectTypeParseInterface;\nuse Jiminny\\Contracts\\Services\\Crm\\SyncCrmEntitiesInterface;\nuse Jiminny\\Exceptions\\HttpBadRequestException;\nuse Jiminny\\Exceptions\\HttpNotFoundException;\nuse Jiminny\\Exceptions\\LogicException;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Integrations\\PlaybookResolver;\nuse Jiminny\\Jobs\\Crm\\SyncFieldMetadata;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Models\\Crm\\Field;\nuse Jiminny\\Models\\Crm\\FieldData;\nuse Jiminny\\Models\\Crm\\FieldValue;\nuse Jiminny\\Models\\Crm\\Layout;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Models\\Lead;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Models\\PlaybookCategory;\nuse Jiminny\\Models\\SocialAccount;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\Crm\\Helpers\\ConnectionStateTrait;\nuse Jiminny\\Services\\Crm\\Helpers\\OpportunitySyncableFieldsTrait;\nuse Jiminny\\Services\\TeamService;\nuse Psr\\Log\\LoggerInterface;\nuse Sentry\\State\\Scope;\n\nabstract class BaseService implements\n ServiceInterface,\n SettingsInterface,\n SyncCrmEntitiesInterface,\n ConnectionStateInterface\n{\n use ConnectionStateTrait;\n use OpportunitySyncableFieldsTrait;\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n\n public const int SOFT_DELETE_CHUNK = 100;\n public const int HARD_DELETE_CHUNK = 1000;\n\n public ?Configuration $config;\n\n public ?Profile $profile;\n\n public ?Team $team = null;\n\n /**\n * @var ClientInterface\n */\n protected $client;\n\n /**\n * @var TeamService\n */\n protected TeamService $teamService;\n\n /**\n * @var int\n */\n protected int $limit;\n\n /**\n * @var int\n */\n protected int $offset;\n\n /**\n * Transcription Service instance.\n *\n * @var TranscriptionService\n */\n protected TranscriptionService $transcriptionService;\n\n protected LoggerInterface $logger;\n\n /**\n * Cache for opportunity fields to avoid N+1 queries during batch imports.\n * Key: crm_provider_id, Value: Field model with entities relation.\n * Cleared when configuration changes.\n *\n * @var Collection<string, Field>|null\n */\n private ?Collection $cachedOpportunityFields = null;\n\n public function __construct()\n {\n $this->teamService = app(TeamService::class);\n $this->transcriptionService = app(TranscriptionService::class);\n $this->logger = app(LoggerInterface::class);\n }\n\n /**\n * @param User $user\n *\n * @throws SocialAccountTokenInvalidException\n */\n public function setUser(User $user): void\n {\n $this->configureSentryScope($user);\n\n $this->team = $user->team;\n $this->teamService->setTeam($user->team);\n $this->setConfiguration($user->team->crm);\n\n // Reset state.\n $this->profile = $user->crmProfile;\n\n /**\n * DO NOT DELETE THIS `clearTokens` CALL\n * The purpose of purging tokens is to fix a problem in importing calendar events.\n * Calendar Import doesn't always respect \"SocialAccountInvalidTokenException\" exception\n * and may try to recycle old SF instance, with wrong credentials (by ignoring the exception).\n *\n * This code guarantees the CRM Service is unusable, unless always provided with a valid social account.\n */\n if (method_exists($this->client, 'clearTokens')) {\n $this->client->clearTokens();\n }\n\n $account = $this->getOAuthAccount($user);\n\n $this->validateUserAccountExists($user, $account);\n\n if (method_exists($this->client, 'setOAuthAccount')) {\n $this->client->setOAuthAccount($account);\n }\n if (method_exists($this->client, 'setLogger')) {\n $this->client->setLogger($this->logger);\n }\n\n if ($this->profile === null) {\n // Try to fetch their profile, maybe it was not yet imported?\n $cacheKey = sprintf('crm_profile_sync-%s', $user->getId());\n $lock = \\Cache::lock($cacheKey, 300);\n if ($lock->get()) {\n $this->profile = $this->getProfile($user);\n }\n }\n\n // The CRM Service is properly bootstrapped, and supports remote operations\n $this->connect();\n }\n\n protected function configureSentryScope(User $user): void\n {\n \\Sentry\\configureScope(function (Scope $scope) use ($user): void {\n $scope->setTag('team_id', (string) $user->getTeamId());\n $scope->setUser([\n 'id' => $user->getId(),\n 'email' => $user->getEmailAddress(),\n ]);\n });\n }\n\n /**\n * @param User $user\n *\n * @return Profile|null\n */\n protected function getProfile(User $user): ?Profile\n {\n return $this->syncProfiles($user);\n }\n\n public function getConfiguration(): Configuration\n {\n return $this->config;\n }\n\n public function setConfiguration(Configuration $config): void\n {\n $this->config = $config;\n $this->client->setConfiguration($config);\n\n // Clear field cache when configuration changes to ensure fresh data for new team/config\n $this->cachedOpportunityFields = null;\n\n if ($this->team === null) {\n $this->team = $config->team;\n }\n }\n\n public function setPage(int $limit, int $offset): void\n {\n $this->limit = $limit;\n $this->offset = $offset;\n }\n\n abstract protected function getOAuthAccount(User $user): ?SocialAccount;\n abstract protected function getDefaultFollowupLayoutFields(string $activityType): array;\n abstract protected function getFieldTypes(): array;\n abstract protected function getFields(string $fieldType): array;\n\n public function syncFields(): void\n {\n foreach ($this->getFieldTypes() as $fieldType) {\n $currentFields = $this->getFields($fieldType);\n\n // TODO: only sync the field once a day if we don't use it in any layout. If we do, sync hourly?\n foreach ($currentFields as $field) {\n /** @var Models\\Crm\\Field $field */\n $field = $this->config->fields()->updateOrCreate([\n 'crm_provider_id' => mb_strimwidth($field['name'], 0, 128),\n 'object_type' => $fieldType,\n ], [\n 'label' => mb_strimwidth($field['label'], 0, Field::LABEL_MAX_LENGTH),\n ]);\n\n try {\n $this->syncField($field);\n\n if ($field->type === Models\\Crm\\Field::TYPE_PICKLIST) {\n $this->importPicklistValues($field);\n }\n } catch (HttpNotFoundException $e) {\n $this->logger->error('[sync-fields] Field not found', [\n 'provider' => $this->getDisplayName(),\n 'crm_field' => $field->crm_provider_id,\n 'object_type' => $field->object_type,\n 'team_id' => $this->team->id,\n ]);\n } catch (HttpBadRequestException $e) {\n $this->logger->error('[sync-fields] Field not supported', [\n 'provider' => $this->getDisplayName(),\n 'crm_field' => $field->crm_provider_id,\n 'object_type' => $field->object_type,\n 'team_id' => $this->team->id,\n ]);\n }\n }\n }\n }\n\n /**\n * @param string $objectId\n * @param ?string $objectType\n *\n * @return array\n */\n public function parseRecords(string $objectId, ?string $objectType = null): array\n {\n if ($objectType === null && $this instanceof SupportsObjectTypeParseInterface) {\n $objectType = $this->parseObjectType($objectId);\n }\n\n $lead = null;\n $contact = null;\n $opportunity = null;\n $account = null;\n $stage = null;\n $countryCode = null;\n\n // Gather the prospect data to store on activity/participant.\n switch ($objectType) {\n case self::OBJECT_LEAD:\n /** @var ?Lead $lead */\n $lead = $this->config->leads()->where('crm_provider_id', $objectId)->first();\n\n if ($lead === null) {\n $lead = $this->syncLead($objectId);\n }\n\n if ($lead?->country_code) {\n $countryCode = $lead->country_code;\n }\n\n $stage = $lead?->stage;\n\n break;\n\n case self::OBJECT_ACCOUNT:\n $account = $this->config->accounts()->where('crm_provider_id', $objectId)->first();\n\n if ($account === null) {\n $account = $this->syncAccount($objectId);\n }\n\n if ($account->country_code) {\n $countryCode = $account->country_code;\n }\n\n break;\n\n case self::OBJECT_CONTACT:\n $contact = $this->config->contacts()->where('crm_provider_id', $objectId)->first();\n\n if ($contact === null) {\n $contact = $this->syncContact($objectId);\n }\n\n if ($contact?->country_code) {\n $countryCode = $contact->country_code;\n }\n\n $account = $contact?->account;\n\n break;\n\n case self::OBJECT_OPPORTUNITY:\n $opportunity = $this->config->opportunities()->where('crm_provider_id', $objectId)->first();\n\n if ($opportunity === null) {\n $opportunity = $this->syncOpportunity($objectId);\n }\n\n if ($opportunity !== null) {\n $stage = $opportunity->stage;\n\n $account = $opportunity->account;\n\n if ($account->country_code) {\n $countryCode = $account->country_code;\n }\n }\n\n break;\n }\n\n return [\n $lead,\n $account,\n $opportunity,\n $contact,\n $stage,\n $countryCode,\n ];\n }\n\n /**\n * @param null|string $name\n *\n * @return null|string\n */\n public function convertCountryNameToCode(?string $name): ?string\n {\n return app(CountryCodeResolver::class)->resolveCountryCode($name);\n }\n\n /**\n * @param PlaybookCategory $category\n *\n * @return bool\n */\n public function matchesCrmType(PlaybookCategory $category): bool\n {\n if ($category->playbook === null) {\n return false;\n }\n\n if ($category->getPlaybook()->getActivityField() === null) {\n return false;\n }\n\n $fieldValue = $category\n ->playbook\n ->activityField\n ->values()\n ->where('label', $category->name);\n\n // Check the field values for a matching option.\n return $fieldValue->exists();\n }\n\n /**\n * @param PlaybookCategory $category\n *\n * @return FieldValue|null\n */\n public function getCrmType(PlaybookCategory $category): ?FieldValue\n {\n $fieldValue = $category\n ->playbook\n ->activityField\n ->values()\n ->where('label', $category->name);\n\n return $fieldValue->first();\n }\n\n\n /**\n * @return int|float|string\n */\n public function getMinimumApiVersion(): int|float|string\n {\n return $this->client->getMinimumApiVersion();\n }\n\n /**\n * @param string $accountId\n *\n * @return bool\n */\n protected function hasAccount(string $accountId): bool\n {\n return $this->config->accounts()->where('crm_provider_id', $accountId)->exists();\n }\n\n /**\n * @param string $opportunityId\n *\n * @return bool\n */\n protected function hasOpportunity(string $opportunityId): bool\n {\n return $this->config->opportunities()->where('crm_provider_id', $opportunityId)->exists();\n }\n\n /**\n * @param string $contactId\n *\n * @return bool\n */\n protected function hasContact(string $contactId): bool\n {\n return $this->config->contacts()->where('crm_provider_id', $contactId)->exists();\n }\n\n /**\n * @param string $leadId\n *\n * @return bool\n */\n protected function hasLead(string $leadId): bool\n {\n return $this->config->leads()->where('crm_provider_id', $leadId)->exists();\n }\n\n public function fetchAndAssociateRelatedActivity(Activity $activity): ?Activity\n {\n return null;\n }\n\n public function getJobDelay(): int\n {\n return 0;\n }\n\n public function getPlaybookFromActivity(Activity $activity): ?Playbook\n {\n if ($activity->hasActivityType() && $activity->getActivityType()->hasPlaybook()) {\n return $activity->getActivityType()->getPlaybook();\n }\n\n return $this->getPlaybook($activity->getUser());\n }\n\n /**\n * Gets the playbook for the user\n */\n protected function getPlaybook(User $user): ?Playbook\n {\n $playbookResolver = app(PlaybookResolver::class);\n\n return $playbookResolver->resolvePlaybookByUser($user);\n }\n\n /**\n * @param Models\\Playbook $playbook\n * @param string $categoryName\n *\n * @return Models\\PlaybookCategory|null\n */\n protected function getPlaybookCategory(Models\\Playbook $playbook, string $categoryName): ?Models\\PlaybookCategory\n {\n return $playbook->categories()\n ->where('name', trim($categoryName))\n ->latest()\n ->first();\n }\n\n public function buildLayout(Layout $layout, ?string $activityType): void\n {\n if ($activityType) {\n // Base section. Currently, the fields within are hard coded so this is empty for now.\n /** @var Models\\Crm\\LayoutEntity $activitySection */\n $activitySection = $layout->entities()->create([\n 'label' => 'activity-summary',\n 'description' => 'Activity Summary',\n 'sequence' => 0,\n ]);\n\n if ($this instanceof HubspotInterface) {\n $activityFields = $this->getDefaultActivityLayoutFields($activityType, $layout->type);\n\n foreach ($activityFields as $i => $field) {\n $layout->entities()->create([\n 'parent_entity_id' => $activitySection->getId(),\n 'crm_field_id' => $field->getId(),\n 'sequence' => $i,\n ]);\n }\n }\n\n // Follow-up section. These are all dynamic fields.\n $sectionTitle = ($layout->type === Layout::TYPE_CONFERENCE_SUMMARY ? 'Next Steps...' : 'Follow up?');\n /** @var Models\\Crm\\LayoutEntity $followupSection */\n $followupSection = $layout->entities()->create([\n 'label' => 'follow-up',\n 'description' => $sectionTitle,\n 'sequence' => 1,\n ]);\n\n $followupFields = $this->getDefaultFollowupLayoutFields($activityType);\n\n foreach ($followupFields as $i => $field) {\n $layout->entities()->create([\n 'parent_entity_id' => $followupSection->getId(),\n 'crm_field_id' => $field->getId(),\n 'sequence' => $i,\n ]);\n }\n } elseif ($layout->type == Layout::TYPE_DEAL_INSIGHTS) {\n $this->populateLayoutEntities($layout);\n }\n }\n\n protected function populateLayoutEntities(Layout $layout): void\n {\n $dealFields = $this->getDefaultDealLayoutFields();\n\n foreach ($dealFields as $i => $field) {\n $readOnly = $field->getType() === Field::TYPE_CURRENCY\n || $this->isBusinessTypeField($field);\n\n $layout->entities()->updateOrCreate([\n 'crm_field_id' => $field->id,\n ], [\n 'sequence' => $i,\n 'read_only' => $readOnly,\n ]);\n }\n }\n\n public function prepareValueForUpdate(array $params): array\n {\n $fieldName = $params['fieldName'];\n $fieldValue = $params['fieldValue'];\n\n return [$fieldName => $fieldValue];\n }\n\n protected function getDefaultDealLayoutFields(): array\n {\n $fieldData = $this->getDealInsightsFields();\n\n $fields = [];\n foreach ($fieldData as $data) {\n /** @var Field $field */\n $field = $this->config->fields()->updateOrCreate([\n 'crm_provider_id' => $data['crm_provider_id'],\n 'object_type' => $data['object_type'],\n ], ['label' => $data['crm_provider_id']]);\n\n try {\n dispatch_sync(new SyncFieldMetadata($this->config->team, $field));\n $field->refresh();\n } catch (\\Throwable $throwable) {\n \\Sentry::captureException($throwable);\n }\n\n $fields[] = $field;\n }\n\n return $fields;\n }\n\n public function importOpportunityCrmFieldData(array $crmData, array $crmFields, int $opportunityId): void\n {\n // Pre-fetch all opportunity fields once per batch to avoid N+1 queries.\n // During webhook floods, this reduces DB queries from O(fields × deals) to O(1) for field lookups.\n $fieldsMap = $this->getOpportunityFieldsMap();\n\n foreach ($crmFields as $fieldName) {\n $field = $fieldsMap->get($fieldName);\n\n if (! $field instanceof Field) {\n $this->logger->warning('Field not found', [\n 'field' => $fieldName,\n 'opportunity_id' => $opportunityId,\n ]);\n\n continue;\n }\n\n // A CRM field data will be synced only if the field exists as part of at least one layout,\n // i.e. an entity related to the field exists.\n $entity = $field->entities->first();\n if (! $entity instanceof Models\\Crm\\LayoutEntity) {\n continue;\n }\n\n $fieldValue = $crmData[$fieldName] ?? '';\n\n if (is_object($fieldValue)) {\n $this->logger->warning('Field value is an object', [\n 'field' => $fieldName,\n ]);\n\n continue;\n }\n\n $value = $this->normalizeValue($field->type, $fieldValue, true);\n\n FieldData::updateOrCreate([\n 'crm_layout_entity_id' => $entity->id,\n 'crm_field_id' => $field->id,\n 'object_type' => 'opportunity',\n 'object_id' => $opportunityId,\n ], ['value' => $value]);\n }\n }\n\n /**\n * Get cached opportunity fields map for efficient lookups during batch imports.\n *\n * This method fetches all opportunity fields with their entities relation ONCE\n * and caches them for the lifetime of this service instance. This eliminates\n * the N+1 query problem where each field was fetched individually per deal.\n *\n * Performance impact:\n * - Before: 10 fields × 100 deals = 1,000 field queries per batch\n * - After: 1 query per batch (regardless of deal count)\n *\n * @return Collection<string, Field> Fields keyed by crm_provider_id\n */\n private function getOpportunityFieldsMap(): Collection\n {\n if ($this->cachedOpportunityFields === null) {\n $this->cachedOpportunityFields = $this->config->fields()\n ->with('entities')\n ->where('object_type', '=', self::OBJECT_OPPORTUNITY)\n ->get()\n ->keyBy('crm_provider_id');\n }\n\n return $this->cachedOpportunityFields;\n }\n\n /**\n * @param array<mixed> $crmData\n * @param Collection $crmFields\n * @param int $objectId\n *\n * @return void\n */\n public function importCrmFieldData(array $crmData, Collection $crmFields, int $objectId): void\n {\n /** @var Field $crmField */\n foreach ($crmFields as $crmField) {\n // If the field name does not match one we are interested in, skip.\n if (array_key_exists($crmField->crm_provider_id, $crmData) === false) {\n continue;\n }\n\n /** @var string $fieldValue */\n $fieldValue = $crmData[$crmField->crm_provider_id];\n\n $value = $this->normalizeValue($crmField->type, $fieldValue, true);\n\n FieldData::updateOrCreate([\n 'crm_field_id' => $crmField->id,\n 'object_type' => $crmField->object_type,\n 'object_id' => $objectId,\n ], ['value' => $value]);\n }\n }\n\n protected function getTeam(): Team\n {\n if (! $this->team instanceof Team) {\n throw new LogicException('Expecting team model instance');\n }\n\n return $this->team;\n }\n\n public function isBusinessTypeField(Field $field): bool\n {\n return in_array($field->crm_provider_id, Field::BUSINESS_TYPE_FIELDS)\n && $field->object_type === Field::OBJECT_OPPORTUNITY;\n }\n\n /**\n * @return mixed[]\n */\n public function fetchRelatedActivity(Activity $activity): array\n {\n return [];\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n private function validateUserAccountExists(User $user, ?SocialAccount $account = null): void\n {\n if ($account instanceof SocialAccount && $account->state === SocialAccount::STATE_CONNECTED) {\n return;\n }\n\n $this->logger->warning(\n sprintf('[%s] Account not connected for user', $this->getDisplayName()),\n [\n 'userId' => $user->getIdString(),\n 'account' => $account,\n ]\n );\n\n // If their profile was never setup in the first place\n if ($this->profile === null) {\n // Create a dummy in-memory profile just to be able to run\n $this->profile = new Profile();\n }\n\n if (! $account instanceof SocialAccount) {\n throw new SocialAccountTokenInvalidException(\n sprintf(\n 'Social account for %s cannot be found. Please login to Jiminny to connect.',\n $this->getDisplayName()\n )\n );\n }\n\n throw new SocialAccountTokenInvalidException(\n sprintf(\n 'Your %s account has become disconnected. Please login to Jiminny to reconnect.',\n $this->getDisplayName()\n )\n );\n }\n\n public function listSupportedObjectTypes(): array\n {\n return $this->getFieldTypes();\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.40492022,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.41356382,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.4331782,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.4418218,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.45279256,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.4637633,"top":0.09896249,"width":0.024268618,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.49035904,"top":0.09896249,"width":0.008643617,"height":0.01915403},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.5013298,"top":0.09896249,"width":0.029587766,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.69913566,"top":0.09896249,"width":0.02825798,"height":0.01915403},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.68550533,"top":0.123703115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.69547874,"top":0.123703115,"width":0.00731383,"height":0.015163607},"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.70478725,"top":0.123703115,"width":0.007978723,"height":0.015163607},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.7144282,"top":0.12210695,"width":0.00731383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.72174203,"top":0.12210695,"width":0.006981383,"height":0.018355945},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"# **************************** HS **************************************\n\nselect * from teams where id = 2; # 2\nselect * from features; # 2\nselect * from team_features where team_id = 2; # 2\nselect * from crm_configurations where id = 2; # 2\nselect * from users where team_id = 2; #\nselect * from playbooks where team_id = 2; # event 38\nselect * from playbook_categories where playbook_id = 38; #\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id is not null order by id desc;\nhttps://app.hubspot.com/contacts/4392066/deal/16964514951/?engagement=96069102624\n https://app.staging.jiminny.com/playback/d5df34dc-bd66-4ff5-a7b3-8d3be30322a0\n\nSELECT * FROM activities WHERE uuid_to_bin('04fdcd0d-818f-4c53-92dc-6f18bc753ffd') = uuid;\n# 609126 softphone tr. 11241\n\nSELECT * FROM activities WHERE uuid_to_bin('6521bfcd-5a30-46e5-9f74-5440fd48befd') = uuid;\n# 608874 conference tr. 11226 crmId: 103422236596\n\nselect * from ai_prompts where transcription_id IN (11241, 11226);\nselect * from activity_summary_logs where activity_id = 608874;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nselect * from crm_field_data where activity_id = 1223;\n\nselect * from crm_layouts where crm_configuration_id = 2;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (554);\nselect * from crm_fields where crm_configuration_id = 11 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id IN (1455,1450);\n\nSELECT * FROM crm_field_data WHERE crm_layout_entity_id = 971;\nSELECT * FROM crm_field_data WHERE crm_layout_entity_id IN (6494,6495,6496,6497,6498,6499);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u\n on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 2 and sa.provider = 'hubspot';\n\nselect * from opportunities where team_id = 2\nand crm_provider_id IN ('51317301383');\n\nselect * from contacts where id = 85;\n\nselect * from opportunities where team_id = 2 order by id desc;\nselect * from opportunities where team_id = 2 and crm_provider_id = '51317301383'; # 5112\nselect * from opportunities where team_id = 2 and crm_provider_id = '55976759904'; # 5112\nselect * from opportunity_contacts where opportunity_id = 5117;\nselect * from crm_field_data where object_id = 1365;\nSELECT * FROM crm_fields WHERE id IN (1405, 1407, 1972, 2128);\n\nselect * from features;\nselect * from team_features where team_id IN (1);\nselect * from team_features where feature_id IN (36);\n\nSHOW CREATE TABLE opportunity_contacts;\nSELECT * FROM opportunity_contacts WHERE crm_provider_id = '111751';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from opportunities where team_id = 2 and crm_provider_id IN ('374720564','14527423589','49908861993','50435771779'); # 1365\nSELECT * FROM opportunity_contacts WHERE opportunity_id = '414';\nSELECT * FROM opportunity_contacts WHERE crm_provider_id = '131501';\nselect * from contacts where id in (414, 464);\n\nselect * from activities where crm_configuration_id = 2;\n\nselect settings from crm_configurations where id = 11;\n\nselect * from teams; # 1, 2\nselect * from users;\nselect * from crm_configurations where id = 39;\nselect * from team_features where team_id = 2;\nselect * from features;\n# SELECT * FROM opportunities WHERE crm_configuration_id = 2\n# order by id desc;\n# and crm_provider_id = '49908861993';\n\n\nselect * from activity_providers where id IN (443, 202, 203, 227);\n\nselect * from activity_imports where id = 795889;\n\nselect c.id, c.provider, c.settings, t.* from teams t join crm_configurations c on t.id = c.team_id\nwhere c.provider = 'hubspot';\n\nselect * from crm_configurations crm JOIN teams t on crm.team_id = t.id\nwhere provider = 'hubspot';\nSELECT * FROM teams WHERE id = 31;\nSELECT * FROM users WHERE id = 257;\nSELECT * FROM opportunities WHERE team_id = 2;\n\nselect * from opportunity_contacts where opportunity_id = 5124;\nselect * from contacts where id IN (3850,3853,3851,4073,4140,4155,4480,4530,4623,5986,513,687,1806,1523,3613)\n\nselect * from activities where crm_configuration_id = 13;\n\nSELECT * FROM activities WHERE uuid_to_bin('826619ce-ec8e-4e59-8467-a01f5f6ad71e') = uuid; # 418141\n\n\nselect id, team_id, crm_provider_id from crm_configurations where provider = 'hubspot' and crm_provider_id IS NOT NULL;\nSELECT * FROM accounts WHERE team_id = 2 and crm_provider_id = '1212213464' order by id desc;\nSELECT * FROM contacts WHERE team_id = 2 and account_id = 5189 order by id desc;\nSELECT * FROM contacts WHERE team_id = 2 order by id desc;\nselect * from opportunity_contacts where contact_id = 6223;\nSELECT * FROM opportunities WHERE team_id = 2 and account_id = 5189 order by id desc;\n\nselect * from crm_profiles where crm_configuration_id = 2;\n\nselect * from activities where account_id = 46;","depth":4,"value":"# **************************** HS **************************************\n\nselect * from teams where id = 2; # 2\nselect * from features; # 2\nselect * from team_features where team_id = 2; # 2\nselect * from crm_configurations where id = 2; # 2\nselect * from users where team_id = 2; #\nselect * from playbooks where team_id = 2; # event 38\nselect * from playbook_categories where playbook_id = 38; #\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id is not null order by id desc;\nhttps://app.hubspot.com/contacts/4392066/deal/16964514951/?engagement=96069102624\n https://app.staging.jiminny.com/playback/d5df34dc-bd66-4ff5-a7b3-8d3be30322a0\n\nSELECT * FROM activities WHERE uuid_to_bin('04fdcd0d-818f-4c53-92dc-6f18bc753ffd') = uuid;\n# 609126 softphone tr. 11241\n\nSELECT * FROM activities WHERE uuid_to_bin('6521bfcd-5a30-46e5-9f74-5440fd48befd') = uuid;\n# 608874 conference tr. 11226 crmId: 103422236596\n\nselect * from ai_prompts where transcription_id IN (11241, 11226);\nselect * from activity_summary_logs where activity_id = 608874;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nselect * from crm_field_data where activity_id = 1223;\n\nselect * from crm_layouts where crm_configuration_id = 2;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (554);\nselect * from crm_fields where crm_configuration_id = 11 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id IN (1455,1450);\n\nSELECT * FROM crm_field_data WHERE crm_layout_entity_id = 971;\nSELECT * FROM crm_field_data WHERE crm_layout_entity_id IN (6494,6495,6496,6497,6498,6499);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u\n on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 2 and sa.provider = 'hubspot';\n\nselect * from opportunities where team_id = 2\nand crm_provider_id IN ('51317301383');\n\nselect * from contacts where id = 85;\n\nselect * from opportunities where team_id = 2 order by id desc;\nselect * from opportunities where team_id = 2 and crm_provider_id = '51317301383'; # 5112\nselect * from opportunities where team_id = 2 and crm_provider_id = '55976759904'; # 5112\nselect * from opportunity_contacts where opportunity_id = 5117;\nselect * from crm_field_data where object_id = 1365;\nSELECT * FROM crm_fields WHERE id IN (1405, 1407, 1972, 2128);\n\nselect * from features;\nselect * from team_features where team_id IN (1);\nselect * from team_features where feature_id IN (36);\n\nSHOW CREATE TABLE opportunity_contacts;\nSELECT * FROM opportunity_contacts WHERE crm_provider_id = '111751';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from opportunities where team_id = 2 and crm_provider_id IN ('374720564','14527423589','49908861993','50435771779'); # 1365\nSELECT * FROM opportunity_contacts WHERE opportunity_id = '414';\nSELECT * FROM opportunity_contacts WHERE crm_provider_id = '131501';\nselect * from contacts where id in (414, 464);\n\nselect * from activities where crm_configuration_id = 2;\n\nselect settings from crm_configurations where id = 11;\n\nselect * from teams; # 1, 2\nselect * from users;\nselect * from crm_configurations where id = 39;\nselect * from team_features where team_id = 2;\nselect * from features;\n# SELECT * FROM opportunities WHERE crm_configuration_id = 2\n# order by id desc;\n# and crm_provider_id = '49908861993';\n\n\nselect * from activity_providers where id IN (443, 202, 203, 227);\n\nselect * from activity_imports where id = 795889;\n\nselect c.id, c.provider, c.settings, t.* from teams t join crm_configurations c on t.id = c.team_id\nwhere c.provider = 'hubspot';\n\nselect * from crm_configurations crm JOIN teams t on crm.team_id = t.id\nwhere provider = 'hubspot';\nSELECT * FROM teams WHERE id = 31;\nSELECT * FROM users WHERE id = 257;\nSELECT * FROM opportunities WHERE team_id = 2;\n\nselect * from opportunity_contacts where opportunity_id = 5124;\nselect * from contacts where id IN (3850,3853,3851,4073,4140,4155,4480,4530,4623,5986,513,687,1806,1523,3613)\n\nselect * from activities where crm_configuration_id = 13;\n\nSELECT * FROM activities WHERE uuid_to_bin('826619ce-ec8e-4e59-8467-a01f5f6ad71e') = uuid; # 418141\n\n\nselect id, team_id, crm_provider_id from crm_configurations where provider = 'hubspot' and crm_provider_id IS NOT NULL;\nSELECT * FROM accounts WHERE team_id = 2 and crm_provider_id = '1212213464' order by id desc;\nSELECT * FROM contacts WHERE team_id = 2 and account_id = 5189 order by id desc;\nSELECT * FROM contacts WHERE team_id = 2 order by id desc;\nselect * from opportunity_contacts where contact_id = 6223;\nSELECT * FROM opportunities WHERE team_id = 2 and account_id = 5189 order by id desc;\n\nselect * from crm_profiles where crm_configuration_id = 2;\n\nselect * from activities where account_id = 46;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-6231769648332648533
|
633758342714670205
|
click
|
accessibility
|
NULL
|
It's the only usage in Project Files
Find Opti It's the only usage in Project Files
Find Options… (⌃⌥⌘N)
text/html
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
#11976 on JY-20553-debug-crm-sync-delays, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
19
2
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Services\Crm;
use Illuminate\Support\Collection;
use Jiminny\Component\Transcription\Service\TranscriptionService;
use Jiminny\Contracts\Services\Crm\ClientInterface;
use Jiminny\Contracts\Services\Crm\ConnectionStateInterface;
use Jiminny\Contracts\Services\Crm\Provider\HubspotInterface;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\Contracts\Services\Crm\SettingsInterface;
use Jiminny\Contracts\Services\Crm\SupportsObjectTypeParseInterface;
use Jiminny\Contracts\Services\Crm\SyncCrmEntitiesInterface;
use Jiminny\Exceptions\HttpBadRequestException;
use Jiminny\Exceptions\HttpNotFoundException;
use Jiminny\Exceptions\LogicException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Integrations\PlaybookResolver;
use Jiminny\Jobs\Crm\SyncFieldMetadata;
use Jiminny\Models;
use Jiminny\Models\Activity;
use Jiminny\Models\Crm\Configuration;
use Jiminny\Models\Crm\Field;
use Jiminny\Models\Crm\FieldData;
use Jiminny\Models\Crm\FieldValue;
use Jiminny\Models\Crm\Layout;
use Jiminny\Models\Crm\Profile;
use Jiminny\Models\Lead;
use Jiminny\Models\Playbook;
use Jiminny\Models\PlaybookCategory;
use Jiminny\Models\SocialAccount;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\Crm\Helpers\ConnectionStateTrait;
use Jiminny\Services\Crm\Helpers\OpportunitySyncableFieldsTrait;
use Jiminny\Services\TeamService;
use Psr\Log\LoggerInterface;
use Sentry\State\Scope;
abstract class BaseService implements
ServiceInterface,
SettingsInterface,
SyncCrmEntitiesInterface,
ConnectionStateInterface
{
use ConnectionStateTrait;
use OpportunitySyncableFieldsTrait;
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const int SOFT_DELETE_CHUNK = 100;
public const int HARD_DELETE_CHUNK = 1000;
public ?Configuration $config;
public ?Profile $profile;
public ?Team $team = null;
/**
* @var ClientInterface
*/
protected $client;
/**
* @var TeamService
*/
protected TeamService $teamService;
/**
* @var int
*/
protected int $limit;
/**
* @var int
*/
protected int $offset;
/**
* Transcription Service instance.
*
* @var TranscriptionService
*/
protected TranscriptionService $transcriptionService;
protected LoggerInterface $logger;
/**
* Cache for opportunity fields to avoid N+1 queries during batch imports.
* Key: crm_provider_id, Value: Field model with entities relation.
* Cleared when configuration changes.
*
* @var Collection<string, Field>|null
*/
private ?Collection $cachedOpportunityFields = null;
public function __construct()
{
$this->teamService = app(TeamService::class);
$this->transcriptionService = app(TranscriptionService::class);
$this->logger = app(LoggerInterface::class);
}
/**
* @param User $user
*
* @throws SocialAccountTokenInvalidException
*/
public function setUser(User $user): void
{
$this->configureSentryScope($user);
$this->team = $user->team;
$this->teamService->setTeam($user->team);
$this->setConfiguration($user->team->crm);
// Reset state.
$this->profile = $user->crmProfile;
/**
* DO NOT DELETE THIS `clearTokens` CALL
* The purpose of purging tokens is to fix a problem in importing calendar events.
* Calendar Import doesn't always respect "SocialAccountInvalidTokenException" exception
* and may try to recycle old SF instance, with wrong credentials (by ignoring the exception).
*
* This code guarantees the CRM Service is unusable, unless always provided with a valid social account.
*/
if (method_exists($this->client, 'clearTokens')) {
$this->client->clearTokens();
}
$account = $this->getOAuthAccount($user);
$this->validateUserAccountExists($user, $account);
if (method_exists($this->client, 'setOAuthAccount')) {
$this->client->setOAuthAccount($account);
}
if (method_exists($this->client, 'setLogger')) {
$this->client->setLogger($this->logger);
}
if ($this->profile === null) {
// Try to fetch their profile, maybe it was not yet imported?
$cacheKey = sprintf('crm_profile_sync-%s', $user->getId());
$lock = \Cache::lock($cacheKey, 300);
if ($lock->get()) {
$this->profile = $this->getProfile($user);
}
}
// The CRM Service is properly bootstrapped, and supports remote operations
$this->connect();
}
protected function configureSentryScope(User $user): void
{
\Sentry\configureScope(function (Scope $scope) use ($user): void {
$scope->setTag('team_id', (string) $user->getTeamId());
$scope->setUser([
'id' => $user->getId(),
'email' => $user->getEmailAddress(),
]);
});
}
/**
* @param User $user
*
* @return Profile|null
*/
protected function getProfile(User $user): ?Profile
{
return $this->syncProfiles($user);
}
public function getConfiguration(): Configuration
{
return $this->config;
}
public function setConfiguration(Configuration $config): void
{
$this->config = $config;
$this->client->setConfiguration($config);
// Clear field cache when configuration changes to ensure fresh data for new team/config
$this->cachedOpportunityFields = null;
if ($this->team === null) {
$this->team = $config->team;
}
}
public function setPage(int $limit, int $offset): void
{
$this->limit = $limit;
$this->offset = $offset;
}
abstract protected function getOAuthAccount(User $user): ?SocialAccount;
abstract protected function getDefaultFollowupLayoutFields(string $activityType): array;
abstract protected function getFieldTypes(): array;
abstract protected function getFields(string $fieldType): array;
public function syncFields(): void
{
foreach ($this->getFieldTypes() as $fieldType) {
$currentFields = $this->getFields($fieldType);
// TODO: only sync the field once a day if we don't use it in any layout. If we do, sync hourly?
foreach ($currentFields as $field) {
/** @var Models\Crm\Field $field */
$field = $this->config->fields()->updateOrCreate([
'crm_provider_id' => mb_strimwidth($field['name'], 0, 128),
'object_type' => $fieldType,
], [
'label' => mb_strimwidth($field['label'], 0, Field::LABEL_MAX_LENGTH),
]);
try {
$this->syncField($field);
if ($field->type === Models\Crm\Field::TYPE_PICKLIST) {
$this->importPicklistValues($field);
}
} catch (HttpNotFoundException $e) {
$this->logger->error('[sync-fields] Field not found', [
'provider' => $this->getDisplayName(),
'crm_field' => $field->crm_provider_id,
'object_type' => $field->object_type,
'team_id' => $this->team->id,
]);
} catch (HttpBadRequestException $e) {
$this->logger->error('[sync-fields] Field not supported', [
'provider' => $this->getDisplayName(),
'crm_field' => $field->crm_provider_id,
'object_type' => $field->object_type,
'team_id' => $this->team->id,
]);
}
}
}
}
/**
* @param string $objectId
* @param ?string $objectType
*
* @return array
*/
public function parseRecords(string $objectId, ?string $objectType = null): array
{
if ($objectType === null && $this instanceof SupportsObjectTypeParseInterface) {
$objectType = $this->parseObjectType($objectId);
}
$lead = null;
$contact = null;
$opportunity = null;
$account = null;
$stage = null;
$countryCode = null;
// Gather the prospect data to store on activity/participant.
switch ($objectType) {
case self::OBJECT_LEAD:
/** @var ?Lead $lead */
$lead = $this->config->leads()->where('crm_provider_id', $objectId)->first();
if ($lead === null) {
$lead = $this->syncLead($objectId);
}
if ($lead?->country_code) {
$countryCode = $lead->country_code;
}
$stage = $lead?->stage;
break;
case self::OBJECT_ACCOUNT:
$account = $this->config->accounts()->where('crm_provider_id', $objectId)->first();
if ($account === null) {
$account = $this->syncAccount($objectId);
}
if ($account->country_code) {
$countryCode = $account->country_code;
}
break;
case self::OBJECT_CONTACT:
$contact = $this->config->contacts()->where('crm_provider_id', $objectId)->first();
if ($contact === null) {
$contact = $this->syncContact($objectId);
}
if ($contact?->country_code) {
$countryCode = $contact->country_code;
}
$account = $contact?->account;
break;
case self::OBJECT_OPPORTUNITY:
$opportunity = $this->config->opportunities()->where('crm_provider_id', $objectId)->first();
if ($opportunity === null) {
$opportunity = $this->syncOpportunity($objectId);
}
if ($opportunity !== null) {
$stage = $opportunity->stage;
$account = $opportunity->account;
if ($account->country_code) {
$countryCode = $account->country_code;
}
}
break;
}
return [
$lead,
$account,
$opportunity,
$contact,
$stage,
$countryCode,
];
}
/**
* @param null|string $name
*
* @return null|string
*/
public function convertCountryNameToCode(?string $name): ?string
{
return app(CountryCodeResolver::class)->resolveCountryCode($name);
}
/**
* @param PlaybookCategory $category
*
* @return bool
*/
public function matchesCrmType(PlaybookCategory $category): bool
{
if ($category->playbook === null) {
return false;
}
if ($category->getPlaybook()->getActivityField() === null) {
return false;
}
$fieldValue = $category
->playbook
->activityField
->values()
->where('label', $category->name);
// Check the field values for a matching option.
return $fieldValue->exists();
}
/**
* @param PlaybookCategory $category
*
* @return FieldValue|null
*/
public function getCrmType(PlaybookCategory $category): ?FieldValue
{
$fieldValue = $category
->playbook
->activityField
->values()
->where('label', $category->name);
return $fieldValue->first();
}
/**
* @return int|float|string
*/
public function getMinimumApiVersion(): int|float|string
{
return $this->client->getMinimumApiVersion();
}
/**
* @param string $accountId
*
* @return bool
*/
protected function hasAccount(string $accountId): bool
{
return $this->config->accounts()->where('crm_provider_id', $accountId)->exists();
}
/**
* @param string $opportunityId
*
* @return bool
*/
protected function hasOpportunity(string $opportunityId): bool
{
return $this->config->opportunities()->where('crm_provider_id', $opportunityId)->exists();
}
/**
* @param string $contactId
*
* @return bool
*/
protected function hasContact(string $contactId): bool
{
return $this->config->contacts()->where('crm_provider_id', $contactId)->exists();
}
/**
* @param string $leadId
*
* @return bool
*/
protected function hasLead(string $leadId): bool
{
return $this->config->leads()->where('crm_provider_id', $leadId)->exists();
}
public function fetchAndAssociateRelatedActivity(Activity $activity): ?Activity
{
return null;
}
public function getJobDelay(): int
{
return 0;
}
public function getPlaybookFromActivity(Activity $activity): ?Playbook
{
if ($activity->hasActivityType() && $activity->getActivityType()->hasPlaybook()) {
return $activity->getActivityType()->getPlaybook();
}
return $this->getPlaybook($activity->getUser());
}
/**
* Gets the playbook for the user
*/
protected function getPlaybook(User $user): ?Playbook
{
$playbookResolver = app(PlaybookResolver::class);
return $playbookResolver->resolvePlaybookByUser($user);
}
/**
* @param Models\Playbook $playbook
* @param string $categoryName
*
* @return Models\PlaybookCategory|null
*/
protected function getPlaybookCategory(Models\Playbook $playbook, string $categoryName): ?Models\PlaybookCategory
{
return $playbook->categories()
->where('name', trim($categoryName))
->latest()
->first();
}
public function buildLayout(Layout $layout, ?string $activityType): void
{
if ($activityType) {
// Base section. Currently, the fields within are hard coded so this is empty for now.
/** @var Models\Crm\LayoutEntity $activitySection */
$activitySection = $layout->entities()->create([
'label' => 'activity-summary',
'description' => 'Activity Summary',
'sequence' => 0,
]);
if ($this instanceof HubspotInterface) {
$activityFields = $this->getDefaultActivityLayoutFields($activityType, $layout->type);
foreach ($activityFields as $i => $field) {
$layout->entities()->create([
'parent_entity_id' => $activitySection->getId(),
'crm_field_id' => $field->getId(),
'sequence' => $i,
]);
}
}
// Follow-up section. These are all dynamic fields.
$sectionTitle = ($layout->type === Layout::TYPE_CONFERENCE_SUMMARY ? 'Next Steps...' : 'Follow up?');
/** @var Models\Crm\LayoutEntity $followupSection */
$followupSection = $layout->entities()->create([
'label' => 'follow-up',
'description' => $sectionTitle,
'sequence' => 1,
]);
$followupFields = $this->getDefaultFollowupLayoutFields($activityType);
foreach ($followupFields as $i => $field) {
$layout->entities()->create([
'parent_entity_id' => $followupSection->getId(),
'crm_field_id' => $field->getId(),
'sequence' => $i,
]);
}
} elseif ($layout->type == Layout::TYPE_DEAL_INSIGHTS) {
$this->populateLayoutEntities($layout);
}
}
protected function populateLayoutEntities(Layout $layout): void
{
$dealFields = $this->getDefaultDealLayoutFields();
foreach ($dealFields as $i => $field) {
$readOnly = $field->getType() === Field::TYPE_CURRENCY
|| $this->isBusinessTypeField($field);
$layout->entities()->updateOrCreate([
'crm_field_id' => $field->id,
], [
'sequence' => $i,
'read_only' => $readOnly,
]);
}
}
public function prepareValueForUpdate(array $params): array
{
$fieldName = $params['fieldName'];
$fieldValue = $params['fieldValue'];
return [$fieldName => $fieldValue];
}
protected function getDefaultDealLayoutFields(): array
{
$fieldData = $this->getDealInsightsFields();
$fields = [];
foreach ($fieldData as $data) {
/** @var Field $field */
$field = $this->config->fields()->updateOrCreate([
'crm_provider_id' => $data['crm_provider_id'],
'object_type' => $data['object_type'],
], ['label' => $data['crm_provider_id']]);
try {
dispatch_sync(new SyncFieldMetadata($this->config->team, $field));
$field->refresh();
} catch (\Throwable $throwable) {
\Sentry::captureException($throwable);
}
$fields[] = $field;
}
return $fields;
}
public function importOpportunityCrmFieldData(array $crmData, array $crmFields, int $opportunityId): void
{
// Pre-fetch all opportunity fields once per batch to avoid N+1 queries.
// During webhook floods, this reduces DB queries from O(fields × deals) to O(1) for field lookups.
$fieldsMap = $this->getOpportunityFieldsMap();
foreach ($crmFields as $fieldName) {
$field = $fieldsMap->get($fieldName);
if (! $field instanceof Field) {
$this->logger->warning('Field not found', [
'field' => $fieldName,
'opportunity_id' => $opportunityId,
]);
continue;
}
// A CRM field data will be synced only if the field exists as part of at least one layout,
// i.e. an entity related to the field exists.
$entity = $field->entities->first();
if (! $entity instanceof Models\Crm\LayoutEntity) {
continue;
}
$fieldValue = $crmData[$fieldName] ?? '';
if (is_object($fieldValue)) {
$this->logger->warning('Field value is an object', [
'field' => $fieldName,
]);
continue;
}
$value = $this->normalizeValue($field->type, $fieldValue, true);
FieldData::updateOrCreate([
'crm_layout_entity_id' => $entity->id,
'crm_field_id' => $field->id,
'object_type' => 'opportunity',
'object_id' => $opportunityId,
], ['value' => $value]);
}
}
/**
* Get cached opportunity fields map for efficient lookups during batch imports.
*
* This method fetches all opportunity fields with their entities relation ONCE
* and caches them for the lifetime of this service instance. This eliminates
* the N+1 query problem where each field was fetched individually per deal.
*
* Performance impact:
* - Before: 10 fields × 100 deals = 1,000 field queries per batch
* - After: 1 query per batch (regardless of deal count)
*
* @return Collection<string, Field> Fields keyed by crm_provider_id
*/
private function getOpportunityFieldsMap(): Collection
{
if ($this->cachedOpportunityFields === null) {
$this->cachedOpportunityFields = $this->config->fields()
->with('entities')
->where('object_type', '=', self::OBJECT_OPPORTUNITY)
->get()
->keyBy('crm_provider_id');
}
return $this->cachedOpportunityFields;
}
/**
* @param array<mixed> $crmData
* @param Collection $crmFields
* @param int $objectId
*
* @return void
*/
public function importCrmFieldData(array $crmData, Collection $crmFields, int $objectId): void
{
/** @var Field $crmField */
foreach ($crmFields as $crmField) {
// If the field name does not match one we are interested in, skip.
if (array_key_exists($crmField->crm_provider_id, $crmData) === false) {
continue;
}
/** @var string $fieldValue */
$fieldValue = $crmData[$crmField->crm_provider_id];
$value = $this->normalizeValue($crmField->type, $fieldValue, true);
FieldData::updateOrCreate([
'crm_field_id' => $crmField->id,
'object_type' => $crmField->object_type,
'object_id' => $objectId,
], ['value' => $value]);
}
}
protected function getTeam(): Team
{
if (! $this->team instanceof Team) {
throw new LogicException('Expecting team model instance');
}
return $this->team;
}
public function isBusinessTypeField(Field $field): bool
{
return in_array($field->crm_provider_id, Field::BUSINESS_TYPE_FIELDS)
&& $field->object_type === Field::OBJECT_OPPORTUNITY;
}
/**
* @return mixed[]
*/
public function fetchRelatedActivity(Activity $activity): array
{
return [];
}
/**
* @throws SocialAccountTokenInvalidException
*/
private function validateUserAccountExists(User $user, ?SocialAccount $account = null): void
{
if ($account instanceof SocialAccount && $account->state === SocialAccount::STATE_CONNECTED) {
return;
}
$this->logger->warning(
sprintf('[%s] Account not connected for user', $this->getDisplayName()),
[
'userId' => $user->getIdString(),
'account' => $account,
]
);
// If their profile was never setup in the first place
if ($this->profile === null) {
// Create a dummy in-memory profile just to be able to run
$this->profile = new Profile();
}
if (! $account instanceof SocialAccount) {
throw new SocialAccountTokenInvalidException(
sprintf(
'Social account for %s cannot be found. Please login to Jiminny to connect.',
$this->getDisplayName()
)
);
}
throw new SocialAccountTokenInvalidException(
sprintf(
'Your %s account has become disconnected. Please login to Jiminny to reconnect.',
$this->getDisplayName()
)
);
}
public function listSupportedObjectTypes(): array
{
return $this->getFieldTypes();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Code changed:
Hide
Sync Changes
Hide This Notification
6
1
6
Previous Highlighted Error
Next Highlighted Error
# [PASSWORD_DOTS] HS [PASSWORD_DOTS]
select * from teams where id = 2; # 2
select * from features; # 2
select * from team_features where team_id = 2; # 2
select * from crm_configurations where id = 2; # 2
select * from users where team_id = 2; #
select * from playbooks where team_id = 2; # event 38
select * from playbook_categories where playbook_id = 38; #
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id is not null order by id desc;
https://app.hubspot.com/contacts/4392066/deal/16964514951/?engagement=96069102624
https://app.staging.jiminny.com/playback/d5df34dc-bd66-4ff5-a7b3-8d3be30322a0
SELECT * FROM activities WHERE uuid_to_bin('04fdcd0d-818f-4c53-92dc-6f18bc753ffd') = uuid;
# 609126 softphone tr. 11241
SELECT * FROM activities WHERE uuid_to_bin('6521bfcd-5a30-46e5-9f74-5440fd48befd') = uuid;
# 608874 conference tr. 11226 crmId: 103422236596
select * from ai_prompts where transcription_id IN (11241, 11226);
select * from activity_summary_logs where activity_id = 608874;
select * from sidekick_settings;
select * from default_activity_types;
select * from crm_field_data where activity_id = 1223;
select * from crm_layouts where crm_configuration_id = 2;
SELECT * FROM crm_layout_entities WHERE crm_layout_id IN (554);
select * from crm_fields where crm_configuration_id = 11 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id IN (1455,1450);
SELECT * FROM crm_field_data WHERE crm_layout_entity_id = 971;
SELECT * FROM crm_field_data WHERE crm_layout_entity_id IN (6494,6495,6496,6497,6498,6499);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u
on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 2 and sa.provider = 'hubspot';
select * from opportunities where team_id = 2
and crm_provider_id IN ('51317301383');
select * from contacts where id = 85;
select * from opportunities where team_id = 2 order by id desc;
select * from opportunities where team_id = 2 and crm_provider_id = '51317301383'; # 5112
select * from opportunities where team_id = 2 and crm_provider_id = '55976759904'; # 5112
select * from opportunity_contacts where opportunity_id = 5117;
select * from crm_field_data where object_id = 1365;
SELECT * FROM crm_fields WHERE id IN (1405, 1407, 1972, 2128);
select * from features;
select * from team_features where team_id IN (1);
select * from team_features where feature_id IN (36);
SHOW CREATE TABLE opportunity_contacts;
SELECT * FROM opportunity_contacts WHERE crm_provider_id = '111751';
# $slug = 'HUBSPOT_WEBHOOK_SYNC';
# $team = Jiminny\Models\Team::find(2);
# $feature = Feature::query()->where('slug', $slug)->first();
# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);
# hubspot_webhook_metrics
select * from opportunities where team_id = 2 and crm_provider_id IN ('374720564','14527423589','49908861993','50435771779'); # 1365
SELECT * FROM opportunity_contacts WHERE opportunity_id = '414';
SELECT * FROM opportunity_contacts WHERE crm_provider_id = '131501';
select * from contacts where id in (414, 464);
select * from activities where crm_configuration_id = 2;
select settings from crm_configurations where id = 11;
select * from teams; # 1, 2
select * from users;
select * from crm_configurations where id = 39;
select * from team_features where team_id = 2;
select * from features;
# SELECT * FROM opportunities WHERE crm_configuration_id = 2
# order by id desc;
# and crm_provider_id = '49908861993';
select * from activity_providers where id IN (443, 202, 203, 227);
select * from activity_imports where id = 795889;
select c.id, c.provider, c.settings, t.* from teams t join crm_configurations c on t.id = c.team_id
where c.provider = 'hubspot';
select * from crm_configurations crm JOIN teams t on crm.team_id = t.id
where provider = 'hubspot';
SELECT * FROM teams WHERE id = 31;
SELECT * FROM users WHERE id = 257;
SELECT * FROM opportunities WHERE team_id = 2;
select * from opportunity_contacts where opportunity_id = 5124;
select * from contacts where id IN (3850,3853,3851,4073,4140,4155,4480,4530,4623,5986,513,687,1806,1523,3613)
select * from activities where crm_configuration_id = 13;
SELECT * FROM activities WHERE uuid_to_bin('826619ce-ec8e-4e59-8467-a01f5f6ad71e') = uuid; # 418141
select id, team_id, crm_provider_id from crm_configurations where provider = 'hubspot' and crm_provider_id IS NOT NULL;
SELECT * FROM accounts WHERE team_id = 2 and crm_provider_id = '1212213464' order by id desc;
SELECT * FROM contacts WHERE team_id = 2 and account_id = 5189 order by id desc;
SELECT * FROM contacts WHERE team_id = 2 order by id desc;
select * from opportunity_contacts where contact_id = 6223;
SELECT * FROM opportunities WHERE team_id = 2 and account_id = 5189 order by id desc;
select * from crm_profiles where crm_configuration_id = 2;
select * from activities where account_id = 46;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
|
41927
|
889
|
17
|
2026-04-17T06:37:53.776154+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-17/1776 /Users/lukas/.screenpipe/data/data/2026-04-17/1776407873776_m2.jpg...
|
PhpStorm
|
faVsco.js – SendReportJob.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
IDE error occurred
text/html
text/html
text/html
S IDE error occurred
text/html
text/html
text/html
See details and submit report
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsCommandTest
Run 'AutomatedReportsCommandTest'
Debug 'AutomatedReportsCommandTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
4
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\AutomatedReports;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Storage;
use Jiminny\Component\Queue\Constants;
use Jiminny\Exceptions\FileNotFoundException;
use Jiminny\Exceptions\RuntimeException;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class SendReportJob implements ShouldQueue, ShouldBeUnique
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Send Report]';
/**
* The number of times the job may be attempted.
*
* @var int
*/
public int $tries = 2;
/**
* The maximum number of seconds the job should be allowed to run.
*
* @var int
*/
public int $timeout = 120;
/**
* Create a new job instance.
*
* @param string $reportUuid The UUID of the report to send
*/
public function __construct(private readonly string $reportUuid)
{
$this->onQueue(Constants::QUEUE_ANALYTICS_LOW);
}
public function handle(
LoggerInterface $logger,
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService
): void {
try {
$report = $automatedReportsService->getReportResult($this->reportUuid);
} catch (Throwable $e) {
$logger->error(self::LOG_PREFIX . ' Error getting report result', [
'uuid' => $this->reportUuid,
'exception' => $e->getMessage(),
]);
throw $e;
}
$logger->info(self::LOG_PREFIX . ' Processing report', [
'uuid' => $this->reportUuid,
'status' => $report->getStatusLabel(),
]);
$s3Path = $automatedReportsService->getMediaPath($report);
if ($s3Path === null) {
$logger->error(self::LOG_PREFIX . ' Report media path is null', [
'uuid' => $this->reportUuid,
'mediaType' => $report->getMediaType(),
]);
throw new FileNotFoundException('Report media path could not be resolved');
}
// Verify the file exists in S3
if (! Storage::disk('client-data-cloud')->exists($s3Path)) {
$logger->error(self::LOG_PREFIX . ' Report file not found in S3', [
'uuid' => $this->reportUuid,
's3Path' => $s3Path,
]);
throw new FileNotFoundException('Report file not found in S3');
}
try {
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
if (empty($validRecipients)) {
$logger->error(self::LOG_PREFIX . ' No valid recipients found', [
'uuid' => $this->reportUuid,
]);
throw new RuntimeException("No recipients found for report: {$this->reportUuid}");
}
// Get report metadata (same for all recipients)
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$isAskJiminny = $report->getReport()->isAskJiminnyReport();
// Track how many jobs were dispatched
$dispatchCount = 0;
// Dispatch a job for each recipient
foreach ($validRecipients as $recipient) {
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $this->reportUuid,
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: $isAskJiminny,
)
);
$dispatchCount++;
$logger->info(self::LOG_PREFIX . ' Dispatched mail job', [
'uuid' => $this->reportUuid,
'email' => $recipient['email'],
]);
}
$logger->info(self::LOG_PREFIX . ' Successfully dispatched mail jobs', [
'uuid' => $this->reportUuid,
'count' => $dispatchCount,
]);
} catch (Throwable $e) {
$logger->error(self::LOG_PREFIX . ' Error processing report', [
'uuid' => $this->reportUuid,
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
// Get current attempt (1-indexed)
$attempt = $this->attempts();
if ($attempt < $this->tries) {
$delay = 30 * (2 ** ($attempt - 1)); // Exponential backoff: 30s, 60s
$logger->info(self::LOG_PREFIX . ' retry job, attempts: ' . $attempt, [
'delay' => $delay,
]);
$this->release($delay);
} else {
$this->fail($e);
}
}
}
public function failed(Throwable $exception): void
{
AutomatedReportResult::whereRaw('uuid = uuid_to_bin(?)', [$this->reportUuid])
->update(['status' => AutomatedReportResult::STATUS_FAILED]);
}
/**
* Get a unique ID for the job.
*
* @return string
*/
public function uniqueId(): string
{
return $this->reportUuid;
}
}
Show Replace Field
Search History
"podcast_audio_url"
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
1/54
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Code changed:
Hide
Sync Changes
Hide This Notification
[
{
"id": 136,
"media_type": "pdf",
"response": {"request_id":"debee4b3-1c28-4112-ad1b-f0dbe67c452c",
"status":"completed",
"timestamp":"2025-09-29T01:09:25.039253+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.json",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.ssml"}
},
{
"id": 137,
"media_type": "podcast",
"response": {"request_id":"debee4b3-1c28-4112-ad1b-f0dbe67c452c",
"status":"completed",
"timestamp":"2025-09-29T01:09:25.039253+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.json",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.ssml"}
},
{
"id": 149,
"media_type": "pdf",
"response": {"request_id":"81690efb-e296-4efe-ba74-51217e91bc7e",
"status":"completed",
"timestamp":"2025-10-06T01:05:39.117068+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.json",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.ssml"}
},
{
"id": 150,
"media_type": "podcast",
"response": {"request_id":"81690efb-e296-4efe-ba74-51217e91bc7e",
"status":"completed",
"timestamp":"2025-10-06T01:05:39.117068+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.json",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.ssml"}
},
{
"id": 166,
"media_type": "pdf",
"response": {"request_id":"43fc8095-52f0-420b-ade2-409b8ed8b7ee",
"status":"completed",
"timestamp":"2025-10-13T01:08:35.779362+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.ssml"}
},
{
"id": 167,
"media_type": "podcast",
"response": {"request_id":"43fc8095-52f0-420b-ade2-409b8ed8b7ee",
"status":"completed",
"timestamp":"2025-10-13T01:08:35.779362+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.ssml"}
},
{
"id": 214,
"media_type": "pdf",
"response": {"request_id":"985cab60-fae4-47e9-8779-0b653827b635",
"status":"completed",
"timestamp":"2025-10-20T01:07:43.633450+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.ssml"}
},
{
"id": 215,
"media_type": "podcast",
"response": {"request_id":"985cab60-fae4-47e9-8779-0b653827b635",
"status":"completed",
"timestamp":"2025-10-20T01:07:43.633450+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.ssml"}
},
{
"id": 297,
"media_type": "pdf",
"response": {"request_id":"cacce61e-fb58-47b6-97f5-b17b98d453d2",
"status":"completed",
"timestamp":"2025-10-27T01:02:34.789377+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.ssml"}
},
{
"id": 298,
"media_type": "podcast",
"response": {"request_id":"cacce61e-fb58-47b6-97f5-b17b98d453d2",
"status":"completed",
"timestamp":"2025-10-27T01:02:34.789377+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.ssml"}
},
{
"id": 365,
"media_type": "pdf",
"response": {"request_id":"a1971341-a81e-45bc-9d17-1ad914163010",
"status":"completed",
"timestamp":"2025-11-03T01:03:31.381285+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.ssml"}
},
{
"id": 366,
"media_type": "podcast",
"response": {"request_id":"a1971341-a81e-45bc-9d17-1ad914163010",
"status":"completed",
"timestamp":"2025-11-03T01:03:31.381285+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.ssml"}
},
{
"id": 410,
"media_type": "pdf",
"response": {"request_id":"7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30",
"status":"completed",
"timestamp":"2025-11-10T01:05:31.021881+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.ssml"}
},
{
"id": 411,
"media_type": "podcast",
"response": {"request_id":"7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30",
"status":"completed",
"timestamp":"2025-11-10T01:05:31.021881+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.ssml"}
},
{
"id": 485,
"media_type": "pdf",
"response": {"request_id":"18d3cc3d-95ac-434b-a21c-076318bd77aa",
"status":"completed",
"timestamp":"2025-11-17T01:05:21.492550+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.ssml"}
},
{
"id": 486,
"media_type": "podcast",
"response": {"request_id":"18d3cc3d-95ac-434b-a21c-076318bd77aa",
"status":"completed",
"timestamp":"2025-11-17T01:05:21.492550+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.ssml"}
},
{
"id": 592,
"media_type": "pdf",
"response": {"request_id":"d0f6fbb3-e86d-49bb-a863-8238aea5b401",
"status":"completed",
"timestamp":"2025-11-24T01:06:05.698838+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.ssml"}
},
{
"id": 593,
"media_type": "podcast",
"response": {"request_id":"d0f6fbb3-e86d-49bb-a863-8238aea5b401",
"status":"completed",
"timestamp":"2025-11-24T01:06:05.698838+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.ssml"}
},
{
"id": 636,
"media_type": "pdf",
"response": {"request_id":"264a5a2a-1e0d-49b5-aeba-268a19a74f85",
"status":"completed",
"timestamp":"2025-12-01T01:11:00.769937+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.ssml"}
},
{
"id": 638,
"media_type": "podcast",
"response": {"request_id":"264a5a2a-1e0d-49b5-aeba-268a19a74f85",
"status":"completed",
"timestamp":"2025-12-01T01:11:00.769937+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.ssml"}
},
{
"id": 704,
"media_type": "pdf",
"response": {"request_id":"d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565",
"status":"completed",
"timestamp":"2025-12-08T01:06:28.080704+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.ssml"}
},
{
"id": 705,
"media_type": "podcast",
"response": {"request_id":"d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565",
"status":"completed",
"timestamp":"2025-12-08T01:06:28.080704+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.ssml"}
},
{
"id": 762,
"media_type": "pdf",
"response": {"request_id":"de426138-2bce-43b9-9c6f-31079b2abc44",
"status":"completed",
"timestamp":"2025-12-15T01:02:21.300804+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.ssml"}
},
{
"id": 763,
"media_type": "podcast",
"response": {"request_id":"de426138-2bce-43b9-9c6f-31079b2abc44",
"status":"completed",
"timestamp":"2025-12-15T01:02:21.300804+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.ssml"}
},
{
"id": 801,
"media_type": "pdf",
"response": {"request_id":"3ca694c0-d6a5-4937-8d60-8d69f0bca04f",
"status":"completed",
"timestamp":"2025-12-22T01:06:16.547481+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.ssml"}
},
{
"id": 802,
"media_type": "podcast",
"response": {"request_id":"3ca694c0-d6a5-4937-8d60-8d69f0bca04f",
"status":"completed",
"timestamp":"2025-12-22T01:06:16.547481+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.ssml"}
},
{
"id": 830,
"media_type": "pdf",
"response": null
},
{
"id": 831,
"media_type": "podcast",
"response": null
},
{
"id": 915,
"media_type": "pdf",
"response": null
},
{
"id": 916,
"media_type": "podcast",
"response": null
},
{
"id": 936,
"media_type": "pdf",
"response": {"request_id":"64123b94-2da0-48d4-a712-bb35e9af586d",
"status":"completed",
"timestamp":"2026-01-12T01:02:07.988029+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.ssml"}
},
{
"id": 937,
"media_type": "podcast",
"response": {"request_id":"64123b94-2da0-48d4-a712-bb35e9af586d",
"status":"completed",
"timestamp":"2026-01-12T01:02:07.988029+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.ssml"}
},
{
"id": 993,
"media_type": "pdf",
"response": {"request_id":"d09beab4-afb6-47bc-b8bc-9a1c0c900b19",
"status":"completed",
"timestamp":"2026-01-19T01:02:53.956691+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.ssml"}
},
{
"id": 995,
"media_type": "podcast",
"response": {"request_id":"d09beab4-afb6-47bc-b8bc-9a1c0c900b19",
"status":"completed",
"timestamp":"2026-01-19T01:02:53.956691+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.ssml"}
},
{
"id": 1026,
"media_type": "pdf",
"response": {"request_id":"6c389d6a-7418-42ba-beb6-449dca36585f",
"status":"completed",
"timestamp":"2026-01-26T01:02:56.634667+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.ssml"}
},
{
"id": 1027,
"media_type": "podcast",
"response": {"request_id":"6c389d6a-7418-42ba-beb6-449dca36585f",
"status":"completed",
"timestamp":"2026-01-26T01:02:56.634667+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.ssml"}
},
{
"id": 1146,
"media_type": "pdf",
"response": {"request_id":"df566c11-80ff-42ef-9996-1e80909e7bc2",
"status":"completed",
"timestamp":"2026-02-02T01:07:57.335690+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.ssml"}
},
{
"id": 1147,
"media_type": "podcast",
"response": {"request_id":"df566c11-80ff-42ef-9996-1e80909e7bc2",
"status":"completed",
"timestamp":"2026-02-02T01:07:57.335690+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.ssml"}
},
{
"id": 1221,
"media_type": "pdf",
"response": {"request_id":"0d7a164c-ae0c-4411-8778-4b6ffc201dde",
"status":"completed",
"timestamp":"2026-02-09T01:14:26.525625+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.ssml"}
},
{
"id": 1222,
"media_type": "podcast",
"response": {"request_id":"0d7a164c-ae0c-4411-8778-4b6ffc201dde",
"status":"completed",
"timestamp":"2026-02-09T01:14:26.525625+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.ssml"}
},
{
"id": 1250,
"media_type": "pdf",
"response": {"request_id":"249776ec-1163-486a-a288-f3a99b1b1a00",
"status":"completed",
"timestamp":"2026-02-16T01:05:49.814997+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.ssml"}
},
{
"id": 1251,
"media_type": "podcast",
"response": {"request_id":"249776ec-1163-486a-a288-f3a99b1b1a00",
"status":"completed",
"timestamp":"2026-02-16T01:05:49.814997+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.ssml"}
},
{
"id": 1319,
"media_type": "pdf",
"response": {"request_id":"4f9599a9-9ca9-4b05-862a-4f4461a4a754",
"status":"completed",
"timestamp":"2026-02-23T01:14:56.719622+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.ssml"}
},
{
"id": 1320,
"media_type": "podcast",
"response": {"request_id":"4f9599a9-9ca9-4b05-862a-4f4461a4a754",
"status":"completed",
"timestamp":"2026-02-23T01:14:56.719622+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.ssml"}
},
{
"id": 1438,
"media_type": "pdf",
"response": {"request_id":"7c99607a-ca13-4d6c-8928-ed6a33073e68",
"status":"completed",
"timestamp":"2026-03-02T01:21:57.924168+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.ssml"}
},
{
"id": 1439,
"media_type": "podcast",
"response": {"request_id":"7c99607a-ca13-4d6c-8928-ed6a33073e68",
"status":"completed",
"timestamp":"2026-03-02T01:21:57.924168+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.ssml"}
},
{
"id": 1474,
"media_type": "pdf",
"response": {"request_id":"1c696c7b-88ef-43d0-ade4-8f006602f520",
"status":"completed",
"timestamp":"2026-03-09T01:12:54.568944+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.ssml"}
},
{
"id": 1475,
"media_type": "podcast",
"response": {"request_id":"1c696c7b-88ef-43d0-ade4-8f006602f520",
"status":"completed",
"timestamp":"2026-03-09T01:12:54.568944+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.ssml"}
},
{
"id": 1548,
"media_type": "pdf",
"response": {"request_id":"26ab917c-6907-416d-806d-679c3a49cfc1",
"status":"completed",
"timestamp":"2026-03-16T01:15:23.832336+00:...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"IDE error occurred","depth":3,"bounds":{"left":0.8535156,"top":0.93541664,"width":0.1296875,"height":0.011805556},"value":"IDE error occurred","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8535156,"top":0.93541664,"width":0.044140626,"height":0.011805556},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"See details and submit report","depth":2,"bounds":{"left":0.8535156,"top":0.95069444,"width":0.07070313,"height":0.011805556},"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.03046875,"top":0.017361112,"width":0.0453125,"height":0.022222223},"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#11894 on JY-18909-automated-reports-ask-jiminny, menu","depth":5,"bounds":{"left":0.07578125,"top":0.017361112,"width":0.14960937,"height":0.022222223},"help_text":"Pull request #11894 exists for current branch JY-18909-automated-reports-ask-jiminny, but local branch is out of sync with remote","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.78515625,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AutomatedReportsCommandTest","depth":6,"bounds":{"left":0.803125,"top":0.017361112,"width":0.09765625,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AutomatedReportsCommandTest'","depth":6,"bounds":{"left":0.9007813,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AutomatedReportsCommandTest'","depth":6,"bounds":{"left":0.9140625,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9273437,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96015626,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9734375,"top":0.017361112,"width":0.01328125,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9867188,"top":0.017361112,"width":0.013281226,"height":0.022222223},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.049609374,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.009375,"height":0.0},"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.00859375,"height":0.0},"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.00859375,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.008203125,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\AutomatedReports;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Support\\Facades\\Storage;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\FileNotFoundException;\nuse Jiminny\\Exceptions\\RuntimeException;\nuse Jiminny\\Jobs\\JobDispatcherInterface;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass SendReportJob implements ShouldQueue, ShouldBeUnique\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Send Report]';\n\n /**\n * The number of times the job may be attempted.\n *\n * @var int\n */\n public int $tries = 2;\n\n /**\n * The maximum number of seconds the job should be allowed to run.\n *\n * @var int\n */\n public int $timeout = 120;\n\n /**\n * Create a new job instance.\n *\n * @param string $reportUuid The UUID of the report to send\n */\n public function __construct(private readonly string $reportUuid)\n {\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function handle(\n LoggerInterface $logger,\n JobDispatcherInterface $jobDispatcher,\n AutomatedReportsService $automatedReportsService\n ): void {\n try {\n $report = $automatedReportsService->getReportResult($this->reportUuid);\n } catch (Throwable $e) {\n $logger->error(self::LOG_PREFIX . ' Error getting report result', [\n 'uuid' => $this->reportUuid,\n 'exception' => $e->getMessage(),\n ]);\n\n throw $e;\n }\n\n $logger->info(self::LOG_PREFIX . ' Processing report', [\n 'uuid' => $this->reportUuid,\n 'status' => $report->getStatusLabel(),\n ]);\n\n $s3Path = $automatedReportsService->getMediaPath($report);\n\n if ($s3Path === null) {\n $logger->error(self::LOG_PREFIX . ' Report media path is null', [\n 'uuid' => $this->reportUuid,\n 'mediaType' => $report->getMediaType(),\n ]);\n\n throw new FileNotFoundException('Report media path could not be resolved');\n }\n\n // Verify the file exists in S3\n if (! Storage::disk('client-data-cloud')->exists($s3Path)) {\n $logger->error(self::LOG_PREFIX . ' Report file not found in S3', [\n 'uuid' => $this->reportUuid,\n 's3Path' => $s3Path,\n ]);\n\n throw new FileNotFoundException('Report file not found in S3');\n }\n\n try {\n $validRecipients = $automatedReportsService->getValidRecipientUsers(\n $report->getReport(),\n includeJiminny: true,\n );\n\n if (empty($validRecipients)) {\n $logger->error(self::LOG_PREFIX . ' No valid recipients found', [\n 'uuid' => $this->reportUuid,\n ]);\n\n throw new RuntimeException(\"No recipients found for report: {$this->reportUuid}\");\n }\n\n // Get report metadata (same for all recipients)\n $fileName = $automatedReportsService->getReportFileName($report);\n $typeName = $report->getReport()->getCustomName()\n ?? $automatedReportsService->getReportTypeName($report);\n $teamsName = $automatedReportsService->getReportTeamsName($report);\n $periodName = $automatedReportsService->getReportPeriodName($report);\n $isAskJiminny = $report->getReport()->isAskJiminnyReport();\n\n // Track how many jobs were dispatched\n $dispatchCount = 0;\n\n // Dispatch a job for each recipient\n foreach ($validRecipients as $recipient) {\n $jobDispatcher->dispatch(\n new SendReportMailJob(\n reportUuid: $this->reportUuid,\n s3Path: $s3Path,\n recipientEmail: $recipient['email'],\n recipientName: $recipient['name'] ?? null,\n fileName: $fileName,\n typeName: $typeName,\n teamsName: $teamsName,\n periodName: $periodName,\n isAskJiminny: $isAskJiminny,\n )\n );\n $dispatchCount++;\n\n $logger->info(self::LOG_PREFIX . ' Dispatched mail job', [\n 'uuid' => $this->reportUuid,\n 'email' => $recipient['email'],\n ]);\n }\n\n $logger->info(self::LOG_PREFIX . ' Successfully dispatched mail jobs', [\n 'uuid' => $this->reportUuid,\n 'count' => $dispatchCount,\n ]);\n } catch (Throwable $e) {\n $logger->error(self::LOG_PREFIX . ' Error processing report', [\n 'uuid' => $this->reportUuid,\n 'error' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n // Get current attempt (1-indexed)\n $attempt = $this->attempts();\n\n if ($attempt < $this->tries) {\n $delay = 30 * (2 ** ($attempt - 1)); // Exponential backoff: 30s, 60s\n\n $logger->info(self::LOG_PREFIX . ' retry job, attempts: ' . $attempt, [\n 'delay' => $delay,\n ]);\n\n $this->release($delay);\n } else {\n $this->fail($e);\n }\n }\n }\n\n public function failed(Throwable $exception): void\n {\n AutomatedReportResult::whereRaw('uuid = uuid_to_bin(?)', [$this->reportUuid])\n ->update(['status' => AutomatedReportResult::STATUS_FAILED]);\n }\n\n /**\n * Get a unique ID for the job.\n *\n * @return string\n */\n public function uniqueId(): string\n {\n return $this->reportUuid;\n }\n}","depth":4,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\AutomatedReports;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Support\\Facades\\Storage;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\FileNotFoundException;\nuse Jiminny\\Exceptions\\RuntimeException;\nuse Jiminny\\Jobs\\JobDispatcherInterface;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass SendReportJob implements ShouldQueue, ShouldBeUnique\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Send Report]';\n\n /**\n * The number of times the job may be attempted.\n *\n * @var int\n */\n public int $tries = 2;\n\n /**\n * The maximum number of seconds the job should be allowed to run.\n *\n * @var int\n */\n public int $timeout = 120;\n\n /**\n * Create a new job instance.\n *\n * @param string $reportUuid The UUID of the report to send\n */\n public function __construct(private readonly string $reportUuid)\n {\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function handle(\n LoggerInterface $logger,\n JobDispatcherInterface $jobDispatcher,\n AutomatedReportsService $automatedReportsService\n ): void {\n try {\n $report = $automatedReportsService->getReportResult($this->reportUuid);\n } catch (Throwable $e) {\n $logger->error(self::LOG_PREFIX . ' Error getting report result', [\n 'uuid' => $this->reportUuid,\n 'exception' => $e->getMessage(),\n ]);\n\n throw $e;\n }\n\n $logger->info(self::LOG_PREFIX . ' Processing report', [\n 'uuid' => $this->reportUuid,\n 'status' => $report->getStatusLabel(),\n ]);\n\n $s3Path = $automatedReportsService->getMediaPath($report);\n\n if ($s3Path === null) {\n $logger->error(self::LOG_PREFIX . ' Report media path is null', [\n 'uuid' => $this->reportUuid,\n 'mediaType' => $report->getMediaType(),\n ]);\n\n throw new FileNotFoundException('Report media path could not be resolved');\n }\n\n // Verify the file exists in S3\n if (! Storage::disk('client-data-cloud')->exists($s3Path)) {\n $logger->error(self::LOG_PREFIX . ' Report file not found in S3', [\n 'uuid' => $this->reportUuid,\n 's3Path' => $s3Path,\n ]);\n\n throw new FileNotFoundException('Report file not found in S3');\n }\n\n try {\n $validRecipients = $automatedReportsService->getValidRecipientUsers(\n $report->getReport(),\n includeJiminny: true,\n );\n\n if (empty($validRecipients)) {\n $logger->error(self::LOG_PREFIX . ' No valid recipients found', [\n 'uuid' => $this->reportUuid,\n ]);\n\n throw new RuntimeException(\"No recipients found for report: {$this->reportUuid}\");\n }\n\n // Get report metadata (same for all recipients)\n $fileName = $automatedReportsService->getReportFileName($report);\n $typeName = $report->getReport()->getCustomName()\n ?? $automatedReportsService->getReportTypeName($report);\n $teamsName = $automatedReportsService->getReportTeamsName($report);\n $periodName = $automatedReportsService->getReportPeriodName($report);\n $isAskJiminny = $report->getReport()->isAskJiminnyReport();\n\n // Track how many jobs were dispatched\n $dispatchCount = 0;\n\n // Dispatch a job for each recipient\n foreach ($validRecipients as $recipient) {\n $jobDispatcher->dispatch(\n new SendReportMailJob(\n reportUuid: $this->reportUuid,\n s3Path: $s3Path,\n recipientEmail: $recipient['email'],\n recipientName: $recipient['name'] ?? null,\n fileName: $fileName,\n typeName: $typeName,\n teamsName: $teamsName,\n periodName: $periodName,\n isAskJiminny: $isAskJiminny,\n )\n );\n $dispatchCount++;\n\n $logger->info(self::LOG_PREFIX . ' Dispatched mail job', [\n 'uuid' => $this->reportUuid,\n 'email' => $recipient['email'],\n ]);\n }\n\n $logger->info(self::LOG_PREFIX . ' Successfully dispatched mail jobs', [\n 'uuid' => $this->reportUuid,\n 'count' => $dispatchCount,\n ]);\n } catch (Throwable $e) {\n $logger->error(self::LOG_PREFIX . ' Error processing report', [\n 'uuid' => $this->reportUuid,\n 'error' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n // Get current attempt (1-indexed)\n $attempt = $this->attempts();\n\n if ($attempt < $this->tries) {\n $delay = 30 * (2 ** ($attempt - 1)); // Exponential backoff: 30s, 60s\n\n $logger->info(self::LOG_PREFIX . ' retry job, attempts: ' . $attempt, [\n 'delay' => $delay,\n ]);\n\n $this->release($delay);\n } else {\n $this->fail($e);\n }\n }\n }\n\n public function failed(Throwable $exception): void\n {\n AutomatedReportResult::whereRaw('uuid = uuid_to_bin(?)', [$this->reportUuid])\n ->update(['status' => AutomatedReportResult::STATUS_FAILED]);\n }\n\n /**\n * Get a unique ID for the job.\n *\n * @return string\n */\n public function uniqueId(): string\n {\n return $this->reportUuid;\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Show Replace Field","depth":4,"bounds":{"left":0.38554686,"top":0.09166667,"width":0.01015625,"height":0.016666668},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Search History","depth":3,"bounds":{"left":0.40039062,"top":0.09097222,"width":0.00859375,"height":0.015277778},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"\"podcast_audio_url\"","depth":4,"bounds":{"left":0.41328126,"top":0.09097222,"width":0.12460937,"height":0.013888889},"value":"\"podcast_audio_url\"","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"New Line","depth":3,"bounds":{"left":0.5484375,"top":0.09097222,"width":0.00859375,"height":0.015277778},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Match Case","depth":3,"bounds":{"left":0.5601562,"top":0.09097222,"width":0.00859375,"height":0.015277778},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Words","depth":3,"bounds":{"left":0.5703125,"top":0.09097222,"width":0.00859375,"height":0.015277778},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Regex","depth":3,"bounds":{"left":0.5804688,"top":0.09097222,"width":0.00859375,"height":0.015277778},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Replace History","depth":3,"bounds":{"left":0.23320313,"top":1.0,"width":0.00859375,"height":0.0},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"Replace","depth":4,"role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"New Line","depth":3,"bounds":{"left":0.23320313,"top":1.0,"width":0.00859375,"height":0.0},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Preserve case","depth":3,"bounds":{"left":0.23320313,"top":1.0,"width":0.00859375,"height":0.0},"role_description":"checkbox","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1/54","depth":4,"bounds":{"left":0.59648436,"top":0.090277776,"width":0.030078124,"height":0.015277778},"role_description":"text"},{"role":"AXButton","text":"Previous Occurrence","depth":4,"bounds":{"left":0.6265625,"top":0.08958333,"width":0.01015625,"height":0.016666668},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Occurrence","depth":4,"bounds":{"left":0.63671875,"top":0.08958333,"width":0.01015625,"height":0.016666668},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Filter Search Results","depth":4,"bounds":{"left":0.646875,"top":0.08958333,"width":0.01015625,"height":0.016666668},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open in Window, Multiple Cursors","depth":4,"bounds":{"left":0.65703124,"top":0.08958333,"width":0.01015625,"height":0.016666668},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"Click to highlight","depth":4,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close","depth":4,"bounds":{"left":0.71132815,"top":0.08958333,"width":0.01015625,"height":0.016666668},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.049609374,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"[\n {\n \"id\": 136,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"debee4b3-1c28-4112-ad1b-f0dbe67c452c\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-09-29T01:09:25.039253+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.json\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.ssml\"}\n },\n {\n \"id\": 137,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"debee4b3-1c28-4112-ad1b-f0dbe67c452c\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-09-29T01:09:25.039253+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.json\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.ssml\"}\n },\n {\n \"id\": 149,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"81690efb-e296-4efe-ba74-51217e91bc7e\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-06T01:05:39.117068+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.json\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.ssml\"}\n },\n {\n \"id\": 150,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"81690efb-e296-4efe-ba74-51217e91bc7e\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-06T01:05:39.117068+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.json\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.ssml\"}\n },\n {\n \"id\": 166,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"43fc8095-52f0-420b-ade2-409b8ed8b7ee\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-13T01:08:35.779362+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.ssml\"}\n },\n {\n \"id\": 167,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"43fc8095-52f0-420b-ade2-409b8ed8b7ee\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-13T01:08:35.779362+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.ssml\"}\n },\n {\n \"id\": 214,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"985cab60-fae4-47e9-8779-0b653827b635\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-20T01:07:43.633450+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.ssml\"}\n },\n {\n \"id\": 215,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"985cab60-fae4-47e9-8779-0b653827b635\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-20T01:07:43.633450+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.ssml\"}\n },\n {\n \"id\": 297,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"cacce61e-fb58-47b6-97f5-b17b98d453d2\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-27T01:02:34.789377+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.ssml\"}\n },\n {\n \"id\": 298,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"cacce61e-fb58-47b6-97f5-b17b98d453d2\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-27T01:02:34.789377+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.ssml\"}\n },\n {\n \"id\": 365,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"a1971341-a81e-45bc-9d17-1ad914163010\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-03T01:03:31.381285+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.ssml\"}\n },\n {\n \"id\": 366,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"a1971341-a81e-45bc-9d17-1ad914163010\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-03T01:03:31.381285+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.ssml\"}\n },\n {\n \"id\": 410,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-10T01:05:31.021881+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.ssml\"}\n },\n {\n \"id\": 411,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-10T01:05:31.021881+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.ssml\"}\n },\n {\n \"id\": 485,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"18d3cc3d-95ac-434b-a21c-076318bd77aa\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-17T01:05:21.492550+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.ssml\"}\n },\n {\n \"id\": 486,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"18d3cc3d-95ac-434b-a21c-076318bd77aa\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-17T01:05:21.492550+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.ssml\"}\n },\n {\n \"id\": 592,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"d0f6fbb3-e86d-49bb-a863-8238aea5b401\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-24T01:06:05.698838+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.ssml\"}\n },\n {\n \"id\": 593,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"d0f6fbb3-e86d-49bb-a863-8238aea5b401\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-24T01:06:05.698838+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.ssml\"}\n },\n {\n \"id\": 636,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"264a5a2a-1e0d-49b5-aeba-268a19a74f85\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-01T01:11:00.769937+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.ssml\"}\n },\n {\n \"id\": 638,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"264a5a2a-1e0d-49b5-aeba-268a19a74f85\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-01T01:11:00.769937+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.ssml\"}\n },\n {\n \"id\": 704,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-08T01:06:28.080704+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.ssml\"}\n },\n {\n \"id\": 705,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-08T01:06:28.080704+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.ssml\"}\n },\n {\n \"id\": 762,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"de426138-2bce-43b9-9c6f-31079b2abc44\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-15T01:02:21.300804+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.ssml\"}\n },\n {\n \"id\": 763,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"de426138-2bce-43b9-9c6f-31079b2abc44\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-15T01:02:21.300804+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.ssml\"}\n },\n {\n \"id\": 801,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"3ca694c0-d6a5-4937-8d60-8d69f0bca04f\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-22T01:06:16.547481+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.ssml\"}\n },\n {\n \"id\": 802,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"3ca694c0-d6a5-4937-8d60-8d69f0bca04f\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-22T01:06:16.547481+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.ssml\"}\n },\n {\n \"id\": 830,\n \"media_type\": \"pdf\",\n \"response\": null\n },\n {\n \"id\": 831,\n \"media_type\": \"podcast\",\n \"response\": null\n },\n {\n \"id\": 915,\n \"media_type\": \"pdf\",\n \"response\": null\n },\n {\n \"id\": 916,\n \"media_type\": \"podcast\",\n \"response\": null\n },\n {\n \"id\": 936,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"64123b94-2da0-48d4-a712-bb35e9af586d\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-12T01:02:07.988029+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.ssml\"}\n },\n {\n \"id\": 937,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"64123b94-2da0-48d4-a712-bb35e9af586d\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-12T01:02:07.988029+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.ssml\"}\n },\n {\n \"id\": 993,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"d09beab4-afb6-47bc-b8bc-9a1c0c900b19\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-19T01:02:53.956691+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.ssml\"}\n },\n {\n \"id\": 995,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"d09beab4-afb6-47bc-b8bc-9a1c0c900b19\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-19T01:02:53.956691+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.ssml\"}\n },\n {\n \"id\": 1026,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"6c389d6a-7418-42ba-beb6-449dca36585f\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-26T01:02:56.634667+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.ssml\"}\n },\n {\n \"id\": 1027,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"6c389d6a-7418-42ba-beb6-449dca36585f\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-26T01:02:56.634667+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.ssml\"}\n },\n {\n \"id\": 1146,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"df566c11-80ff-42ef-9996-1e80909e7bc2\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-02T01:07:57.335690+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.ssml\"}\n },\n {\n \"id\": 1147,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"df566c11-80ff-42ef-9996-1e80909e7bc2\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-02T01:07:57.335690+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.ssml\"}\n },\n {\n \"id\": 1221,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"0d7a164c-ae0c-4411-8778-4b6ffc201dde\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-09T01:14:26.525625+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.ssml\"}\n },\n {\n \"id\": 1222,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"0d7a164c-ae0c-4411-8778-4b6ffc201dde\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-09T01:14:26.525625+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.ssml\"}\n },\n {\n \"id\": 1250,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"249776ec-1163-486a-a288-f3a99b1b1a00\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-16T01:05:49.814997+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.ssml\"}\n },\n {\n \"id\": 1251,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"249776ec-1163-486a-a288-f3a99b1b1a00\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-16T01:05:49.814997+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.ssml\"}\n },\n {\n \"id\": 1319,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"4f9599a9-9ca9-4b05-862a-4f4461a4a754\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-23T01:14:56.719622+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.ssml\"}\n },\n {\n \"id\": 1320,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"4f9599a9-9ca9-4b05-862a-4f4461a4a754\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-23T01:14:56.719622+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.ssml\"}\n },\n {\n \"id\": 1438,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"7c99607a-ca13-4d6c-8928-ed6a33073e68\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-02T01:21:57.924168+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.ssml\"}\n },\n {\n \"id\": 1439,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"7c99607a-ca13-4d6c-8928-ed6a33073e68\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-02T01:21:57.924168+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.ssml\"}\n },\n {\n \"id\": 1474,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"1c696c7b-88ef-43d0-ade4-8f006602f520\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-09T01:12:54.568944+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.ssml\"}\n },\n {\n \"id\": 1475,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"1c696c7b-88ef-43d0-ade4-8f006602f520\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-09T01:12:54.568944+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.ssml\"}\n },\n {\n \"id\": 1548,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"26ab917c-6907-416d-806d-679c3a49cfc1\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-16T01:15:23.832336+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.ssml\"}\n },\n {\n \"id\": 1549,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"26ab917c-6907-416d-806d-679c3a49cfc1\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-16T01:15:23.832336+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.ssml\"}\n },\n {\n \"id\": 1597,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"b096971f-2533-425e-ac37-f0b4798b5b32\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-23T01:14:51.290976+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.ssml\"}\n },\n {\n \"id\": 1598,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"b096971f-2533-425e-ac37-f0b4798b5b32\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-23T01:14:51.290976+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.ssml\"}\n },\n {\n \"id\": 1659,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"0ca73e35-7a57-4689-abf6-46ef280cd20f\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-30T01:24:50.835939+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.ssml\"}\n },\n {\n \"id\": 1660,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"0ca73e35-7a57-4689-abf6-46ef280cd20f\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-30T01:24:50.835939+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.ssml\"}\n },\n {\n \"id\": 1809,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"0f650641-7319-4ef8-b6aa-95ce56ce8ee2\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-04-06T01:03:35.051311+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.ssml\"}\n },\n {\n \"id\": 1810,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"0f650641-7319-4ef8-b6aa-95ce56ce8ee2\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-04-06T01:03:35.051311+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.ssml\"}\n },\n {\n \"id\": 1872,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"822fa41b-afd3-43a9-a248-86b0e36f3131\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-04-13T01:11:48.648399+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131.MD\",\n \"report_type\":\"coaching_profiles\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.ssml\"}\n },\n {\n \"id\": 1873,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"822fa41b-afd3-43a9-a248-86b0e36f3131\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-04-13T01:11:48.648399+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131.MD\",\n \"report_type\":\"coaching_profiles\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.ssml\"}\n }\n]","depth":4,"bounds":{"left":0.40625,"top":0.11388889,"width":0.471875,"height":0.88611114},"value":"[\n {\n \"id\": 136,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"debee4b3-1c28-4112-ad1b-f0dbe67c452c\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-09-29T01:09:25.039253+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.json\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.ssml\"}\n },\n {\n \"id\": 137,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"debee4b3-1c28-4112-ad1b-f0dbe67c452c\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-09-29T01:09:25.039253+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.json\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.ssml\"}\n },\n {\n \"id\": 149,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"81690efb-e296-4efe-ba74-51217e91bc7e\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-06T01:05:39.117068+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.json\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.ssml\"}\n },\n {\n \"id\": 150,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"81690efb-e296-4efe-ba74-51217e91bc7e\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-06T01:05:39.117068+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.json\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.ssml\"}\n },\n {\n \"id\": 166,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"43fc8095-52f0-420b-ade2-409b8ed8b7ee\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-13T01:08:35.779362+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.ssml\"}\n },\n {\n \"id\": 167,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"43fc8095-52f0-420b-ade2-409b8ed8b7ee\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-13T01:08:35.779362+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.ssml\"}\n },\n {\n \"id\": 214,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"985cab60-fae4-47e9-8779-0b653827b635\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-20T01:07:43.633450+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.ssml\"}\n },\n {\n \"id\": 215,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"985cab60-fae4-47e9-8779-0b653827b635\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-20T01:07:43.633450+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/985cab60-fae4-47e9-8779-0b653827b635_podcast.ssml\"}\n },\n {\n \"id\": 297,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"cacce61e-fb58-47b6-97f5-b17b98d453d2\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-27T01:02:34.789377+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.ssml\"}\n },\n {\n \"id\": 298,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"cacce61e-fb58-47b6-97f5-b17b98d453d2\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-10-27T01:02:34.789377+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.ssml\"}\n },\n {\n \"id\": 365,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"a1971341-a81e-45bc-9d17-1ad914163010\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-03T01:03:31.381285+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.ssml\"}\n },\n {\n \"id\": 366,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"a1971341-a81e-45bc-9d17-1ad914163010\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-03T01:03:31.381285+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.ssml\"}\n },\n {\n \"id\": 410,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-10T01:05:31.021881+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.ssml\"}\n },\n {\n \"id\": 411,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-10T01:05:31.021881+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.ssml\"}\n },\n {\n \"id\": 485,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"18d3cc3d-95ac-434b-a21c-076318bd77aa\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-17T01:05:21.492550+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.ssml\"}\n },\n {\n \"id\": 486,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"18d3cc3d-95ac-434b-a21c-076318bd77aa\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-17T01:05:21.492550+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.ssml\"}\n },\n {\n \"id\": 592,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"d0f6fbb3-e86d-49bb-a863-8238aea5b401\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-24T01:06:05.698838+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.ssml\"}\n },\n {\n \"id\": 593,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"d0f6fbb3-e86d-49bb-a863-8238aea5b401\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-11-24T01:06:05.698838+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.ssml\"}\n },\n {\n \"id\": 636,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"264a5a2a-1e0d-49b5-aeba-268a19a74f85\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-01T01:11:00.769937+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.ssml\"}\n },\n {\n \"id\": 638,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"264a5a2a-1e0d-49b5-aeba-268a19a74f85\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-01T01:11:00.769937+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.ssml\"}\n },\n {\n \"id\": 704,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-08T01:06:28.080704+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.ssml\"}\n },\n {\n \"id\": 705,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-08T01:06:28.080704+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.ssml\"}\n },\n {\n \"id\": 762,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"de426138-2bce-43b9-9c6f-31079b2abc44\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-15T01:02:21.300804+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.ssml\"}\n },\n {\n \"id\": 763,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"de426138-2bce-43b9-9c6f-31079b2abc44\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-15T01:02:21.300804+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.ssml\"}\n },\n {\n \"id\": 801,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"3ca694c0-d6a5-4937-8d60-8d69f0bca04f\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-22T01:06:16.547481+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.ssml\"}\n },\n {\n \"id\": 802,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"3ca694c0-d6a5-4937-8d60-8d69f0bca04f\",\n \"status\":\"completed\",\n \"timestamp\":\"2025-12-22T01:06:16.547481+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.ssml\"}\n },\n {\n \"id\": 830,\n \"media_type\": \"pdf\",\n \"response\": null\n },\n {\n \"id\": 831,\n \"media_type\": \"podcast\",\n \"response\": null\n },\n {\n \"id\": 915,\n \"media_type\": \"pdf\",\n \"response\": null\n },\n {\n \"id\": 916,\n \"media_type\": \"podcast\",\n \"response\": null\n },\n {\n \"id\": 936,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"64123b94-2da0-48d4-a712-bb35e9af586d\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-12T01:02:07.988029+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.ssml\"}\n },\n {\n \"id\": 937,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"64123b94-2da0-48d4-a712-bb35e9af586d\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-12T01:02:07.988029+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.ssml\"}\n },\n {\n \"id\": 993,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"d09beab4-afb6-47bc-b8bc-9a1c0c900b19\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-19T01:02:53.956691+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.ssml\"}\n },\n {\n \"id\": 995,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"d09beab4-afb6-47bc-b8bc-9a1c0c900b19\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-19T01:02:53.956691+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.ssml\"}\n },\n {\n \"id\": 1026,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"6c389d6a-7418-42ba-beb6-449dca36585f\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-26T01:02:56.634667+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.ssml\"}\n },\n {\n \"id\": 1027,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"6c389d6a-7418-42ba-beb6-449dca36585f\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-01-26T01:02:56.634667+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.ssml\"}\n },\n {\n \"id\": 1146,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"df566c11-80ff-42ef-9996-1e80909e7bc2\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-02T01:07:57.335690+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.ssml\"}\n },\n {\n \"id\": 1147,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"df566c11-80ff-42ef-9996-1e80909e7bc2\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-02T01:07:57.335690+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.ssml\"}\n },\n {\n \"id\": 1221,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"0d7a164c-ae0c-4411-8778-4b6ffc201dde\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-09T01:14:26.525625+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.ssml\"}\n },\n {\n \"id\": 1222,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"0d7a164c-ae0c-4411-8778-4b6ffc201dde\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-09T01:14:26.525625+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.ssml\"}\n },\n {\n \"id\": 1250,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"249776ec-1163-486a-a288-f3a99b1b1a00\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-16T01:05:49.814997+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.ssml\"}\n },\n {\n \"id\": 1251,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"249776ec-1163-486a-a288-f3a99b1b1a00\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-16T01:05:49.814997+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.ssml\"}\n },\n {\n \"id\": 1319,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"4f9599a9-9ca9-4b05-862a-4f4461a4a754\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-23T01:14:56.719622+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.ssml\"}\n },\n {\n \"id\": 1320,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"4f9599a9-9ca9-4b05-862a-4f4461a4a754\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-02-23T01:14:56.719622+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.ssml\"}\n },\n {\n \"id\": 1438,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"7c99607a-ca13-4d6c-8928-ed6a33073e68\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-02T01:21:57.924168+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.ssml\"}\n },\n {\n \"id\": 1439,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"7c99607a-ca13-4d6c-8928-ed6a33073e68\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-02T01:21:57.924168+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.ssml\"}\n },\n {\n \"id\": 1474,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"1c696c7b-88ef-43d0-ade4-8f006602f520\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-09T01:12:54.568944+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.ssml\"}\n },\n {\n \"id\": 1475,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"1c696c7b-88ef-43d0-ade4-8f006602f520\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-09T01:12:54.568944+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.ssml\"}\n },\n {\n \"id\": 1548,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"26ab917c-6907-416d-806d-679c3a49cfc1\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-16T01:15:23.832336+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.ssml\"}\n },\n {\n \"id\": 1549,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"26ab917c-6907-416d-806d-679c3a49cfc1\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-16T01:15:23.832336+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/26ab917c-6907-416d-806d-679c3a49cfc1_podcast.ssml\"}\n },\n {\n \"id\": 1597,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"b096971f-2533-425e-ac37-f0b4798b5b32\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-23T01:14:51.290976+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.ssml\"}\n },\n {\n \"id\": 1598,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"b096971f-2533-425e-ac37-f0b4798b5b32\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-23T01:14:51.290976+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/b096971f-2533-425e-ac37-f0b4798b5b32_podcast.ssml\"}\n },\n {\n \"id\": 1659,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"0ca73e35-7a57-4689-abf6-46ef280cd20f\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-30T01:24:50.835939+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.ssml\"}\n },\n {\n \"id\": 1660,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"0ca73e35-7a57-4689-abf6-46ef280cd20f\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-03-30T01:24:50.835939+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0ca73e35-7a57-4689-abf6-46ef280cd20f_podcast.ssml\"}\n },\n {\n \"id\": 1809,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"0f650641-7319-4ef8-b6aa-95ce56ce8ee2\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-04-06T01:03:35.051311+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.ssml\"}\n },\n {\n \"id\": 1810,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"0f650641-7319-4ef8-b6aa-95ce56ce8ee2\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-04-06T01:03:35.051311+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2.MD\",\n \"report_type\":\"coaching_profiles\",\n \"pdf_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2.pdf\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/0f650641-7319-4ef8-b6aa-95ce56ce8ee2_podcast.ssml\"}\n },\n {\n \"id\": 1872,\n \"media_type\": \"pdf\",\n \"response\": {\"request_id\":\"822fa41b-afd3-43a9-a248-86b0e36f3131\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-04-13T01:11:48.648399+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131.MD\",\n \"report_type\":\"coaching_profiles\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.ssml\"}\n },\n {\n \"id\": 1873,\n \"media_type\": \"podcast\",\n \"response\": {\"request_id\":\"822fa41b-afd3-43a9-a248-86b0e36f3131\",\n \"status\":\"completed\",\n \"timestamp\":\"2026-04-13T01:11:48.648399+00:00\",\n \"s3_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131.MD\",\n \"report_type\":\"coaching_profiles\",\n \"podcast_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.txt\",\n \"podcast_audio_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.mp3\",\n \"podcast_ssml_url\":\"s3:\\/\\/jiminny.client-data\\/5f0f4810-7e77-4086-8f69-93429ae4d70b\\/reports\\/822fa41b-afd3-43a9-a248-86b0e36f3131_podcast.ssml\"}\n }\n]","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.0140625,"top":0.041666668,"width":0.028515626,"height":0.021527778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.23320313,"top":1.0,"width":0.01015625,"height":0.0},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-8679634084126405105
|
-8930844700550655199
|
visual_change
|
accessibility
|
NULL
|
IDE error occurred
text/html
text/html
text/html
S IDE error occurred
text/html
text/html
text/html
See details and submit report
Project: faVsco.js, menu
#11894 on JY-18909-automated-reports-ask-jiminny, menu
Start Listening for PHP Debug Connections
AutomatedReportsCommandTest
Run 'AutomatedReportsCommandTest'
Debug 'AutomatedReportsCommandTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
4
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\AutomatedReports;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Storage;
use Jiminny\Component\Queue\Constants;
use Jiminny\Exceptions\FileNotFoundException;
use Jiminny\Exceptions\RuntimeException;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class SendReportJob implements ShouldQueue, ShouldBeUnique
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Send Report]';
/**
* The number of times the job may be attempted.
*
* @var int
*/
public int $tries = 2;
/**
* The maximum number of seconds the job should be allowed to run.
*
* @var int
*/
public int $timeout = 120;
/**
* Create a new job instance.
*
* @param string $reportUuid The UUID of the report to send
*/
public function __construct(private readonly string $reportUuid)
{
$this->onQueue(Constants::QUEUE_ANALYTICS_LOW);
}
public function handle(
LoggerInterface $logger,
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService
): void {
try {
$report = $automatedReportsService->getReportResult($this->reportUuid);
} catch (Throwable $e) {
$logger->error(self::LOG_PREFIX . ' Error getting report result', [
'uuid' => $this->reportUuid,
'exception' => $e->getMessage(),
]);
throw $e;
}
$logger->info(self::LOG_PREFIX . ' Processing report', [
'uuid' => $this->reportUuid,
'status' => $report->getStatusLabel(),
]);
$s3Path = $automatedReportsService->getMediaPath($report);
if ($s3Path === null) {
$logger->error(self::LOG_PREFIX . ' Report media path is null', [
'uuid' => $this->reportUuid,
'mediaType' => $report->getMediaType(),
]);
throw new FileNotFoundException('Report media path could not be resolved');
}
// Verify the file exists in S3
if (! Storage::disk('client-data-cloud')->exists($s3Path)) {
$logger->error(self::LOG_PREFIX . ' Report file not found in S3', [
'uuid' => $this->reportUuid,
's3Path' => $s3Path,
]);
throw new FileNotFoundException('Report file not found in S3');
}
try {
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
if (empty($validRecipients)) {
$logger->error(self::LOG_PREFIX . ' No valid recipients found', [
'uuid' => $this->reportUuid,
]);
throw new RuntimeException("No recipients found for report: {$this->reportUuid}");
}
// Get report metadata (same for all recipients)
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$isAskJiminny = $report->getReport()->isAskJiminnyReport();
// Track how many jobs were dispatched
$dispatchCount = 0;
// Dispatch a job for each recipient
foreach ($validRecipients as $recipient) {
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $this->reportUuid,
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: $isAskJiminny,
)
);
$dispatchCount++;
$logger->info(self::LOG_PREFIX . ' Dispatched mail job', [
'uuid' => $this->reportUuid,
'email' => $recipient['email'],
]);
}
$logger->info(self::LOG_PREFIX . ' Successfully dispatched mail jobs', [
'uuid' => $this->reportUuid,
'count' => $dispatchCount,
]);
} catch (Throwable $e) {
$logger->error(self::LOG_PREFIX . ' Error processing report', [
'uuid' => $this->reportUuid,
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
// Get current attempt (1-indexed)
$attempt = $this->attempts();
if ($attempt < $this->tries) {
$delay = 30 * (2 ** ($attempt - 1)); // Exponential backoff: 30s, 60s
$logger->info(self::LOG_PREFIX . ' retry job, attempts: ' . $attempt, [
'delay' => $delay,
]);
$this->release($delay);
} else {
$this->fail($e);
}
}
}
public function failed(Throwable $exception): void
{
AutomatedReportResult::whereRaw('uuid = uuid_to_bin(?)', [$this->reportUuid])
->update(['status' => AutomatedReportResult::STATUS_FAILED]);
}
/**
* Get a unique ID for the job.
*
* @return string
*/
public function uniqueId(): string
{
return $this->reportUuid;
}
}
Show Replace Field
Search History
"podcast_audio_url"
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
1/54
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Code changed:
Hide
Sync Changes
Hide This Notification
[
{
"id": 136,
"media_type": "pdf",
"response": {"request_id":"debee4b3-1c28-4112-ad1b-f0dbe67c452c",
"status":"completed",
"timestamp":"2025-09-29T01:09:25.039253+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.json",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.ssml"}
},
{
"id": 137,
"media_type": "podcast",
"response": {"request_id":"debee4b3-1c28-4112-ad1b-f0dbe67c452c",
"status":"completed",
"timestamp":"2025-09-29T01:09:25.039253+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.json",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/debee4b3-1c28-4112-ad1b-f0dbe67c452c_podcast.ssml"}
},
{
"id": 149,
"media_type": "pdf",
"response": {"request_id":"81690efb-e296-4efe-ba74-51217e91bc7e",
"status":"completed",
"timestamp":"2025-10-06T01:05:39.117068+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.json",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.ssml"}
},
{
"id": 150,
"media_type": "podcast",
"response": {"request_id":"81690efb-e296-4efe-ba74-51217e91bc7e",
"status":"completed",
"timestamp":"2025-10-06T01:05:39.117068+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.json",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/81690efb-e296-4efe-ba74-51217e91bc7e_podcast.ssml"}
},
{
"id": 166,
"media_type": "pdf",
"response": {"request_id":"43fc8095-52f0-420b-ade2-409b8ed8b7ee",
"status":"completed",
"timestamp":"2025-10-13T01:08:35.779362+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.ssml"}
},
{
"id": 167,
"media_type": "podcast",
"response": {"request_id":"43fc8095-52f0-420b-ade2-409b8ed8b7ee",
"status":"completed",
"timestamp":"2025-10-13T01:08:35.779362+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/43fc8095-52f0-420b-ade2-409b8ed8b7ee_podcast.ssml"}
},
{
"id": 214,
"media_type": "pdf",
"response": {"request_id":"985cab60-fae4-47e9-8779-0b653827b635",
"status":"completed",
"timestamp":"2025-10-20T01:07:43.633450+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.ssml"}
},
{
"id": 215,
"media_type": "podcast",
"response": {"request_id":"985cab60-fae4-47e9-8779-0b653827b635",
"status":"completed",
"timestamp":"2025-10-20T01:07:43.633450+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/985cab60-fae4-47e9-8779-0b653827b635_podcast.ssml"}
},
{
"id": 297,
"media_type": "pdf",
"response": {"request_id":"cacce61e-fb58-47b6-97f5-b17b98d453d2",
"status":"completed",
"timestamp":"2025-10-27T01:02:34.789377+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.ssml"}
},
{
"id": 298,
"media_type": "podcast",
"response": {"request_id":"cacce61e-fb58-47b6-97f5-b17b98d453d2",
"status":"completed",
"timestamp":"2025-10-27T01:02:34.789377+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/cacce61e-fb58-47b6-97f5-b17b98d453d2_podcast.ssml"}
},
{
"id": 365,
"media_type": "pdf",
"response": {"request_id":"a1971341-a81e-45bc-9d17-1ad914163010",
"status":"completed",
"timestamp":"2025-11-03T01:03:31.381285+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.ssml"}
},
{
"id": 366,
"media_type": "podcast",
"response": {"request_id":"a1971341-a81e-45bc-9d17-1ad914163010",
"status":"completed",
"timestamp":"2025-11-03T01:03:31.381285+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/a1971341-a81e-45bc-9d17-1ad914163010_podcast.ssml"}
},
{
"id": 410,
"media_type": "pdf",
"response": {"request_id":"7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30",
"status":"completed",
"timestamp":"2025-11-10T01:05:31.021881+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.ssml"}
},
{
"id": 411,
"media_type": "podcast",
"response": {"request_id":"7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30",
"status":"completed",
"timestamp":"2025-11-10T01:05:31.021881+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7554c504-3b8e-4bb9-9cc0-1b4bf3d2ce30_podcast.ssml"}
},
{
"id": 485,
"media_type": "pdf",
"response": {"request_id":"18d3cc3d-95ac-434b-a21c-076318bd77aa",
"status":"completed",
"timestamp":"2025-11-17T01:05:21.492550+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.ssml"}
},
{
"id": 486,
"media_type": "podcast",
"response": {"request_id":"18d3cc3d-95ac-434b-a21c-076318bd77aa",
"status":"completed",
"timestamp":"2025-11-17T01:05:21.492550+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/18d3cc3d-95ac-434b-a21c-076318bd77aa_podcast.ssml"}
},
{
"id": 592,
"media_type": "pdf",
"response": {"request_id":"d0f6fbb3-e86d-49bb-a863-8238aea5b401",
"status":"completed",
"timestamp":"2025-11-24T01:06:05.698838+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.ssml"}
},
{
"id": 593,
"media_type": "podcast",
"response": {"request_id":"d0f6fbb3-e86d-49bb-a863-8238aea5b401",
"status":"completed",
"timestamp":"2025-11-24T01:06:05.698838+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d0f6fbb3-e86d-49bb-a863-8238aea5b401_podcast.ssml"}
},
{
"id": 636,
"media_type": "pdf",
"response": {"request_id":"264a5a2a-1e0d-49b5-aeba-268a19a74f85",
"status":"completed",
"timestamp":"2025-12-01T01:11:00.769937+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.ssml"}
},
{
"id": 638,
"media_type": "podcast",
"response": {"request_id":"264a5a2a-1e0d-49b5-aeba-268a19a74f85",
"status":"completed",
"timestamp":"2025-12-01T01:11:00.769937+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/264a5a2a-1e0d-49b5-aeba-268a19a74f85_podcast.ssml"}
},
{
"id": 704,
"media_type": "pdf",
"response": {"request_id":"d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565",
"status":"completed",
"timestamp":"2025-12-08T01:06:28.080704+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.ssml"}
},
{
"id": 705,
"media_type": "podcast",
"response": {"request_id":"d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565",
"status":"completed",
"timestamp":"2025-12-08T01:06:28.080704+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d2cbe2d8-eee5-42d0-8bfc-c74ea50b0565_podcast.ssml"}
},
{
"id": 762,
"media_type": "pdf",
"response": {"request_id":"de426138-2bce-43b9-9c6f-31079b2abc44",
"status":"completed",
"timestamp":"2025-12-15T01:02:21.300804+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.ssml"}
},
{
"id": 763,
"media_type": "podcast",
"response": {"request_id":"de426138-2bce-43b9-9c6f-31079b2abc44",
"status":"completed",
"timestamp":"2025-12-15T01:02:21.300804+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/de426138-2bce-43b9-9c6f-31079b2abc44_podcast.ssml"}
},
{
"id": 801,
"media_type": "pdf",
"response": {"request_id":"3ca694c0-d6a5-4937-8d60-8d69f0bca04f",
"status":"completed",
"timestamp":"2025-12-22T01:06:16.547481+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.ssml"}
},
{
"id": 802,
"media_type": "podcast",
"response": {"request_id":"3ca694c0-d6a5-4937-8d60-8d69f0bca04f",
"status":"completed",
"timestamp":"2025-12-22T01:06:16.547481+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/3ca694c0-d6a5-4937-8d60-8d69f0bca04f_podcast.ssml"}
},
{
"id": 830,
"media_type": "pdf",
"response": null
},
{
"id": 831,
"media_type": "podcast",
"response": null
},
{
"id": 915,
"media_type": "pdf",
"response": null
},
{
"id": 916,
"media_type": "podcast",
"response": null
},
{
"id": 936,
"media_type": "pdf",
"response": {"request_id":"64123b94-2da0-48d4-a712-bb35e9af586d",
"status":"completed",
"timestamp":"2026-01-12T01:02:07.988029+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.ssml"}
},
{
"id": 937,
"media_type": "podcast",
"response": {"request_id":"64123b94-2da0-48d4-a712-bb35e9af586d",
"status":"completed",
"timestamp":"2026-01-12T01:02:07.988029+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/64123b94-2da0-48d4-a712-bb35e9af586d_podcast.ssml"}
},
{
"id": 993,
"media_type": "pdf",
"response": {"request_id":"d09beab4-afb6-47bc-b8bc-9a1c0c900b19",
"status":"completed",
"timestamp":"2026-01-19T01:02:53.956691+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.ssml"}
},
{
"id": 995,
"media_type": "podcast",
"response": {"request_id":"d09beab4-afb6-47bc-b8bc-9a1c0c900b19",
"status":"completed",
"timestamp":"2026-01-19T01:02:53.956691+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/d09beab4-afb6-47bc-b8bc-9a1c0c900b19_podcast.ssml"}
},
{
"id": 1026,
"media_type": "pdf",
"response": {"request_id":"6c389d6a-7418-42ba-beb6-449dca36585f",
"status":"completed",
"timestamp":"2026-01-26T01:02:56.634667+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.ssml"}
},
{
"id": 1027,
"media_type": "podcast",
"response": {"request_id":"6c389d6a-7418-42ba-beb6-449dca36585f",
"status":"completed",
"timestamp":"2026-01-26T01:02:56.634667+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/6c389d6a-7418-42ba-beb6-449dca36585f_podcast.ssml"}
},
{
"id": 1146,
"media_type": "pdf",
"response": {"request_id":"df566c11-80ff-42ef-9996-1e80909e7bc2",
"status":"completed",
"timestamp":"2026-02-02T01:07:57.335690+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.ssml"}
},
{
"id": 1147,
"media_type": "podcast",
"response": {"request_id":"df566c11-80ff-42ef-9996-1e80909e7bc2",
"status":"completed",
"timestamp":"2026-02-02T01:07:57.335690+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/df566c11-80ff-42ef-9996-1e80909e7bc2_podcast.ssml"}
},
{
"id": 1221,
"media_type": "pdf",
"response": {"request_id":"0d7a164c-ae0c-4411-8778-4b6ffc201dde",
"status":"completed",
"timestamp":"2026-02-09T01:14:26.525625+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.ssml"}
},
{
"id": 1222,
"media_type": "podcast",
"response": {"request_id":"0d7a164c-ae0c-4411-8778-4b6ffc201dde",
"status":"completed",
"timestamp":"2026-02-09T01:14:26.525625+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/0d7a164c-ae0c-4411-8778-4b6ffc201dde_podcast.ssml"}
},
{
"id": 1250,
"media_type": "pdf",
"response": {"request_id":"249776ec-1163-486a-a288-f3a99b1b1a00",
"status":"completed",
"timestamp":"2026-02-16T01:05:49.814997+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.ssml"}
},
{
"id": 1251,
"media_type": "podcast",
"response": {"request_id":"249776ec-1163-486a-a288-f3a99b1b1a00",
"status":"completed",
"timestamp":"2026-02-16T01:05:49.814997+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/249776ec-1163-486a-a288-f3a99b1b1a00_podcast.ssml"}
},
{
"id": 1319,
"media_type": "pdf",
"response": {"request_id":"4f9599a9-9ca9-4b05-862a-4f4461a4a754",
"status":"completed",
"timestamp":"2026-02-23T01:14:56.719622+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.ssml"}
},
{
"id": 1320,
"media_type": "podcast",
"response": {"request_id":"4f9599a9-9ca9-4b05-862a-4f4461a4a754",
"status":"completed",
"timestamp":"2026-02-23T01:14:56.719622+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/4f9599a9-9ca9-4b05-862a-4f4461a4a754_podcast.ssml"}
},
{
"id": 1438,
"media_type": "pdf",
"response": {"request_id":"7c99607a-ca13-4d6c-8928-ed6a33073e68",
"status":"completed",
"timestamp":"2026-03-02T01:21:57.924168+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.ssml"}
},
{
"id": 1439,
"media_type": "podcast",
"response": {"request_id":"7c99607a-ca13-4d6c-8928-ed6a33073e68",
"status":"completed",
"timestamp":"2026-03-02T01:21:57.924168+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/7c99607a-ca13-4d6c-8928-ed6a33073e68_podcast.ssml"}
},
{
"id": 1474,
"media_type": "pdf",
"response": {"request_id":"1c696c7b-88ef-43d0-ade4-8f006602f520",
"status":"completed",
"timestamp":"2026-03-09T01:12:54.568944+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.ssml"}
},
{
"id": 1475,
"media_type": "podcast",
"response": {"request_id":"1c696c7b-88ef-43d0-ade4-8f006602f520",
"status":"completed",
"timestamp":"2026-03-09T01:12:54.568944+00:00",
"s3_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520.MD",
"report_type":"coaching_profiles",
"pdf_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520.pdf",
"podcast_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.txt",
"podcast_audio_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.mp3",
"podcast_ssml_url":"s3:\/\/jiminny.client-data\/5f0f4810-7e77-4086-8f69-93429ae4d70b\/reports\/1c696c7b-88ef-43d0-ade4-8f006602f520_podcast.ssml"}
},
{
"id": 1548,
"media_type": "pdf",
"response": {"request_id":"26ab917c-6907-416d-806d-679c3a49cfc1",
"status":"completed",
"timestamp":"2026-03-16T01:15:23.832336+00:...
|
41926
|
|
63181
|
1365
|
20
|
2026-04-21T08:37:41.364288+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776760661364_m1.jpg...
|
Alfred
|
Alfred
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
ConvertLeadActivities
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"ConvertLeadActivities","depth":1,"bounds":{"left":0.26180556,"top":0.16777778,"width":0.4763889,"height":0.05888889},"value":"ConvertLeadActivities","help_text":"Alfred Search","role_description":"text field","is_enabled":true,"is_focused":true}]...
|
2796982750557957749
|
2796982750557957749
|
visual_change
|
hybrid
|
NULL
|
ConvertLeadActivities
SlackFileEditDOCKERO $1Sourc ConvertLeadActivities
SlackFileEditDOCKERO $1Source DB:NAS mount:Archive DB:Data dir:[+00m03s] • Counting sourceframes:elements:ul_events:ocr_text:meetings:[+00m03s] • Initialising tocreating tablescreating indexescreating FTS tabl[+00m04s] • Syncing data fovideo_chunksframes (9093 rowsocr_text (5971 rcui_events (9970 гelements (687142meetings (2 rows)[+03m01s] • Updating FTS irelements_ftsframes_ftsui_events_fts[+06m41s] • Verifying DBframes:elements:ui_events:ocr_text:meetings:[+07m44s] *Copying data forsync 2026-04-20/2026-04-2110:48:54][2026-04-2110:48:54][2026-04-2110:48:54][2026-04-2110:48:54]ArchiTotalSync=====lukas@Lukas-Kovaliks-MacBodViewGoHistoryWindowHelp-zshOKО $82(4.5G)-zsh• *3JiminnyProfileAll ItemsFavoritesR Watchtower‹› DeveloperVAULTSEmployeeEngineeringIntegration AccountsJiminnyV TAGS• 2FACSV Import 28.01.22LastPass Import 1.11.21C4Antae Vit‹ >0 • $ Support Daily - in 3h 23 mActivity MonitorAll ProcessesProcess NameMem...* Build full da..screenpQ Search in JiminnyConvertLeadActivitiesGSearch Google for 'ConvertLeadActivities'Search Amazon for 'ConvertLeadActivities'Search Wikipedia for 'ConvertLeadActivities'Helpnare282883password[PASSWORD_DOTS]websitehttps://app-eu3.planhat.com> Last edited Wednesday, July 5, 2023 at 3:29:20 PM100% <8Tue 21 Apr 11:37:41CPUMemoryEnergyDiskNetworkThreadsPortsPID+ New Item22696EditGood эrу:Userlukaslukaslukas_windowserverlukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukas4,49 GB2,97 GB6,15 GB...
|
NULL
|
|
55198
|
1191
|
0
|
2026-04-20T09:38:11.882671+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-20/1776 /Users/lukas/.screenpipe/data/data/2026-04-20/1776677891882_m1.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?","depth":1,"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3372760612192152234
|
2265671929232941772
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
NULL
|
|
67857
|
1528
|
16
|
2026-04-21T16:10:43.208462+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776787843208_m1.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?","depth":1,"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3372760612192152234
|
2265671929232941772
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
NULL
|
|
70011
|
1628
|
10
|
2026-04-22T09:32:07.273565+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-22/1776 /Users/lukas/.screenpipe/data/data/2026-04-22/1776850327273_m1.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?","depth":1,"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1253068462831592111
|
6490049067572438732
|
idle
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
70009
|
|
70013
|
1628
|
11
|
2026-04-22T09:32:38.157107+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-22/1776 /Users/lukas/.screenpipe/data/data/2026-04-22/1776850358157_m1.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?","depth":1,"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1253068462831592111
|
6490049067572438732
|
idle
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
NULL
|
|
70052
|
1630
|
18
|
2026-04-22T09:38:00.630060+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-22/1776 /Users/lukas/.screenpipe/data/data/2026-04-22/1776850680630_m1.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?","depth":1,"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1253068462831592111
|
6490049067572438732
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
70050
|
|
53478
|
1156
|
25
|
2026-04-20T08:14:23.968980+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-20/1776 /Users/lukas/.screenpipe/data/data/2026-04-20/1776672863968_m1.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?","depth":1,"help_text":"text/html","role_description":"text"}]...
|
5710727982699704906
|
9012223542781775567
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?...
|
53475
|
|
76232
|
1907
|
36
|
2026-04-24T07:37:47.621354+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-24/1777 /Users/lukas/.screenpipe/data/data/2026-04-24/1777016267621_m1.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?","depth":1,"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6302192583667349220
|
6427139904066727628
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
76230
|
|
77293
|
1941
|
17
|
2026-04-24T09:03:34.957563+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-24/1777 /Users/lukas/.screenpipe/data/data/2026-04-24/1777021414957_m1.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?","depth":1,"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6302192583667349220
|
6427139904066727628
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
77291
|
|
55199
|
1192
|
0
|
2026-04-20T09:38:11.944584+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-20/1776 /Users/lukas/.screenpipe/data/data/2026-04-20/1776677891944_m2.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.14926861,"height":0.014365523},"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.032247342,"height":0.014365523},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?","depth":1,"bounds":{"left":0.35006648,"top":0.3048683,"width":0.14926861,"height":0.06783719},"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"bounds":{"left":0.35006648,"top":0.38786912,"width":0.028590426,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"bounds":{"left":0.38264626,"top":0.38786912,"width":0.051529255,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"bounds":{"left":0.4381649,"top":0.38786912,"width":0.061170213,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3372760612192152234
|
2265671929232941772
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
55197
|
|
67856
|
1529
|
18
|
2026-04-21T16:10:43.145828+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-21/1776 /Users/lukas/.screenpipe/data/data/2026-04-21/1776787843145_m2.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.14926861,"height":0.014365523},"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.032247342,"height":0.014365523},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?","depth":1,"bounds":{"left":0.35006648,"top":0.3048683,"width":0.14926861,"height":0.06783719},"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"bounds":{"left":0.35006648,"top":0.38786912,"width":0.028590426,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"bounds":{"left":0.38264626,"top":0.38786912,"width":0.051529255,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"bounds":{"left":0.4381649,"top":0.38786912,"width":0.061170213,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3372760612192152234
|
2265671929232941772
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php contains problems.<br/>No errors and 10 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
67855
|
|
70012
|
1629
|
11
|
2026-04-22T09:32:08.155957+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-22/1776 /Users/lukas/.screenpipe/data/data/2026-04-22/1776850328155_m2.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.14926861,"height":0.014365523},"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.032247342,"height":0.014365523},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?","depth":1,"bounds":{"left":0.35006648,"top":0.3048683,"width":0.14926861,"height":0.040702313},"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"bounds":{"left":0.35006648,"top":0.36073422,"width":0.028590426,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"bounds":{"left":0.38264626,"top":0.36073422,"width":0.051529255,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"bounds":{"left":0.4381649,"top":0.36073422,"width":0.061170213,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1253068462831592111
|
6490049067572438732
|
idle
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
NULL
|
|
70014
|
1629
|
12
|
2026-04-22T09:32:38.781913+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-22/1776 /Users/lukas/.screenpipe/data/data/2026-04-22/1776850358781_m2.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.14926861,"height":0.014365523},"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.032247342,"height":0.014365523},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?","depth":1,"bounds":{"left":0.35006648,"top":0.3048683,"width":0.14926861,"height":0.040702313},"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"bounds":{"left":0.35006648,"top":0.36073422,"width":0.028590426,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"bounds":{"left":0.38264626,"top":0.36073422,"width":0.051529255,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"bounds":{"left":0.4381649,"top":0.36073422,"width":0.061170213,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1253068462831592111
|
6490049067572438732
|
idle
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
70012
|
|
70051
|
1631
|
11
|
2026-04-22T09:37:59.129822+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-22/1776 /Users/lukas/.screenpipe/data/data/2026-04-22/1776850679129_m2.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.14926861,"height":0.014365523},"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.032247342,"height":0.014365523},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?","depth":1,"bounds":{"left":0.35006648,"top":0.3048683,"width":0.14926861,"height":0.040702313},"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"bounds":{"left":0.35006648,"top":0.36073422,"width":0.028590426,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"bounds":{"left":0.38264626,"top":0.36073422,"width":0.051529255,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"bounds":{"left":0.4381649,"top":0.36073422,"width":0.061170213,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1253068462831592111
|
6490049067572438732
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/routes/api.php contains problems.<br/>No errors and 2 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
70049
|
|
76233
|
1908
|
39
|
2026-04-24T07:37:47.682790+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-24/1777 /Users/lukas/.screenpipe/data/data/2026-04-24/1777016267682_m2.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.14926861,"height":0.014365523},"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.032247342,"height":0.014365523},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?","depth":1,"bounds":{"left":0.35006648,"top":0.3048683,"width":0.14926861,"height":0.06783719},"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"bounds":{"left":0.35006648,"top":0.38786912,"width":0.028590426,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"bounds":{"left":0.38264626,"top":0.38786912,"width":0.051529255,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"bounds":{"left":0.4381649,"top":0.38786912,"width":0.061170213,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6302192583667349220
|
6427139904066727628
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
File ~ Code Analysis
text/html
text/html
text/html
File ~/jiminny/app/app/Listeners/AutomatedReports/UserPilot/TrackAutomatedReportGeneratedEvent.php contains problems.<br/>No errors and one warning found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
76231
|
|
76307
|
1910
|
23
|
2026-04-24T07:40:39.882359+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-24/1777 /Users/lukas/.screenpipe/data/data/2026-04-24/1777016439882_m2.jpg...
|
PhpStorm
|
Code Analysis
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Code Analysis
text/html
text/html
text/html
2 file Code Analysis
text/html
text/html
text/html
2 files contain problems.<br/>No errors and 7 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Code Analysis","depth":1,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.14926861,"height":0.014365523},"value":"Code Analysis","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"bounds":{"left":0.35006648,"top":0.28411812,"width":0.032247342,"height":0.014365523},"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":2,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2 files contain problems.<br/>No errors and 7 warnings found.<br/>Would you like to review them?","depth":1,"bounds":{"left":0.35006648,"top":0.3048683,"width":0.14926861,"height":0.040702313},"help_text":"text/html","role_description":"text"},{"role":"AXButton","text":"Cancel","depth":1,"bounds":{"left":0.35006648,"top":0.36073422,"width":0.028590426,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Commit and Push","depth":1,"bounds":{"left":0.38264626,"top":0.36073422,"width":0.051529255,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Review Code Analysis","depth":1,"bounds":{"left":0.4381649,"top":0.36073422,"width":0.061170213,"height":0.027134877},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
7807308298545525816
|
1528347816094130892
|
click
|
accessibility
|
NULL
|
Code Analysis
text/html
text/html
text/html
2 file Code Analysis
text/html
text/html
text/html
2 files contain problems.<br/>No errors and 7 warnings found.<br/>Would you like to review them?
Cancel
Commit and Push
Review Code Analysis...
|
76306
|
|
49284
|
1048
|
12
|
2026-04-17T13:33:44.308972+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-17/1776 /Users/lukas/.screenpipe/data/data/2026-04-17/1776432824308_m1.jpg...
|
PhpStorm
|
faVsco.js – ImportActivityTypes.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Checked out master
text/html
text/html
text/html
t Checked out master
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Checked out master","depth":3,"value":"Checked out master","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"help_text":"Git Branch: master<br/>6 incoming commits<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"RequestGenerateAskJiminnyReportJobTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1016068800424066034
|
-4863440325463257208
|
click
|
hybrid
|
NULL
|
Checked out master
text/html
text/html
text/html
t Checked out master
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
Activity MonitorFileEditViewWindowHelpDOCKER• ₴1DEV (docker)APP (-zsh)X3AF-zshX4Changes notstagedfor commit:(use"git add ‹file>..to update what will becommitted)(use"git restore<files..." to discard changesin working directory)modified:./.env.localmodified:../app/Console/Commands/JiminnyDebugCommand.phpmodified:../app/Http/Controllers/API/ActivityController.phpmodified:../app/Http/Controllers/Webhook/ReportController.phpmodified::./app/Jobs/Team/SyncToIntercom.phpmodified:/app/Services/PlaybackService.phpmodified::/config/logging.phpmodified:../routes/web.phpUntracked files:Cuse "git addsfile>..."to include in what will be committed)'.env.nikilocal/.env.other../WEBHOOK_FILTERING_IMPLEMENTATION.md../app/Console/Commands/Crm/Hubspot/SimulateWebhooksCommand.php../app/Console/Commands/Reports/CreateMockAskJiminnyReportResultCommand.php./ids.txt../raw_sql_query.sql../tests/Unit/Policies/CanAccessAiReportsTest.phpno changes addedto commit (use "git add"and/or "git commit -a")lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app/front-end (JY-18909-automated-reremote: Enumerating objects: 170,done.remote: Counting objects: 100% (147/147), done.remote: Compressing objects: 100% (35/35), done.remote:Total 170 (delta 116), reused 121 (delta 111), pack-reused 23 (from 1)Receiving objects: 100% (170/170), 55.28 KiB | 1.42 MiB/s,done.Resolving deltas: 100% (119/119), completed with 47 local objects.From github.com:jiminny/app82671d4c13..d4352c6e59JY-20291-datadog-processing-states20e95bbbc9..360f12adddJY-20541-cleanup-stale-tasks-and-events+ 9f8d154791...01c43d2aa6 JY-20553-debug-crm-sync-delays* [new branch]JY-20695-handle-no-raw-transcriptbe76d8ba82..9b30c928c4JY-9712-change-forever-nudges-to-1-year-expiration5bb8fefcba..c04e334173master→> origir->origir-> origir-> origir->origir-> origirUpdating aba9685c0d..08ed383c5berror: Your local changes to the following files would be overwritten by merge:app/Http/Controllers/Webhook/ReportController.phpPlease commit your changes or stash them before you merge.Abortingukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app/front-end (JY-18909-automated-re> 0(allActivity MonitorAll ProcessesProcess NamePhpStormVirtual Machine Service for DockerFirefoxCP Isolated Web ContentFirefoxCP Isolated Web ContentFirefoxCP Isolated Web Contentlanguage_server_macos_armFirefoxSlack Helper (Renderer)FirefoxWindowServerjavaFirefox GPU HelperFirefoxCP Isolated Web ContentFirefoxCP Isolated Web ContentFirefoxCP Isolated Web ContentFirefoxCP Isolated Web ContentNotion Helper (Renderer)Claude Helper (Renderer)Notion Calendar Helper (Renderer)FirefoxCP Isolated Web ContentPostman Helper (Renderer)cef_server Helper (Renderer)Firefox GPU HelperFirefoxCP Isolated Web ContentFirefoxCP Isolated Web ContentFirefoxCP Isolated Web ContentFirefoxCP Isolated Web Contentfull-line-inferenceMEMORY PRESSURE• Tech Day Review - in 27 mMem..4,98 GB4,01 GB1,75 GB1,19 GB980,6 MB891,2 MB890,4 MB856,6 MB771,7 MB755,6 MB685,3 MB655,3 MB648,7 MB610,7 MB608,1 MB510,5 MB483,7 MB470,7 MB464,8 MB443,4 MB436,7 MB430,3 MB406,1 MB390,9 MB367,5 MB281,6 MB273,5 MB269,8 MBPhysical Memory:Memory Used:Cached Files:Swap Used:100%8Fri 17 Apr 16:33:43CPUMemoryEnergyDiskNetworkThreadsPorts3372028253019901674205726252548232015152326163128242244191 39982131125130821 2872107214 12020828812312416912023821416511931317522413011911616274PID47782634486388475292753064959146771312621104034949746778210879252711397775111265235456261213770987496672117751083088720563168763517416,00 GB14,17 GB1,80 GB9,66 GBApp Memory:Wired Memory:Compressed:Userlukaslukaslukaslukaslukaslukaslukaslukaslukas_windowserverlukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukaslukas3,39 GB2,67 GB7,55 GB...
|
49276
|
|
49276
|
1048
|
8
|
2026-04-17T13:31:53.327712+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-17/1776 /Users/lukas/.screenpipe/data/data/2026-04-17/1776432713327_m1.jpg...
|
PhpStorm
|
faVsco.js – ImportActivityTypes.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Checked out master
text/html
text/html
text/html
t Checked out master
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Listeners\Crm;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Str;
use Jiminny\Events\Playbooks\PlaybookCreated;
use Jiminny\Models\Crm\Field;
use Jiminny\Models\Crm\FieldValue;
use Jiminny\Models\PlaybookCategory;
use Jiminny\Repositories\Crm\FieldRepository;
use Jiminny\Repositories\PlaybookCategoryRepository;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Log;
use Jiminny\Services\ResolveTeamCrmConnection;
use stdClass;
use Throwable;
class ImportActivityTypes implements ShouldQueue
{
/**
* Create the event listener.
*/
public function __construct(
private readonly ResolveTeamCrmConnection $crmResolver,
private readonly FieldRepository $fieldRepository,
private readonly PlaybookCategoryRepository $repository,
) {
// nothing
}
/**
* Import the standard Event/Task Type picklist options from the CRM.
*/
public function handle(PlaybookCreated $event): void
{
$playbook = $event->playbook;
// Don't run if somehow we already have categories.
if ($playbook->getCategories()->isNotEmpty()) {
return;
}
$values = [];
try {
$crmService = $this->crmResolver->resolveForTeam($playbook->getTeam());
$crmService->syncField($playbook->getActivityField());
$values = $crmService->importPicklistValues($playbook->getActivityField());
} catch (Throwable $e) {
Log::warning('[ImportActivityTypes] CRM API failed, falling back to database values', [
'playbook_id' => $playbook->getId(),
'team_id' => $playbook->getTeamId(),
'error' => $e->getMessage(),
]);
}
if (empty($values)) {
$values = $this->fetchActivityFieldValues($playbook->getActivityField());
Log::info('[ImportActivityTypes] Using database fallback for categories', [
'playbook_id' => $playbook->getId(),
'field_values_count' => $values->count(),
]);
}
$createdCount = 0;
/** @var stdClass{label: string} $value */
foreach ($values as $value) {
$data = [
'name' => $value->label,
'enabled' => true,
'type' => PlaybookCategory::TYPE_ALL,
];
if (Str::contains(strtolower($value->label), ['sms sent', 'sms out', 'text in'])) {
$data['type'] = PlaybookCategory::TYPE_SMS_OUTBOUND;
}
if (Str::contains(strtolower($value->label), ['sms received', 'sms in', 'text out'])) {
$data['type'] = PlaybookCategory::TYPE_SMS_INBOUND;
}
$this->repository->create($playbook, $data);
$createdCount++;
}
if ($createdCount === 0) {
Log::warning('[ImportActivityTypes] No categories created for playbook', [
'playbook_id' => $playbook->getId(),
'team_id' => $playbook->getTeamId(),
'field_id' => $playbook->getActivityField()?->getId(),
]);
}
}
private function fetchActivityFieldValues(Field $field): Collection
{
/** @var Collection<FieldValue> */
return $this->fieldRepository->getPicklistValues($field);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a.actual_end_time DESC;
SELECT * FROM tracks WHERE activity_id = 26485995;
select a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 202
# and a.is_internal = 0
and (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type IN ("softphone","softphone-inbound","conference","sms-inbound")
and a.status IN ('completed', 'failed')
# and a.external_id is not null
order by a.actual_end_time desc;
select * from activities a where a.crm_configuration_id = 202
and a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'
# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM teams WHERE name LIKE '%Tourlane%';
SELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_field_data WHERE crm_field_id = 98809;
select * from users where status = 1 AND timezone = 'MDT';
select * from opportunities where id = 3769814;
select * from deal_risks where opportunity_id = 3769814;
select cp.* from crm_profiles cp
join users u on cp.user_id = u.id
join crm_configurations crm on cp.crm_configuration_id = crm.id
where crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';
select * from crm_fields where id = 154575;
select * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';
SELECT * FROM teams WHERE id = 176; # crm 148
select * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;
select * from activity_providers where provider = 'amazon-connect';
select * from crm_fields cf
join crm_configurations crm on crm.id = cf.crm_configuration_id
where crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');
# [PASSWORD_DOTS]
SELECT * FROM users WHERE id IN (15415, 15418);
SELECT * FROM groups WHERE id IN (1805,1806);
SELECT * FROM playbooks WHERE id = 1860;
SELECT * FROM playbook_categories WHERE id = 38634;
SELECT * FROM crm_fields WHERE id = 189962;
SELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 [EMAIL]
SELECT * FROM crm_profiles WHERE user_id = 15415;
SELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';
select * from sidekick_settings where team_id = 472;
SELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418
SELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, [EMAIL]
select * from crm_configurations where id = 218;
SELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765
SELECT * FROM users WHERE id IN (13232, 13230);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
0057R00000EPL5HQAX Inez Ekblad
1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur
SELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);
############################################################################################
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id IN (94491,94493,94498);
SELECT * FROM users WHERE id = 13658;
SELECT * FROM teams WHERE id = 109;
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, [EMAIL]
SELECT * FROM stages WHERE crm_configuration_id = 390;
select * from business_processes where team_id = 481 and crm_configuration_id = 390;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 481
and sa.provider = 'salesforce';
SELECT * FROM users WHERE id = 15780; # team 462
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 462
and sa.provider = 'hubspot';
select * from teams where id = 495;
SELECT * FROM users WHERE id = 15794;
select * from social_accounts where sociable_id = 15794;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752
SELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794
SELECT * FROM activities WHERE crm_configuration_id = 407
and status = 'completed' and type = 'conference'
order by id desc;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from permission_role;
select * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;
SELECT * FROM activities WHERE id = 29512773;
SELECT * FROM activities WHERE id IN (29042721,28991325,29002874);
SELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 407
# and a.id IN (29042721,28991325,29002874);
SELECT * FROM users WHERE id = 15794;
SELECT * FROM users WHERE team_id = 495;
SELECT * FROM social_accounts WHERE sociable_id = 15794;
SELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';
SELECT * FROM contacts WHERE team_id = 495;
SELECT * FROM leads WHERE team_id = 495;
SELECT * FROM accounts WHERE team_id = 495;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 407;
SELECT * FROM crm_fields WHERE crm_configuration_id = 407;
SELECT * FROM crm_configurations WHERE id = 407;
SELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'
and user_id IS NOT NULL and is_closed = 1 and is_won = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103
SELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064
SELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 325
and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085
SELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733
SELECT * FROM activity_summary_logs where activity_id = 28719733;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444
SELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';
SELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630
select * from activities where crm_configuration_id = 356 and lead_id = 841732;
SELECT * from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 356;
select * from activities where crm_configuration_id = 356
and actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'
order by id desc;
select * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;
select * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from team_features where team_id = 260;
select * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;
select * from crm_fields;
select * from crm_layout_entities;
SELECT * FROM teams WHERE name LIKE '%Optable%';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id in (94491,94493,94498);
select * from teams where crm_id IS NULL;
SELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;
# [PASSWORD_DOTS]
select * from team_domains where team_id = 399;
SELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207
select * from calendar_events where id = 5163781;
SELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896
SELECT * FROM participants WHERE activity_id = 29443896;
select * from contacts where crm_configuration_id = 318 and email = '[EMAIL]';
select * from leads where crm_configuration_id = 318 and email = '[EMAIL]';
select * from activities where user_id = 14937 order by created_at ;
select * from users where id = 14937;
select * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';
select * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';
select * from activities a join participants p on a.id = p.activity_id
where crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';
# [PASSWORD_DOTS]
SELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';
SELECT * FROM opportunities WHERE team_id = 379 order by id desc;
SELECT * FROM teams WHERE id = 379;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379 and sociable_id = 13852
and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE id = 307;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 307;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;
SELECT * FROM crm_fields WHERE crm_configuration_id = 307
and id IN (144750,144855,145158,155227);
SELECT * FROM activities;
select * from activities
where created_at > '2025-07-01 00:00:00'
# and created_at < '2025-08-01 00:00:00'
and type not in ('email-outbound', 'email-inbound')
and account_id is null
and contact_id is null
and lead_id is null
and opportunity_id is not null
;
SELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);
SELECT * FROM crm_configurations WHERE id in (335,301,200);
select * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';
SELECT * FROM teams WHERE name LIKE '%Resights%';
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_configurations where provider = 'bullhorn'; # 344
select * from teams where id IN (442);
select * from activities
where crm_configuration_id = 177
and provider = 'amazon-connect'
order by id desc;
# and source <> 'gong';
select * from activity_providers where provider = 'amazon-connect';
SELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;
select * from crm_configurations where store_transcript = 1;
SELECT * FROM teams WHERE id IN (80);
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 1259...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Checked out master","depth":3,"value":"Checked out master","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"help_text":"Git Branch: master<br/>6 incoming commits<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"RequestGenerateAskJiminnyReportJobTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\nnamespace Jiminny\\Listeners\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Str;\nuse Jiminny\\Events\\Playbooks\\PlaybookCreated;\nuse Jiminny\\Models\\Crm\\Field;\nuse Jiminny\\Models\\Crm\\FieldValue;\nuse Jiminny\\Models\\PlaybookCategory;\nuse Jiminny\\Repositories\\Crm\\FieldRepository;\nuse Jiminny\\Repositories\\PlaybookCategoryRepository;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Services\\ResolveTeamCrmConnection;\nuse stdClass;\nuse Throwable;\n\nclass ImportActivityTypes implements ShouldQueue\n{\n /**\n * Create the event listener.\n */\n public function __construct(\n private readonly ResolveTeamCrmConnection $crmResolver,\n private readonly FieldRepository $fieldRepository,\n private readonly PlaybookCategoryRepository $repository,\n ) {\n // nothing\n }\n\n /**\n * Import the standard Event/Task Type picklist options from the CRM.\n */\n public function handle(PlaybookCreated $event): void\n {\n $playbook = $event->playbook;\n\n // Don't run if somehow we already have categories.\n if ($playbook->getCategories()->isNotEmpty()) {\n return;\n }\n\n $values = [];\n\n try {\n $crmService = $this->crmResolver->resolveForTeam($playbook->getTeam());\n $crmService->syncField($playbook->getActivityField());\n $values = $crmService->importPicklistValues($playbook->getActivityField());\n } catch (Throwable $e) {\n Log::warning('[ImportActivityTypes] CRM API failed, falling back to database values', [\n 'playbook_id' => $playbook->getId(),\n 'team_id' => $playbook->getTeamId(),\n 'error' => $e->getMessage(),\n ]);\n }\n\n if (empty($values)) {\n $values = $this->fetchActivityFieldValues($playbook->getActivityField());\n\n Log::info('[ImportActivityTypes] Using database fallback for categories', [\n 'playbook_id' => $playbook->getId(),\n 'field_values_count' => $values->count(),\n ]);\n }\n\n $createdCount = 0;\n\n /** @var stdClass{label: string} $value */\n foreach ($values as $value) {\n $data = [\n 'name' => $value->label,\n 'enabled' => true,\n 'type' => PlaybookCategory::TYPE_ALL,\n ];\n\n if (Str::contains(strtolower($value->label), ['sms sent', 'sms out', 'text in'])) {\n $data['type'] = PlaybookCategory::TYPE_SMS_OUTBOUND;\n }\n\n if (Str::contains(strtolower($value->label), ['sms received', 'sms in', 'text out'])) {\n $data['type'] = PlaybookCategory::TYPE_SMS_INBOUND;\n }\n\n $this->repository->create($playbook, $data);\n $createdCount++;\n }\n\n if ($createdCount === 0) {\n Log::warning('[ImportActivityTypes] No categories created for playbook', [\n 'playbook_id' => $playbook->getId(),\n 'team_id' => $playbook->getTeamId(),\n 'field_id' => $playbook->getActivityField()?->getId(),\n ]);\n }\n }\n\n private function fetchActivityFieldValues(Field $field): Collection\n {\n /** @var Collection<FieldValue> */\n return $this->fieldRepository->getPicklistValues($field);\n }\n}","depth":4,"value":"<?php\n\nnamespace Jiminny\\Listeners\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Str;\nuse Jiminny\\Events\\Playbooks\\PlaybookCreated;\nuse Jiminny\\Models\\Crm\\Field;\nuse Jiminny\\Models\\Crm\\FieldValue;\nuse Jiminny\\Models\\PlaybookCategory;\nuse Jiminny\\Repositories\\Crm\\FieldRepository;\nuse Jiminny\\Repositories\\PlaybookCategoryRepository;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Services\\ResolveTeamCrmConnection;\nuse stdClass;\nuse Throwable;\n\nclass ImportActivityTypes implements ShouldQueue\n{\n /**\n * Create the event listener.\n */\n public function __construct(\n private readonly ResolveTeamCrmConnection $crmResolver,\n private readonly FieldRepository $fieldRepository,\n private readonly PlaybookCategoryRepository $repository,\n ) {\n // nothing\n }\n\n /**\n * Import the standard Event/Task Type picklist options from the CRM.\n */\n public function handle(PlaybookCreated $event): void\n {\n $playbook = $event->playbook;\n\n // Don't run if somehow we already have categories.\n if ($playbook->getCategories()->isNotEmpty()) {\n return;\n }\n\n $values = [];\n\n try {\n $crmService = $this->crmResolver->resolveForTeam($playbook->getTeam());\n $crmService->syncField($playbook->getActivityField());\n $values = $crmService->importPicklistValues($playbook->getActivityField());\n } catch (Throwable $e) {\n Log::warning('[ImportActivityTypes] CRM API failed, falling back to database values', [\n 'playbook_id' => $playbook->getId(),\n 'team_id' => $playbook->getTeamId(),\n 'error' => $e->getMessage(),\n ]);\n }\n\n if (empty($values)) {\n $values = $this->fetchActivityFieldValues($playbook->getActivityField());\n\n Log::info('[ImportActivityTypes] Using database fallback for categories', [\n 'playbook_id' => $playbook->getId(),\n 'field_values_count' => $values->count(),\n ]);\n }\n\n $createdCount = 0;\n\n /** @var stdClass{label: string} $value */\n foreach ($values as $value) {\n $data = [\n 'name' => $value->label,\n 'enabled' => true,\n 'type' => PlaybookCategory::TYPE_ALL,\n ];\n\n if (Str::contains(strtolower($value->label), ['sms sent', 'sms out', 'text in'])) {\n $data['type'] = PlaybookCategory::TYPE_SMS_OUTBOUND;\n }\n\n if (Str::contains(strtolower($value->label), ['sms received', 'sms in', 'text out'])) {\n $data['type'] = PlaybookCategory::TYPE_SMS_INBOUND;\n }\n\n $this->repository->create($playbook, $data);\n $createdCount++;\n }\n\n if ($createdCount === 0) {\n Log::warning('[ImportActivityTypes] No categories created for playbook', [\n 'playbook_id' => $playbook->getId(),\n 'team_id' => $playbook->getTeamId(),\n 'field_id' => $playbook->getActivityField()?->getId(),\n ]);\n }\n }\n\n private function fetchActivityFieldValues(Field $field): Collection\n {\n /** @var Collection<FieldValue> */\n return $this->fieldRepository->getPicklistValues($field);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"27","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"23","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"105","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","depth":4,"value":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
347457365026322995
|
2146738311620114029
|
idle
|
accessibility
|
NULL
|
Checked out master
text/html
text/html
text/html
t Checked out master
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Listeners\Crm;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Str;
use Jiminny\Events\Playbooks\PlaybookCreated;
use Jiminny\Models\Crm\Field;
use Jiminny\Models\Crm\FieldValue;
use Jiminny\Models\PlaybookCategory;
use Jiminny\Repositories\Crm\FieldRepository;
use Jiminny\Repositories\PlaybookCategoryRepository;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Log;
use Jiminny\Services\ResolveTeamCrmConnection;
use stdClass;
use Throwable;
class ImportActivityTypes implements ShouldQueue
{
/**
* Create the event listener.
*/
public function __construct(
private readonly ResolveTeamCrmConnection $crmResolver,
private readonly FieldRepository $fieldRepository,
private readonly PlaybookCategoryRepository $repository,
) {
// nothing
}
/**
* Import the standard Event/Task Type picklist options from the CRM.
*/
public function handle(PlaybookCreated $event): void
{
$playbook = $event->playbook;
// Don't run if somehow we already have categories.
if ($playbook->getCategories()->isNotEmpty()) {
return;
}
$values = [];
try {
$crmService = $this->crmResolver->resolveForTeam($playbook->getTeam());
$crmService->syncField($playbook->getActivityField());
$values = $crmService->importPicklistValues($playbook->getActivityField());
} catch (Throwable $e) {
Log::warning('[ImportActivityTypes] CRM API failed, falling back to database values', [
'playbook_id' => $playbook->getId(),
'team_id' => $playbook->getTeamId(),
'error' => $e->getMessage(),
]);
}
if (empty($values)) {
$values = $this->fetchActivityFieldValues($playbook->getActivityField());
Log::info('[ImportActivityTypes] Using database fallback for categories', [
'playbook_id' => $playbook->getId(),
'field_values_count' => $values->count(),
]);
}
$createdCount = 0;
/** @var stdClass{label: string} $value */
foreach ($values as $value) {
$data = [
'name' => $value->label,
'enabled' => true,
'type' => PlaybookCategory::TYPE_ALL,
];
if (Str::contains(strtolower($value->label), ['sms sent', 'sms out', 'text in'])) {
$data['type'] = PlaybookCategory::TYPE_SMS_OUTBOUND;
}
if (Str::contains(strtolower($value->label), ['sms received', 'sms in', 'text out'])) {
$data['type'] = PlaybookCategory::TYPE_SMS_INBOUND;
}
$this->repository->create($playbook, $data);
$createdCount++;
}
if ($createdCount === 0) {
Log::warning('[ImportActivityTypes] No categories created for playbook', [
'playbook_id' => $playbook->getId(),
'team_id' => $playbook->getTeamId(),
'field_id' => $playbook->getActivityField()?->getId(),
]);
}
}
private function fetchActivityFieldValues(Field $field): Collection
{
/** @var Collection<FieldValue> */
return $this->fieldRepository->getPicklistValues($field);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a.actual_end_time DESC;
SELECT * FROM tracks WHERE activity_id = 26485995;
select a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 202
# and a.is_internal = 0
and (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type IN ("softphone","softphone-inbound","conference","sms-inbound")
and a.status IN ('completed', 'failed')
# and a.external_id is not null
order by a.actual_end_time desc;
select * from activities a where a.crm_configuration_id = 202
and a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'
# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM teams WHERE name LIKE '%Tourlane%';
SELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_field_data WHERE crm_field_id = 98809;
select * from users where status = 1 AND timezone = 'MDT';
select * from opportunities where id = 3769814;
select * from deal_risks where opportunity_id = 3769814;
select cp.* from crm_profiles cp
join users u on cp.user_id = u.id
join crm_configurations crm on cp.crm_configuration_id = crm.id
where crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';
select * from crm_fields where id = 154575;
select * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';
SELECT * FROM teams WHERE id = 176; # crm 148
select * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;
select * from activity_providers where provider = 'amazon-connect';
select * from crm_fields cf
join crm_configurations crm on crm.id = cf.crm_configuration_id
where crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');
# [PASSWORD_DOTS]
SELECT * FROM users WHERE id IN (15415, 15418);
SELECT * FROM groups WHERE id IN (1805,1806);
SELECT * FROM playbooks WHERE id = 1860;
SELECT * FROM playbook_categories WHERE id = 38634;
SELECT * FROM crm_fields WHERE id = 189962;
SELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 [EMAIL]
SELECT * FROM crm_profiles WHERE user_id = 15415;
SELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';
select * from sidekick_settings where team_id = 472;
SELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418
SELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, [EMAIL]
select * from crm_configurations where id = 218;
SELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765
SELECT * FROM users WHERE id IN (13232, 13230);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
0057R00000EPL5HQAX Inez Ekblad
1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur
SELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);
############################################################################################
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id IN (94491,94493,94498);
SELECT * FROM users WHERE id = 13658;
SELECT * FROM teams WHERE id = 109;
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, [EMAIL]
SELECT * FROM stages WHERE crm_configuration_id = 390;
select * from business_processes where team_id = 481 and crm_configuration_id = 390;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 481
and sa.provider = 'salesforce';
SELECT * FROM users WHERE id = 15780; # team 462
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 462
and sa.provider = 'hubspot';
select * from teams where id = 495;
SELECT * FROM users WHERE id = 15794;
select * from social_accounts where sociable_id = 15794;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752
SELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794
SELECT * FROM activities WHERE crm_configuration_id = 407
and status = 'completed' and type = 'conference'
order by id desc;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from permission_role;
select * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;
SELECT * FROM activities WHERE id = 29512773;
SELECT * FROM activities WHERE id IN (29042721,28991325,29002874);
SELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 407
# and a.id IN (29042721,28991325,29002874);
SELECT * FROM users WHERE id = 15794;
SELECT * FROM users WHERE team_id = 495;
SELECT * FROM social_accounts WHERE sociable_id = 15794;
SELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';
SELECT * FROM contacts WHERE team_id = 495;
SELECT * FROM leads WHERE team_id = 495;
SELECT * FROM accounts WHERE team_id = 495;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 407;
SELECT * FROM crm_fields WHERE crm_configuration_id = 407;
SELECT * FROM crm_configurations WHERE id = 407;
SELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'
and user_id IS NOT NULL and is_closed = 1 and is_won = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103
SELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064
SELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 325
and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085
SELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733
SELECT * FROM activity_summary_logs where activity_id = 28719733;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444
SELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';
SELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630
select * from activities where crm_configuration_id = 356 and lead_id = 841732;
SELECT * from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 356;
select * from activities where crm_configuration_id = 356
and actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'
order by id desc;
select * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;
select * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from team_features where team_id = 260;
select * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;
select * from crm_fields;
select * from crm_layout_entities;
SELECT * FROM teams WHERE name LIKE '%Optable%';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id in (94491,94493,94498);
select * from teams where crm_id IS NULL;
SELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;
# [PASSWORD_DOTS]
select * from team_domains where team_id = 399;
SELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207
select * from calendar_events where id = 5163781;
SELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896
SELECT * FROM participants WHERE activity_id = 29443896;
select * from contacts where crm_configuration_id = 318 and email = '[EMAIL]';
select * from leads where crm_configuration_id = 318 and email = '[EMAIL]';
select * from activities where user_id = 14937 order by created_at ;
select * from users where id = 14937;
select * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';
select * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';
select * from activities a join participants p on a.id = p.activity_id
where crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';
# [PASSWORD_DOTS]
SELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';
SELECT * FROM opportunities WHERE team_id = 379 order by id desc;
SELECT * FROM teams WHERE id = 379;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379 and sociable_id = 13852
and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE id = 307;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 307;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;
SELECT * FROM crm_fields WHERE crm_configuration_id = 307
and id IN (144750,144855,145158,155227);
SELECT * FROM activities;
select * from activities
where created_at > '2025-07-01 00:00:00'
# and created_at < '2025-08-01 00:00:00'
and type not in ('email-outbound', 'email-inbound')
and account_id is null
and contact_id is null
and lead_id is null
and opportunity_id is not null
;
SELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);
SELECT * FROM crm_configurations WHERE id in (335,301,200);
select * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';
SELECT * FROM teams WHERE name LIKE '%Resights%';
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_configurations where provider = 'bullhorn'; # 344
select * from teams where id IN (442);
select * from activities
where crm_configuration_id = 177
and provider = 'amazon-connect'
order by id desc;
# and source <> 'gong';
select * from activity_providers where provider = 'amazon-connect';
SELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;
select * from crm_configurations where store_transcript = 1;
SELECT * FROM teams WHERE id IN (80);
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 1259...
|
NULL
|
|
49279
|
1048
|
9
|
2026-04-17T13:32:23.603840+00:00
|
/Users/lukas/.screenpipe/data/data/2026-04-17/1776 /Users/lukas/.screenpipe/data/data/2026-04-17/1776432743603_m1.jpg...
|
PhpStorm
|
faVsco.js – ImportActivityTypes.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Checked out master
text/html
text/html
text/html
t Checked out master
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Listeners\Crm;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Str;
use Jiminny\Events\Playbooks\PlaybookCreated;
use Jiminny\Models\Crm\Field;
use Jiminny\Models\Crm\FieldValue;
use Jiminny\Models\PlaybookCategory;
use Jiminny\Repositories\Crm\FieldRepository;
use Jiminny\Repositories\PlaybookCategoryRepository;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Log;
use Jiminny\Services\ResolveTeamCrmConnection;
use stdClass;
use Throwable;
class ImportActivityTypes implements ShouldQueue
{
/**
* Create the event listener.
*/
public function __construct(
private readonly ResolveTeamCrmConnection $crmResolver,
private readonly FieldRepository $fieldRepository,
private readonly PlaybookCategoryRepository $repository,
) {
// nothing
}
/**
* Import the standard Event/Task Type picklist options from the CRM.
*/
public function handle(PlaybookCreated $event): void
{
$playbook = $event->playbook;
// Don't run if somehow we already have categories.
if ($playbook->getCategories()->isNotEmpty()) {
return;
}
$values = [];
try {
$crmService = $this->crmResolver->resolveForTeam($playbook->getTeam());
$crmService->syncField($playbook->getActivityField());
$values = $crmService->importPicklistValues($playbook->getActivityField());
} catch (Throwable $e) {
Log::warning('[ImportActivityTypes] CRM API failed, falling back to database values', [
'playbook_id' => $playbook->getId(),
'team_id' => $playbook->getTeamId(),
'error' => $e->getMessage(),
]);
}
if (empty($values)) {
$values = $this->fetchActivityFieldValues($playbook->getActivityField());
Log::info('[ImportActivityTypes] Using database fallback for categories', [
'playbook_id' => $playbook->getId(),
'field_values_count' => $values->count(),
]);
}
$createdCount = 0;
/** @var stdClass{label: string} $value */
foreach ($values as $value) {
$data = [
'name' => $value->label,
'enabled' => true,
'type' => PlaybookCategory::TYPE_ALL,
];
if (Str::contains(strtolower($value->label), ['sms sent', 'sms out', 'text in'])) {
$data['type'] = PlaybookCategory::TYPE_SMS_OUTBOUND;
}
if (Str::contains(strtolower($value->label), ['sms received', 'sms in', 'text out'])) {
$data['type'] = PlaybookCategory::TYPE_SMS_INBOUND;
}
$this->repository->create($playbook, $data);
$createdCount++;
}
if ($createdCount === 0) {
Log::warning('[ImportActivityTypes] No categories created for playbook', [
'playbook_id' => $playbook->getId(),
'team_id' => $playbook->getTeamId(),
'field_id' => $playbook->getActivityField()?->getId(),
]);
}
}
private function fetchActivityFieldValues(Field $field): Collection
{
/** @var Collection<FieldValue> */
return $this->fieldRepository->getPicklistValues($field);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a.actual_end_time DESC;
SELECT * FROM tracks WHERE activity_id = 26485995;
select a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 202
# and a.is_internal = 0
and (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type IN ("softphone","softphone-inbound","conference","sms-inbound")
and a.status IN ('completed', 'failed')
# and a.external_id is not null
order by a.actual_end_time desc;
select * from activities a where a.crm_configuration_id = 202
and a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'
# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM teams WHERE name LIKE '%Tourlane%';
SELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_field_data WHERE crm_field_id = 98809;
select * from users where status = 1 AND timezone = 'MDT';
select * from opportunities where id = 3769814;
select * from deal_risks where opportunity_id = 3769814;
select cp.* from crm_profiles cp
join users u on cp.user_id = u.id
join crm_configurations crm on cp.crm_configuration_id = crm.id
where crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';
select * from crm_fields where id = 154575;
select * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';
SELECT * FROM teams WHERE id = 176; # crm 148
select * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;
select * from activity_providers where provider = 'amazon-connect';
select * from crm_fields cf
join crm_configurations crm on crm.id = cf.crm_configuration_id
where crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');
# [PASSWORD_DOTS]
SELECT * FROM users WHERE id IN (15415, 15418);
SELECT * FROM groups WHERE id IN (1805,1806);
SELECT * FROM playbooks WHERE id = 1860;
SELECT * FROM playbook_categories WHERE id = 38634;
SELECT * FROM crm_fields WHERE id = 189962;
SELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 [EMAIL]
SELECT * FROM crm_profiles WHERE user_id = 15415;
SELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';
select * from sidekick_settings where team_id = 472;
SELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418
SELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, [EMAIL]
select * from crm_configurations where id = 218;
SELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765
SELECT * FROM users WHERE id IN (13232, 13230);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
0057R00000EPL5HQAX Inez Ekblad
1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur
SELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);
############################################################################################
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id IN (94491,94493,94498);
SELECT * FROM users WHERE id = 13658;
SELECT * FROM teams WHERE id = 109;
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, [EMAIL]
SELECT * FROM stages WHERE crm_configuration_id = 390;
select * from business_processes where team_id = 481 and crm_configuration_id = 390;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 481
and sa.provider = 'salesforce';
SELECT * FROM users WHERE id = 15780; # team 462
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 462
and sa.provider = 'hubspot';
select * from teams where id = 495;
SELECT * FROM users WHERE id = 15794;
select * from social_accounts where sociable_id = 15794;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752
SELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794
SELECT * FROM activities WHERE crm_configuration_id = 407
and status = 'completed' and type = 'conference'
order by id desc;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from permission_role;
select * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;
SELECT * FROM activities WHERE id = 29512773;
SELECT * FROM activities WHERE id IN (29042721,28991325,29002874);
SELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 407
# and a.id IN (29042721,28991325,29002874);
SELECT * FROM users WHERE id = 15794;
SELECT * FROM users WHERE team_id = 495;
SELECT * FROM social_accounts WHERE sociable_id = 15794;
SELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';
SELECT * FROM contacts WHERE team_id = 495;
SELECT * FROM leads WHERE team_id = 495;
SELECT * FROM accounts WHERE team_id = 495;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 407;
SELECT * FROM crm_fields WHERE crm_configuration_id = 407;
SELECT * FROM crm_configurations WHERE id = 407;
SELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'
and user_id IS NOT NULL and is_closed = 1 and is_won = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103
SELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064
SELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 325
and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085
SELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733
SELECT * FROM activity_summary_logs where activity_id = 28719733;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444
SELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';
SELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630
select * from activities where crm_configuration_id = 356 and lead_id = 841732;
SELECT * from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 356;
select * from activities where crm_configuration_id = 356
and actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'
order by id desc;
select * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;
select * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from team_features where team_id = 260;
select * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;
select * from crm_fields;
select * from crm_layout_entities;
SELECT * FROM teams WHERE name LIKE '%Optable%';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id in (94491,94493,94498);
select * from teams where crm_id IS NULL;
SELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;
# [PASSWORD_DOTS]
select * from team_domains where team_id = 399;
SELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207
select * from calendar_events where id = 5163781;
SELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896
SELECT * FROM participants WHERE activity_id = 29443896;
select * from contacts where crm_configuration_id = 318 and email = '[EMAIL]';
select * from leads where crm_configuration_id = 318 and email = '[EMAIL]';
select * from activities where user_id = 14937 order by created_at ;
select * from users where id = 14937;
select * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';
select * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';
select * from activities a join participants p on a.id = p.activity_id
where crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';
# [PASSWORD_DOTS]
SELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';
SELECT * FROM opportunities WHERE team_id = 379 order by id desc;
SELECT * FROM teams WHERE id = 379;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379 and sociable_id = 13852
and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE id = 307;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 307;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;
SELECT * FROM crm_fields WHERE crm_configuration_id = 307
and id IN (144750,144855,145158,155227);
SELECT * FROM activities;
select * from activities
where created_at > '2025-07-01 00:00:00'
# and created_at < '2025-08-01 00:00:00'
and type not in ('email-outbound', 'email-inbound')
and account_id is null
and contact_id is null
and lead_id is null
and opportunity_id is not null
;
SELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);
SELECT * FROM crm_configurations WHERE id in (335,301,200);
select * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';
SELECT * FROM teams WHERE name LIKE '%Resights%';
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_configurations where provider = 'bullhorn'; # 344
select * from teams where id IN (442);
select * from activities
where crm_configuration_id = 177
and provider = 'amazon-connect'
order by id desc;
# and source <> 'gong';
select * from activity_providers where provider = 'amazon-connect';
SELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;
select * from crm_configurations where store_transcript = 1;
SELECT * FROM teams WHERE id IN (80);
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 1259...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"Checked out master","depth":3,"value":"Checked out master","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"help_text":"Git Branch: master<br/>6 incoming commits<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"RequestGenerateAskJiminnyReportJobTest","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'RequestGenerateAskJiminnyReportJobTest'","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\nnamespace Jiminny\\Listeners\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Str;\nuse Jiminny\\Events\\Playbooks\\PlaybookCreated;\nuse Jiminny\\Models\\Crm\\Field;\nuse Jiminny\\Models\\Crm\\FieldValue;\nuse Jiminny\\Models\\PlaybookCategory;\nuse Jiminny\\Repositories\\Crm\\FieldRepository;\nuse Jiminny\\Repositories\\PlaybookCategoryRepository;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Services\\ResolveTeamCrmConnection;\nuse stdClass;\nuse Throwable;\n\nclass ImportActivityTypes implements ShouldQueue\n{\n /**\n * Create the event listener.\n */\n public function __construct(\n private readonly ResolveTeamCrmConnection $crmResolver,\n private readonly FieldRepository $fieldRepository,\n private readonly PlaybookCategoryRepository $repository,\n ) {\n // nothing\n }\n\n /**\n * Import the standard Event/Task Type picklist options from the CRM.\n */\n public function handle(PlaybookCreated $event): void\n {\n $playbook = $event->playbook;\n\n // Don't run if somehow we already have categories.\n if ($playbook->getCategories()->isNotEmpty()) {\n return;\n }\n\n $values = [];\n\n try {\n $crmService = $this->crmResolver->resolveForTeam($playbook->getTeam());\n $crmService->syncField($playbook->getActivityField());\n $values = $crmService->importPicklistValues($playbook->getActivityField());\n } catch (Throwable $e) {\n Log::warning('[ImportActivityTypes] CRM API failed, falling back to database values', [\n 'playbook_id' => $playbook->getId(),\n 'team_id' => $playbook->getTeamId(),\n 'error' => $e->getMessage(),\n ]);\n }\n\n if (empty($values)) {\n $values = $this->fetchActivityFieldValues($playbook->getActivityField());\n\n Log::info('[ImportActivityTypes] Using database fallback for categories', [\n 'playbook_id' => $playbook->getId(),\n 'field_values_count' => $values->count(),\n ]);\n }\n\n $createdCount = 0;\n\n /** @var stdClass{label: string} $value */\n foreach ($values as $value) {\n $data = [\n 'name' => $value->label,\n 'enabled' => true,\n 'type' => PlaybookCategory::TYPE_ALL,\n ];\n\n if (Str::contains(strtolower($value->label), ['sms sent', 'sms out', 'text in'])) {\n $data['type'] = PlaybookCategory::TYPE_SMS_OUTBOUND;\n }\n\n if (Str::contains(strtolower($value->label), ['sms received', 'sms in', 'text out'])) {\n $data['type'] = PlaybookCategory::TYPE_SMS_INBOUND;\n }\n\n $this->repository->create($playbook, $data);\n $createdCount++;\n }\n\n if ($createdCount === 0) {\n Log::warning('[ImportActivityTypes] No categories created for playbook', [\n 'playbook_id' => $playbook->getId(),\n 'team_id' => $playbook->getTeamId(),\n 'field_id' => $playbook->getActivityField()?->getId(),\n ]);\n }\n }\n\n private function fetchActivityFieldValues(Field $field): Collection\n {\n /** @var Collection<FieldValue> */\n return $this->fieldRepository->getPicklistValues($field);\n }\n}","depth":4,"value":"<?php\n\nnamespace Jiminny\\Listeners\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Support\\Str;\nuse Jiminny\\Events\\Playbooks\\PlaybookCreated;\nuse Jiminny\\Models\\Crm\\Field;\nuse Jiminny\\Models\\Crm\\FieldValue;\nuse Jiminny\\Models\\PlaybookCategory;\nuse Jiminny\\Repositories\\Crm\\FieldRepository;\nuse Jiminny\\Repositories\\PlaybookCategoryRepository;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Services\\ResolveTeamCrmConnection;\nuse stdClass;\nuse Throwable;\n\nclass ImportActivityTypes implements ShouldQueue\n{\n /**\n * Create the event listener.\n */\n public function __construct(\n private readonly ResolveTeamCrmConnection $crmResolver,\n private readonly FieldRepository $fieldRepository,\n private readonly PlaybookCategoryRepository $repository,\n ) {\n // nothing\n }\n\n /**\n * Import the standard Event/Task Type picklist options from the CRM.\n */\n public function handle(PlaybookCreated $event): void\n {\n $playbook = $event->playbook;\n\n // Don't run if somehow we already have categories.\n if ($playbook->getCategories()->isNotEmpty()) {\n return;\n }\n\n $values = [];\n\n try {\n $crmService = $this->crmResolver->resolveForTeam($playbook->getTeam());\n $crmService->syncField($playbook->getActivityField());\n $values = $crmService->importPicklistValues($playbook->getActivityField());\n } catch (Throwable $e) {\n Log::warning('[ImportActivityTypes] CRM API failed, falling back to database values', [\n 'playbook_id' => $playbook->getId(),\n 'team_id' => $playbook->getTeamId(),\n 'error' => $e->getMessage(),\n ]);\n }\n\n if (empty($values)) {\n $values = $this->fetchActivityFieldValues($playbook->getActivityField());\n\n Log::info('[ImportActivityTypes] Using database fallback for categories', [\n 'playbook_id' => $playbook->getId(),\n 'field_values_count' => $values->count(),\n ]);\n }\n\n $createdCount = 0;\n\n /** @var stdClass{label: string} $value */\n foreach ($values as $value) {\n $data = [\n 'name' => $value->label,\n 'enabled' => true,\n 'type' => PlaybookCategory::TYPE_ALL,\n ];\n\n if (Str::contains(strtolower($value->label), ['sms sent', 'sms out', 'text in'])) {\n $data['type'] = PlaybookCategory::TYPE_SMS_OUTBOUND;\n }\n\n if (Str::contains(strtolower($value->label), ['sms received', 'sms in', 'text out'])) {\n $data['type'] = PlaybookCategory::TYPE_SMS_INBOUND;\n }\n\n $this->repository->create($playbook, $data);\n $createdCount++;\n }\n\n if ($createdCount === 0) {\n Log::warning('[ImportActivityTypes] No categories created for playbook', [\n 'playbook_id' => $playbook->getId(),\n 'team_id' => $playbook->getTeamId(),\n 'field_id' => $playbook->getActivityField()?->getId(),\n ]);\n }\n }\n\n private function fetchActivityFieldValues(Field $field): Collection\n {\n /** @var Collection<FieldValue> */\n return $this->fieldRepository->getPicklistValues($field);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"27","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"9","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"23","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"role_description":"text"},{"role":"AXStaticText","text":"105","depth":4,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","depth":4,"value":"SELECT * FROM team_features where team_id = 1;\n\nSELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922\nSELECT * FROM users WHERE team_id = 340; # 12015\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 340\nand sa.provider = 'salesforce';\n# and sa.provider = 'salesloft';\n\nselect * from crm_fields where crm_configuration_id = 270 and object_type = 'event';\n# 125558 - Event Type - Event_Type__c\n# 125552 - Event Status - Event_Status__c\n\nSELECT * FROM sidekick_settings WHERE team_id = 340;\n\nSELECT * FROM crm_field_values WHERE crm_field_id in (125552);\n\nselect * from activities where crm_configuration_id = 270\nand type = 'conference' and crm_provider_id IS NOT NULL\nand actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;\n\nSELECT * FROM activities WHERE id = 20871677;\nSELECT * FROM crm_field_data WHERE activity_id = 20871677;\n\nselect * from crm_layouts where crm_configuration_id = 270;\nselect * from crm_layout_entities where crm_layout_id in (886,887);\n\nSELECT * FROM crm_configurations WHERE id = 270;\n\nselect * from playbooks where team_id = 340; # 1514\nselect * from groups where team_id = 340;\nSELECT * FROM crm_fields WHERE id IN (125393, 125401);\n\nselect g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g\njoin playbooks p on g.playbook_id = p.id\njoin crm_fields f on p.activity_field_id = f.id\nwhere g.team_id = 340;\n\nSELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716\nselect * from crm_field_data where object_id = 20448716;\n\nselect * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008\nselect * from opportunities where team_id = 343;\nselect * from opportunities where team_id = 343 and crm_provider_id = '18099102526';\nselect * from opportunities where team_id = 343 and account_id = 945217482;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from accounts where team_id = 343 order by name asc;\n\nselect * from stages where crm_configuration_id = 273 and type = 'opportunity';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143\nSELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;\nSELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';\nSELECT * FROM activities WHERE id = 20717903;\n\nselect * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 353\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, l.atkinson@mwbsolutions.co.uk\nSELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;\n# id: 20940638, user: 12022, contact: 5305871\nSELECT * FROM activity_summary_logs WHERE activity_id = 20940638;\nselect * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 345\nand sa.provider = 'hubspot';\n\nselect * from users where team_id = 345 and id = 12022;\nSELECT * FROM crm_profiles WHERE user_id = 12022;\nSELECT * FROM participants WHERE activity_id = 20940638;\nSELECT * FROM users u\nJOIN crm_profiles cp ON u.id = cp.user_id\nWHERE u.team_id = 345;\n\nselect * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871\n\nselect * from team_features where team_id = 345;\nSELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197\nSELECT * FROM participants WHERE activity_id = 20897406;\n\n\n\nSELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912\nSELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';\n\n\nSELECT * FROM activities WHERE id = 20946641;\nSELECT * FROM crm_profiles WHERE user_id = 10211;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, triger@lunio.ai\nSELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';\nselect * from stages where crm_configuration_id = 97 and type = 'opportunity';\nselect * from opportunities where team_id = 120;\n\n\nselect * from crm_configurations crm join teams t on crm.id = t.crm_id\nwhere 1=1\nAND t.current_billing_plan IS NOT NULL\nAND crm.auto_sync_activity = 0\nand crm.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,james.lewendon@exclaimer.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 270\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956\nSELECT * FROM crm_profiles WHERE user_id = 11446;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, alex.chikly@cygnetise.com\nselect * from playbooks where team_id = 372;\nselect * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340\nSELECT * FROM crm_field_values WHERE crm_field_id = 141340;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 372\nand sa.provider = 'salesforce';\n\nselect * from crm_profiles where crm_configuration_id = 300;\nSELECT * FROM crm_configurations WHERE team_id = 372;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,mfa@planday.com\nSELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756\nselect * from crm_field_data where object_id = 3207756;\nSELECT * FROM crm_fields WHERE id = 111834;\n\nselect f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value\nFROM crm_fields f\nJOIN crm_field_data fd ON f.id = fd.crm_field_id\nWHERE f.crm_configuration_id = 242\nAND f.object_type = 'opportunity'\nAND fd.object_id IN (3207756)\nORDER BY fd.object_id, fd.updated_at;\n\nSELECT * FROM crm_configurations WHERE auto_connect = 1;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,salesforce-admin@tourlane.com\nselect * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id\nwhere g.team_id = 187;\n\nselect * from `groups` where team_id = 187;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 187\nand sa.provider = 'salesforce';\n\n# Destination - 98870 - Destination__c\n# Stage - 79014 - StageName\n# Land Arrangement - 98856 - Land_Arrangement__c\n# Flight - 98848 - Flight__c\n# Last activity date - 98812 - LastActivityDate\n# Last modified date - 98809 - LastModifiedDate\n# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c\n# next call - 98864 - Next_Call__c\n\nselect * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\nselect * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';\nselect * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;\nselect * from activities where opportunity_id = 3538248;\n\nSELECT * FROM crm_profiles WHERE user_id = 8150;\n\nselect * from deal_risks where opportunity_id = 3538248;\n\nselect * from teams where crm_id IS NULL;\n\nSELECT opp.id AS opportunity_id,\n u.group_id AS group_id,\n MAX(\n CASE\n WHEN a.type IN (\"sms-inbound\", \"sms-outbound\") THEN a.created_at\n ELSE a.actual_end_time\n END) as last_date\nFROM opportunities opp\nleft join activities a on a.opportunity_id = opp.id\ninner join users u on opp.user_id = u.id\nwhere opp.user_id IN (9951)\n\nAND opp.is_closed = 0\nand a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL\ngroup by opp.id;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,polly.morphew@cybsafe.com\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 301;\nSELECT * FROM contacts WHERE id = 6612363;\nSELECT * FROM accounts WHERE id = 4235676;\nSELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;\nselect * from opportunity_stages where opportunity_id = 4503759;\n# SELECT * FROM opportunities WHERE id = 4569937;\n\nselect * from activities where crm_configuration_id = 301;\nSELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370\nSELECT * FROM participants WHERE activity_id = 26330370;\n\nSELECT * FROM teams WHERE id = 375;\nselect * from playbooks where team_id = 375;\n\nselect * from stages where crm_configuration_id = 301 and type = 'opportunity';\n\nselect * from teams;\nselect * from contact_roles;\n\nSELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';\n\nselect * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;\n\nSELECT * FROM crm_field_data WHERE object_id = 3771706;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'\nand crm_provider_id LIKE \"%traffic_light%\";\nSELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);\n\nSELECT fd.* FROM opportunities o\nJOIN crm_field_data fd ON o.id = fd.object_id\nWHERE o.team_id = 343\n# and o.user_id IS NOT NULL\nand fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)\nand fd.value != ''\norder by value desc\n# group by o.id\n;\n\nSELECT * FROM opportunities WHERE id = 3769843;\n\nSELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, salesforce-admin@tourlane.com\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 209;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,aswini.mishra@fundingcircle.com\nSELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839\n\n\nSELECT * FROM opportunities WHERE id = 3855992;\n\nSELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988\n\nSELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';\n\nselect * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507\nSELECT * FROM crm_field_data WHERE object_id = 5874411;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379\nand sa.provider = 'hubspot';\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, nikhil.kumar@mention-me.com\nSELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, salesforce-admin@tourlane.com\nSELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793\nselect * from generic_ai_prompts where subject_id = 3537793;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, triger@lunio.ai\nSELECT * FROM crm_configurations WHERE id = 97;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 97;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;\nSELECT * FROM crm_fields WHERE id = 32682;\n\nselect cfd.value, o.* from opportunities o\njoin crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682\nwhere team_id = 120\nand cfd.value != ''\n;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 120\nand sa.provider = 'salesforce';\n\nselect * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';\nSELECT * FROM crm_field_data WHERE object_id = 2313439;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 410;\nSELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';\nselect * from scorecards where team_id = 410;\nselect * from scorecard_rules;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, aswini.mishra@fundingcircle.com\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\njoin users u on o.user_id = u.id\nwhere a.crm_configuration_id = 177 and a.type LIKE '%email-out%'\n# and a.actual_end_time > '2024-12-16 00:00:00'\n# and o.remotely_created_at > '2024-12-01 00:00:00'\n# and u.group_id = 1014\nand u.id = 9021\norder by a.id desc;\nSELECT * FROM opportunities WHERE id in (3981384,4017346);\nSELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);\n\nselect * from users where id = 9021;\nselect * from inboxes where user_id = 9021;\n\nselect * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';\n\nselect * from email_messages where team_id = 220\nand orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'\nand subject LIKE '%Personal%'\n# and 'from' = 'credit@fundingcircle.com'\n;\n\nselect * from activities a\njoin opportunities o on a.opportunity_id = o.id\nwhere a.user_id = 9021 and a.type LIKE '%email-out%'\nand a.actual_end_time > '2024-12-18 00:00:00'\nand o.user_id IS NOT NULL\nand o.remotely_created_at > '2024-12-01 00:00:00'\norder by a.id desc;\n\nSELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;\nselect * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;\n\nselect * from team_settings where name IN ('useCloseDate');\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, jfarrell@hurree.co\nSELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 104\nand sa.provider = 'hubspot';\n\nselect * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'\nselect * from teams where crm_id IS NULL;\n\nselect t.name as 'team', u.name as 'owner', u.email, u.phone\nfrom teams t\njoin activity_providers ap on t.id = ap.team_id\njoin users u on t.owner_id = u.id\nwhere 1=1\n and t.status = 'active'\n and ap.is_enabled = 1\n# and u.status = 1\n and ap.provider = 'ms-teams';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nSELECT * FROM teams WHERE id = 442; # 14293\nselect * from users where team_id = 442;\nselect * from social_accounts sa where sa.sociable_id = 14293;\nselect * from invitations where team_id = 442;\n\n# ********************************************************************************************************\nSELECT * FROM users WHERE email LIKE '%nea.liikamaa@eletive.com%'; # 14022\nSELECT * FROM teams WHERE id = 429;\nselect * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);\nselect * from activities where opportunity_id in (4340436,4353519);\n\nselect * from transcription where activity_id IN (25630961,25381771);\nselect * from generic_ai_prompts where subject_id IN (4353519);\n\nSELECT\n a.id as activity_id,\n a.opportunity_id,\n a.type as activity_type,\n a.language,\n CONCAT(a.title, a.description) AS mail_content,\n e.from AS mail_from,\n e.to AS mail_to,\n e.subject AS mail_subject,\n e.body AS mail_body,\n p.type as prompt_type,\n p.status as prompt_status,\n p.content AS prompt_content,\n a.actual_start_time as created_at\nFROM activities a\n LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL\n LEFT JOIN email_messages e ON a.id = e.activity_id\nWHERE a.actual_start_time > '2024-01-01 00:00:00'\n AND a.opportunity_id IN (4353519)\n AND a.status IN ('completed', 'received', 'delivered')\n AND a.deleted_at IS NULL\n AND a.type NOT IN ('sms-inbound', 'sms-outbound')\nORDER BY a.opportunity_id ASC, a.id ASC;\n\nSELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293\nSELECT * FROM teams WHERE id = 442;\nSELECT * FROM crm_configurations WHERE id = 344;\nselect * from team_features where team_id = 442;\nselect * from groups where team_id = 442;\nselect * from playbooks where team_id = 442;\nselect * from playbook_categories where playbook_id = 1729;\nselect * from crm_fields where crm_configuration_id = 344 and id = 172024;\nSELECT * FROM crm_field_values WHERE crm_field_id = 172024;\nselect * from crm_layouts where crm_configuration_id = 344;\nselect * from playbook_layouts where playbook_id = 1729;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444\n\nselect s.*\n# , s.sent_at, u.name, a.*\nfrom activity_summary_logs s\ninner join activities a on a.id = s.activity_id\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 356\nand s.sent_at > date_sub(now(), interval 60 day)\norder by a.actual_end_time desc;\n\nselect * from activities a\n# inner join activity_summary_logs s on s.activity_id = a.id\nwhere a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)\n# and a.crm_provider_id is not null\n# and provider <> 'ringcentral'\nand status = 'completed'\norder by a.actual_end_time desc;\n\nselect * from teams order by id desc; # 17328, 32, 17830, integration-account@jiminny.com\nSELECT * FROM users;\nSELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active\nSELECT * FROM teams WHERE id = 260;\nselect * from team_settings where team_id = 260;\nselect * from crm_configurations where team_id = 260;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 356;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;\n\nselect * from accounts where crm_configuration_id = 221 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 221 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 221 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 221 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 221;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 221 order by id desc;\nselect * from stages where crm_configuration_id = 221 order by id desc;\n\nselect * from accounts where crm_configuration_id = 356 order by id desc; # 7000\nselect * from leads where crm_configuration_id = 356 order by id desc; # 0\nselect * from contacts where crm_configuration_id = 356 order by id desc; # 200 000\nselect * from opportunities where crm_configuration_id = 356 order by id desc; # 0\nselect * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23\nselect * from crm_fields where crm_configuration_id = 356;\nselect * from crm_field_values where crm_field_id = 5302 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 356 order by id desc;\nselect * from stages where crm_configuration_id = 356 order by id desc;\n\nselect * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)\nselect * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)\nselect * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4\nselect ce.* from calendars c\njoin users u on c.user_id = u.id\njoin calendar_events ce on c.id = ce.calendar_id\nwhere u.team_id = 260\nand (ce.start_time > '2025-02-21 00:00:00')\n;\n# calendar events 1207\n#\n\nselect * from opportunities where team_id = 260;\nSELECT * FROM crm_field_data WHERE object_id = 4696496;\n\nselect * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;\nselect * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')\n# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0\nand created_at > '2024-03-01 00:00:00'\norder by id desc; # 880 000, ringcentral, avaya\nSELECT * FROM participants WHERE activity_id = 26371744;\n\n# all activities 942 000 +\n# conference 7385 - scheduled 984 - external 343\n\nselect * from activities where id = 26321812;\nselect * from participants where activity_id = 26321812;\nselect * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);\nselect * from leads where id in (720428,689175,731546,645866,621037);\n\nselect * from users where id = 13841;\nselect * from opportunities where user_id = 9541;\nselect * from stages where id = 15900;\n\nselect * from accounts where\n# id IN (4160055,5053725,4965303,4896434)\nid in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)\n;\n\nselect * from activities where id = 26654935;\nSELECT * FROM opportunities WHERE id = 4803458;\n\nSELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;\nSELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time\nFROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);\n\nSELECT DISTINCT\n o.id, o.stage_id, s.name, a.title,\n a.*\nFROM activities a\n# INNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nINNER JOIN groups g ON u.group_id = g.id\nINNER JOIN opportunities o ON a.opportunity_id = o.id\nINNER JOIN stages s ON o.stage_id = s.id\nWHERE\n a.crm_configuration_id = 356\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 13841\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')\n AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')\n\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')\n )\n )\n AND (\n# s.id = 15900\n s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')\n OR s.uuid IS NULL -- Include records without opportunity stage\n )\n\nORDER BY a.actual_end_time DESC;\n# ********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, willsc@leadforensics.com\nSELECT * FROM users WHERE team_id = 190;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 190\nand sa.provider = 'hubspot';\n\nselect * from role_user where user_id = 8474;\n\nselect * from crm_configurations where provider = 'bullhorn';\n\nSELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;\nSELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;\n\nSELECT * FROM opportunities WHERE id = 4732493;\nselect * from activities where opportunity_id = 4732493;\n\n# ********************************************************************************************************\nSELECT * FROM teams WHERE id = 443; # 358, 14315, andrea.romano@correrenaturale.com\nSELECT * FROM opportunities WHERE team_id = 443;\n\nSELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id\nFROM activities AS a\nJOIN stages AS s ON a.stage_id = s.id\nJOIN users AS u ON u.id = a.user_id\nJOIN teams AS t ON t.id = s.team_id\nWHERE u.team_id <> s.team_id and t.id > 135;\n\n\nSELECT\n crm_configuration_id,\n crm_provider_id,\n COUNT(*) as duplicate_count,\n GROUP_CONCAT(id) as stage_ids,\n GROUP_CONCAT(name) as stage_names\nFROM stages\nGROUP BY crm_configuration_id, crm_provider_id\nHAVING COUNT(*) > 1\nORDER BY duplicate_count DESC;\n\nselect * from stages where id IN (14898,14907);\n\nselect * from business_processes;\n\nSELECT *\nFROM crm_configurations\nWHERE team_id IN (\n SELECT team_id\n FROM crm_configurations\n GROUP BY team_id\n HAVING COUNT(*) > 1\n)\nORDER BY team_id;\n\nSELECT *\nFROM teams\nWHERE crm_id IN (\n SELECT crm_id\n FROM teams\n GROUP BY crm_id\n HAVING COUNT(*) > 1\n)\nORDER BY crm_id;\n\n# ***************************************************************************\nselect * from crm_configurations where provider = 'integration-app';\nSELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 andrea.romano@correrenaturale.com\nselect * from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;\nselect * from team_features where team_id = 358;\nselect * from activity_summary_logs;\n\nselect * from teams where id = 406;\n\n# ************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, srv.salesforce@sportfive.com\nselect * from activities where crm_configuration_id = 202 order by actual_end_time desc;\n\nSELECT * FROM users where id = 14637;\nSELECT * FROM teams where id = 267;\nSELECT * FROM groups where id = 1118;\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 202\n AND status IN ('completed', 'failed')\n AND recording_state != 'stopped'\n AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n AND (is_private = 0 OR user_id = 14637)\n AND (\n (\n actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n ) OR (\n actual_start_time IS NULL\n AND type IN ('sms-outbound', 'sms-inbound')\n AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND NOT EXISTS (\n SELECT 1\n FROM tracks\n WHERE\n tracks.activity_id = activities.id\n AND tracks.type IN ('audio', 'video')\n )\nORDER BY actual_end_time DESC;\n\nSELECT DISTINCT\n a.*\nFROM activities a\nINNER JOIN tracks t ON a.id = t.activity_id\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams team ON u.team_id = team.id\nWHERE\n a.crm_configuration_id = 202\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n# and a.user_id = 14637\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND t.type IN ('audio', 'video')\n AND (\n (a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')\n OR\n (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'\n )\n )\n AND (\n a.is_private = 0\n OR (\n a.is_private = 1\n AND a.user_id = 14637\n )\n )\n\nORDER BY a.actual_end_time DESC\n;\n\nSELECT DISTINCT a.*\nFROM activities a\nINNER JOIN users u ON a.user_id = u.id\nINNER JOIN teams t ON u.team_id = t.id\n# INNER JOIN tracks tr ON a.id = tr.activity_id\n# INNER JOIN groups g ON u.group_id = g.id\nWHERE 1=1\n AND t.id = 267\n# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')\n AND a.status IN ('completed', 'failed')\n AND a.recording_state != 'stopped'\n AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n# AND tr.type NOT IN ('audio', 'video')\n AND (\n a.is_private = 0\n OR a.user_id = 14637\n )\n AND (\n (a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')\n OR (\n a.actual_start_time IS NULL\n AND a.type IN ('sms-outbound', 'sms-inbound')\n AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'\n )\n )\n# and NOT EXISTS (\n# SELECT 1\n# FROM tracks t\n# WHERE t.activity_id = a.id\n# AND t.type IN ('audio', 'video')\n# )\n\nORDER BY a.actual_end_time DESC;\n\nSELECT * FROM tracks WHERE activity_id = 26485995;\n\nselect a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\nwhere a.crm_configuration_id = 202\n# and a.is_internal = 0\nand (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type IN (\"softphone\",\"softphone-inbound\",\"conference\",\"sms-inbound\")\nand a.status IN ('completed', 'failed')\n# and a.external_id is not null\norder by a.actual_end_time desc;\n\nselect * from activities a where a.crm_configuration_id = 202\nand a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'\n# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')\n\nselect g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a\ninner join users u on u.id = a.user_id\ninner join groups g on g.id = u.group_id\nwhere a.crm_configuration_id = 202\nand a.is_internal = 0\nand (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')\nand a.type = 'conference'\nand a.status != 'completed'\nand a.external_id is not null\norder by a.scheduled_start_time desc;\n\nSELECT * FROM teams WHERE name LIKE '%Tourlane%';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';\nSELECT * FROM crm_field_data WHERE crm_field_id = 98809;\n\nselect * from users where status = 1 AND timezone = 'MDT';\n\nselect * from opportunities where id = 3769814;\nselect * from deal_risks where opportunity_id = 3769814;\n\nselect cp.* from crm_profiles cp\njoin users u on cp.user_id = u.id\njoin crm_configurations crm on cp.crm_configuration_id = crm.id\nwhere crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';\n\nselect * from crm_fields where id = 154575;\n\nselect * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';\nSELECT * FROM teams WHERE id = 176; # crm 148\nselect * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nselect * from crm_fields cf\njoin crm_configurations crm on crm.id = cf.crm_configuration_id\nwhere crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');\n\n# *********************************************************************************************\nSELECT * FROM users WHERE id IN (15415, 15418);\nSELECT * FROM groups WHERE id IN (1805,1806);\nSELECT * FROM playbooks WHERE id = 1860;\nSELECT * FROM playbook_categories WHERE id = 38634;\nSELECT * FROM crm_fields WHERE id = 189962;\n\nSELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 raza.gilani@vuelio.com\n\nSELECT * FROM crm_profiles WHERE user_id = 15415;\nSELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';\n\nselect * from sidekick_settings where team_id = 472;\n\nSELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418\nSELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415\nSELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415\n\n# *********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, salesforce-integrations@teamtailor.com\nselect * from crm_configurations where id = 218;\nSELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765\nSELECT * FROM users WHERE id IN (13232, 13230);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n0057R00000EPL5HQAX Inez Ekblad\n\n1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur\n\nSELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);\n\n############################################################################################\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id IN (94491,94493,94498);\nSELECT * FROM users WHERE id = 13658;\nSELECT * FROM teams WHERE id = 109;\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, katy.holden@strengthscope.comk\nSELECT * FROM stages WHERE crm_configuration_id = 390;\nselect * from business_processes where team_id = 481 and crm_configuration_id = 390;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 481\nand sa.provider = 'salesforce';\n\n\nSELECT * FROM users WHERE id = 15780; # team 462\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 462\nand sa.provider = 'hubspot';\n\n\nselect * from teams where id = 495;\nSELECT * FROM users WHERE id = 15794;\nselect * from social_accounts where sociable_id = 15794;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752\nSELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794\nSELECT * FROM activities WHERE crm_configuration_id = 407\nand status = 'completed' and type = 'conference'\norder by id desc;\n\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from permission_role;\n\nselect * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;\nSELECT * FROM activities WHERE id = 29512773;\nSELECT * FROM activities WHERE id IN (29042721,28991325,29002874);\n\nSELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 407\n# and a.id IN (29042721,28991325,29002874);\n\nSELECT * FROM users WHERE id = 15794;\nSELECT * FROM users WHERE team_id = 495;\nSELECT * FROM social_accounts WHERE sociable_id = 15794;\nSELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';\nSELECT * FROM contacts WHERE team_id = 495;\nSELECT * FROM leads WHERE team_id = 495;\nSELECT * FROM accounts WHERE team_id = 495;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 407;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 407;\nSELECT * FROM crm_configurations WHERE id = 407;\nSELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'\nand user_id IS NOT NULL and is_closed = 1 and is_won = 1;\n\n# ********************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103\nSELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064\nSELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');\n\n# *********************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 325\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085\nSELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733\nSELECT * FROM activity_summary_logs where activity_id = 28719733;\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444\nSELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';\nSELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630\nselect * from activities where crm_configuration_id = 356 and lead_id = 841732;\n\nSELECT * from activity_summary_logs al join activities a on a.id = al.activity_id\nwhere a.crm_configuration_id = 356;\n\nselect * from activities where crm_configuration_id = 356\nand actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'\norder by id desc;\n\nselect * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;\nselect * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\nselect * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;\n\nselect * from team_features where team_id = 260;\nselect * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);\n\nSELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;\n\nselect * from crm_fields;\nselect * from crm_layout_entities;\n\nSELECT * FROM teams WHERE name LIKE '%Optable%';\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969\nSELECT * FROM crm_configurations WHERE id = 218;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 109\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939\nSELECT * FROM crm_field_data WHERE activity_id = 28655939;\nSELECT * FROM crm_fields WHERE id in (94491,94493,94498);\n\nselect * from teams where crm_id IS NULL;\n\nSELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;\n\n# *************************************************************************************************\nselect * from team_domains where team_id = 399;\nSELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207\n\nselect * from calendar_events where id = 5163781;\nSELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896\nSELECT * FROM participants WHERE activity_id = 29443896;\nselect * from contacts where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\nselect * from leads where crm_configuration_id = 318 and email = 'marianne.westeng@strawberry.no';\n\nselect * from activities where user_id = 14937 order by created_at ;\n\nselect * from users where id = 14937;\n\nselect * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';\nselect * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';\n\nselect * from activities a join participants p on a.id = p.activity_id\nwhere crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';\n\n# *************************************************************************************************\nSELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';\nSELECT * FROM opportunities WHERE team_id = 379 order by id desc;\nSELECT * FROM teams WHERE id = 379;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 379 and sociable_id = 13852\nand sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE id = 307;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 307;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 307\n and id IN (144750,144855,145158,155227);\n\nSELECT * FROM activities;\n\n\nselect * from activities\nwhere created_at > '2025-07-01 00:00:00'\n# and created_at < '2025-08-01 00:00:00'\nand type not in ('email-outbound', 'email-inbound')\nand account_id is null\nand contact_id is null\nand lead_id is null\nand opportunity_id is not null\n;\nSELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);\nSELECT * FROM crm_configurations WHERE id in (335,301,200);\n\nselect * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';\n\nSELECT * FROM teams WHERE name LIKE '%Resights%';\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\n\nselect * from crm_configurations where provider = 'bullhorn'; # 344\nselect * from teams where id IN (442);\n\nselect * from activities\nwhere crm_configuration_id = 177\nand provider = 'amazon-connect'\n order by id desc;\n# and source <> 'gong';\n\nselect * from activity_providers where provider = 'amazon-connect';\n\nSELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;\n\n\nselect * from crm_configurations where store_transcript = 1;\nSELECT * FROM teams WHERE id IN (80);\n\n# *************************************************************************************************\nSELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 12594\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 277\nand sa.provider = 'salesforce';\n\nselect * from activities where crm_configuration_id = 213 and account_id = 2511502;\n\nselect * from crm_configurations where id = 213;\n\nSELECT * FROM activities WHERE uuid_to_bin('35aa790a-8569-4544-8268-66f9a4a26804') = uuid; # 33981604\nSELECT * FROM participants WHERE activity_id = 33981604;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 337 and object_type = 'task';\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 431\nand sa.provider = 'salesforce';\nSELECT * FROM activities WHERE uuid_to_bin('b5476c7d-19a8-491b-869d-676ea1e857b6') = uuid; # 33997223\nselect * from activity_summary_logs where activity_id = 33997223;\nselect * from activity_notes where activity_id = 33997223;\n\n# ***********************************\nSELECT * FROM teams WHERE name LIKE '%Abode%';\n\n\nselect * from features;\nselect * from teams t\nwhere t.status = 'active'\nand id NOT IN (select team_id from team_features where feature_id = 9)\n;\n\n\nselect * from playbook_layouts where playbook_id = 1725;\nSELECT * FROM activities WHERE uuid_to_bin('65cc283c-4849-49e6-927f-4c281c8fea19') = uuid; # 34297473\nselect * from teams where id = 318;\nselect * from crm_configurations where team_id = 318;\nselect * from playbooks where team_id = 318;\nSELECT * FROM crm_layouts where crm_configuration_id = 381;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1259;\nSELECT * FROM crm_fields WHERE id IN (192938,192936,192939);\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1266;\nSELECT * FROM crm_fields WHERE id IN (192980,192991,192997,192998,193064,193067);\n\nSELECT * FROM activities WHERE uuid_to_bin('a902289b-285c-48eb-9cc2-6ad6c5d938f5') = uuid; # 34297533\n\n\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nSELECT * FROM crm_fields WHERE id IN (131668,131669,131670,131671,131676,131797);\n\nSELECT * FROM teams WHERE name LIKE '%Peripass%'; # 351, 281, 12124\nselect * from crm_layouts where crm_configuration_id = 281;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 927;\nselect * from crm_fields where crm_configuration_id = 281 and id in (131668,131669,131670,131671,131676,131797);\nselect * from opportunities where crm_configuration_id = 281;\n\nSELECT * FROM activities WHERE id IN (34211315, 34130075);\nSELECT * FROM crm_field_data WHERE object_id IN (34211315, 34130075);\n\nselect cf.crm_configuration_id, cle.crm_layout_id, cle.id, cf.id from crm_field_data cfd\njoin crm_layout_entities cle on cle.id = cfd.crm_layout_entity_id\njoin crm_fields cf on cle.crm_field_id = cf.id\nwhere cf.deleted_at IS NOT NULL\nGROUP BY cle.id, cf.id;\n\nselect * from crm_layouts where id IN (355);\nselect u.email, t.crm_id, t.* from teams t\njoin users u on u.id = t.owner_id\nwhere crm_id IN (97);\n\nSELECT * FROM crm_fields WHERE id = 96492;\n\nselect * from permissions;\nselect * from permission_role where permission_id = 247;\nselect * from roles;\n\nselect * from migrations;\n# *****************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('291e3c21-11cc-4728-aee7-6e4bedf86d72') = uuid; # 34262174\nSELECT * FROM crm_configurations WHERE id = 301;\nSELECT * FROM teams WHERE id = 343;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 343\nand sa.provider = 'hubspot';\n\nselect * from participants where activity_id = 34262174;\n\nselect * from contacts where crm_configuration_id = 301 and id = 6976326;\nselect * from accounts where crm_configuration_id = 301 and id IN (4647626, 4815829); # 30761335403\n\nselect * from activity_summary_logs where activity_id = 34262174;\n\nselect * from users where status = 1 AND timezone = 'EST';\n\n# ****************************************************************************\nSELECT * FROM users WHERE id = 13869;\nSELECT * FROM crm_configurations WHERE id = 320;\nSELECT * FROM teams WHERE id = 401;\n\nSELECT * FROM activities WHERE uuid_to_bin('2228c16f-10be-48d5-90d4-67385219dc01') = uuid; # 29670601\n\nSELECT * FROM accounts WHERE id = 7761483;\nSELECT * FROM opportunities WHERE id = 6051814;\n\nSELECT * FROM teams WHERE name LIKE '%Seedlegals%';\n\n;select * from opportunities where updated_at > '2025-10-11' AND crm_provider_id = '34713761166';\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 177;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 577;\nSELECT * FROM crm_fields WHERE id IN (68458,68459,68480,68497,68524,68530,68554,68618,68662,68781,68810,68898,68981,69049,97467);\n\nSELECT t.id, crm.id, t.name, crm.sync_objects, crm.provider, crm.last_synced_at FROM crm_configurations crm join teams t on t.crm_id = crm.id\nwhere t.status = 'active' AND crm.provider = 'hubspot' AND crm.last_synced_at < '2025-10-22 00:00:00';\n\nSELECT * FROM activities WHERE uuid_to_bin('fa09449f-cba9-496a-b8f3-865cd3c72351') = uuid;\nSELECT * FROM crm_configurations where id = 184;\nSELECT * FROM teams WHERE id = 246;\nSELECT * FROM social_accounts WHERE sociable_id = 9259 and provider = 'hubspot';\n\nSELECT * FROM users WHERE email LIKE '%rhian.old@bud.co.uk%'; # 17700\nSELECT * FROM teams WHERE id = 551;\n\nSELECT * FROM crm_configurations WHERE id = 471;\nSELECT * FROM activities WHERE crm_configuration_id = 471 and crm_provider_id IS NOT NULL;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 471;\nSELECT * FROM crm_fields WHERE id = 307260;\nSELECT * FROM crm_field_values WHERE crm_field_id = 307260;\n\nselect * from crm_layouts where crm_configuration_id = 471;\n\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1547;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1548;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 551 and sa.provider = 'hubspot';\n\nSELECT * FROM teams WHERE name LIKE '%$PCS%';\n\n# ********************************************************************************************************\nselect * from crm_configurations crm\njoin teams t on t.crm_id = crm.id\nwhere t.status = 'active'\nand crm.provider = 'hubspot';\n\n# $slug = 'HUBSPOT_WEBHOOK_SYNC';\n# $team = Jiminny\\Models\\Team::find(2);\n# $feature = Feature::query()->where('slug', $slug)->first();\n# TeamFeature::query()->create(['feature_id' => $feature->getId(),'team_id' => $team->getId()]);\n\n# hubspot_webhook_metrics\n\nselect * from crm_configurations where id = 331; # 416\nSELECT * FROM teams WHERE id = 416;\nSELECT * FROM opportunities WHERE team_id = 190;\n\nSELECT * FROM teams WHERE name LIKE '%Lead Forensics%';\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 190 and sa.provider = 'hubspot';\n\n\n\nSELECT * FROM teams WHERE name LIKE '%Rapaport%'; # 431, 337\nSELECT * FROM teams where id = 431;\nSELECT * FROM crm_configurations where team_id = 431;\nSELECT * FROM activity_providers where team_id = 431;\nSELECT * FROM activities where crm_configuration_id = 337 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 431 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%BiP%'; # 401, 320\nSELECT * FROM teams where id = 401;\nSELECT * FROM crm_configurations where team_id = 401;\nSELECT * FROM activity_providers where team_id = 401;\nSELECT * FROM activities where crm_configuration_id = 320 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\nSELECT sa.id,\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 401 and sa.provider = 'salesforce';\n\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 307; # 379 - Story Terrace Inc , portalId: 3921157\nSELECT * FROM contacts WHERE team_id = 379 and updated_at > '2026-01-31 11:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 379 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 379 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; # 563 - LATUS Group (ad94d501-5d09-44fd-878f-ca3a9f8865c3) , portalId: 3904501\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 563 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 338; # 432 - Formalize , portalId: 9214205\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 432 and sa.provider = 'hubspot';\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 432 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 436; # 519 - Moxso , portalId: 25531989\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 519 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 96; # 119 - Nourish Care , portalId: 26617984\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-02 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 119 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 331; # 416 - The National College , portalId: 7213852\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 416 and updated_at > '2026-02-04 11:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 308; # 380 - Foodles , portalId: 7723616\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 380 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 379; # 471 - imat-uve , portalId: 9177354\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 471 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 465; # 545 - Spotler , portalId: 144759271\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 545 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 455; # 537 - indevis , portalId: 25666868\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 537 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 200; # 265 - Jobadder , portalId: 6426676\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 265 and updated_at > '2026-02-06 10:30:00' order by updated_at desc;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 335; # 429 - Eletive , portalId: 6110563\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 429 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 363; # 456 - Global Group , portalId: 8901981\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 456 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 297; # 369 - Unbiased , portalId: 9229005\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 369 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 353; # 449 - Fuuse , portalId: 25781745\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 449 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 487; # 566 - Nimbus , portalId: 39982590\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 566 and updated_at > '2026-02-09 10:30:00' order by updated_at desc;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 487;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1630;\nselect * from crm_fields where crm_configuration_id = 487 and\n(uuid_to_bin('4c6b2971-64d4-45b8-b377-427be758b5a5') = uuid or uuid_to_bin('59e368d8-65a0-4b77-b611-db37c99fbe68') = uuid);\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 420; # 506 - voiio , portalId: 145629154\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 506 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 479; # 558 - Momice , portalId: 535962\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 558 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 59; # 80 - Storyclash GmbH , portalId: 4268479\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 80 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 175; # 203 - Team iAM , portalId: 5534732\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 203 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 368; # 460 - OneTouch Health , portalId: 5534732183355\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 460 and updated_at > '2026-02-10 15:00:00' order by updated_at desc;\n\n\n\nselect * from users where id = 29643;\nSELECT * FROM crm_field_values WHERE crm_field_id = 375177;\n# ********************************************************************\nSELECT * FROM teams WHERE name LIKE '%Buynomics%'; # 462, 482, 14910\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\n# and description like '%The call focused on understanding Welch%'\norder by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 462 and sa.provider = 'salesforce';\n\nselect * from contacts where crm_configuration_id = 482 and name = 'Cyndall Hill'; # 15504749\nselect * from contacts where id = 10891096; # 482\nSELECT * FROM activities WHERE crm_configuration_id = 482\nand type NOT IN ('email-inbound', 'email-outbound')\nand contact_id = 15504749\norder by id desc;\n\nselect * from activities where id = 36793003; # 96cc7bc1-8622-4d27-92f4-baf664fc1a56, 00UOf00000PDdOXMA1\nselect * from transcription where id = 7646782;\nselect * from ai_prompts where transcription_id = 7646782;\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7a8471a3-847e-4822-802b-ddf426bbc252') = uuid; # 37370018\nSELECT * FROM activity_summary_logs WHERE activity_id = 37370018;\nSELECT * FROM teams WHERE id = 555;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 555 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('7c17b8aa-09df-4f85-a0f7-51f47afd712d') = uuid; # 37395250\nSELECT * FROM activities WHERE uuid_to_bin('14d60388-260d-494b-aa0d-63fdb1c78026') = uuid; # 37395250\n\nSELECT a.* FROM activities a JOIN crm_configurations c on c.id = a.crm_configuration_id\nwhere a.type IN ('softphone', 'softphone-outbound') and c.provider = 'hubspot'\nand a.provider NOT IN ('hubspot')\n# and a.provider IN ('salesloft')\n# and c.id NOT IN (70)\n# and a.duration > 30\n# and actual_start_time > '2026-02-05 00:00:00'\norder by a.id desc;\n\nSELECT * FROM activities WHERE id = 37549787;\nSELECT * FROM crm_profiles WHERE user_id = 17613;\n\nSELECT * FROM crm_configurations WHERE id = 70;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 93 and sa.provider = 'hubspot';\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations WHERE id = 373; # KPSBremen.de 465 # - no social account\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 465 and sa.provider = 'hubspot';\n\nselect * from crm_configurations where id = 494;\n\nSELECT * FROM teams WHERE name LIKE '%splose%'; # 572, 495, 18708\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 572 and sa.provider = 'pipedrive';\n\nselect * from opportunities where team_id = 572\n# and name like '%Onebright%'\n# and is_closed = 1 and is_won = 0\n order by id desc;\n\n\nselect * from users where deleted_at is null and status = 2;\n\nselect * from contacts where id = 17900517;\nselect * from accounts where id = 10109838;\nselect * from opportunities where id = 6955880;\n\nselect * from opportunity_contacts where opportunity_id = 6955880;\nselect * from opportunity_contacts where contact_id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nSELECT * FROM activities WHERE uuid_to_bin('adcb8331-5988-4353-834e-383a355abba2') = uuid; # 38056424, crm 104659682404\nselect * from teams where id = 456;\nSELECT * FROM crm_configurations WHERE id = 363;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 456 and sa.provider = 'hubspot';\n\nselect * from crm_layouts where crm_configuration_id = 363;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id IN (1203, 1204, 1635);\nSELECT * FROM crm_fields WHERE id IN (181536, 181538, 213455);\n\nSELECT * FROM teams WHERE name LIKE '%Electric%'; # 342, 272, 12767\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and name like 'NORTHUMBRIA POL%'; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 order by remotely_created_at asc; # and updated_at > '2025-07-01 00:00:00';\nSELECT * FROM opportunities WHERE crm_configuration_id = 272 and updated_at > '2026-01-01 00:00:00';\nSELECT * FROM crm_fields WHERE crm_configuration_id = 272 and object_type = 'opportunity';\nSELECT * FROM crm_field_values WHERE crm_field_id = 127164;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 342 and sa.provider = 'pipedrive';\n\nSELECT * FROM teams WHERE id = 472;\nSELECT * FROM crm_configurations WHERE id = 380;\nselect * from activities where id = 38285673; # 38285673\nSELECT * FROM users WHERE id = 16942;\nSELECT * FROM groups WHERE id = 1964;\nSELECT * FROM playbooks WHERE id = 2033;\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 499; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1678;\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\n\nSELECT * FROM activities WHERE uuid_to_bin('96b1261f-2357-49f9-ab38-23ce12008ea0') = uuid;\n\nselect * from contacts c\nwhere c.crm_configuration_id = 370 order by c.updated_at desc;\n\nSELECT * FROM participants where activity_id = 38833541;\nSELECT * FROM participants where activity_id = 39216301;\nSELECT * FROM activity_summary_logs where activity_id = 39216301;\nSELECT * FROM activities WHERE uuid_to_bin('c7d99fbe-1fb1-41f2-8f4d-52e2bf70e1e9') = uuid; # 38833541, crm 478116564181\nSELECT * FROM activities WHERE uuid_to_bin('2e6ff4d3-9faa-447a-a8c1-9acde4d885ae') = uuid; # 39216301, crm 480171536586\nselect * from crm_profiles where crm_configuration_id = 319 and crm_provider_id = 525785080;\nselect * from opportunities where crm_configuration_id = 319 and crm_provider_id = 410150124747;\nselect * from accounts where crm_configuration_id = 319 and crm_provider_id = 47150650569;\nselect * from contacts where crm_configuration_id = 319 and crm_provider_id IN ('665587441856', '742723347700');\n# owner 13236 525785080\n# contact 1 16779180 665587441856 - activity - Alex Howes alex@supportroom.com created 2026-01-26\n# contact 2 19247563 742723347700 - ash@supportroom.com 2026-03-24\n# company 4176133 47150650569\n# deal 7100953 410150124747\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 400 and sa.provider = 'hubspot';\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556; # owner: 18101, crm: 477\nselect * from crm_configurations where id = 477;\nSELECT * FROM users WHERE id = 18101;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'integration-app';\n\nselect * from opportunities where id = 7594349;\nselect * from opportunity_stages where opportunity_id = 7594349 order by created_at desc;\nselect * from business_processes where id = 6024;\nselect * from business_process_stages where stage_id = 16352;\nselect * from business_process_stages where business_process_id = 6024;\nselect * from stages where team_id = 459;\nselect * from teams where id = 459;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 459 and sa.provider = 'hubspot';\n\nSELECT os.stage_id, s.crm_provider_id, s.name, COUNT(*) as cnt\nFROM opportunity_stages os\nJOIN stages s ON s.id = os.stage_id\nWHERE os.opportunity_id = 7594349\nGROUP BY os.stage_id, s.crm_provider_id, s.name\nORDER BY cnt DESC;\n\nSELECT s.id, s.crm_provider_id, s.name, s.team_id, s.crm_configuration_id\nFROM stages s\nJOIN business_process_stages bps ON bps.stage_id = s.id\nWHERE bps.business_process_id = 6024\nAND s.crm_provider_id = 'contractsent';\n\nselect * from stages where id IN (16352,20612,18281,7344,16378,16309,5036,15223,14535,6293,12098,11607)\n\nSELECT * FROM teams WHERE name LIKE '%Pulsar Group%'; # 472, 380, 15138, raza.gilani@vuelio.com\nselect * from playbooks where team_id = 472; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 380;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 472 and sa.provider = 'salesforce';","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
347457365026322995
|
2146738311620114029
|
idle
|
accessibility
|
NULL
|
Checked out master
text/html
text/html
text/html
t Checked out master
text/html
text/html
text/html
text/html
Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
RequestGenerateAskJiminnyReportJobTest
Run 'RequestGenerateAskJiminnyReportJobTest'
Debug 'RequestGenerateAskJiminnyReportJobTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Listeners\Crm;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Str;
use Jiminny\Events\Playbooks\PlaybookCreated;
use Jiminny\Models\Crm\Field;
use Jiminny\Models\Crm\FieldValue;
use Jiminny\Models\PlaybookCategory;
use Jiminny\Repositories\Crm\FieldRepository;
use Jiminny\Repositories\PlaybookCategoryRepository;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Log;
use Jiminny\Services\ResolveTeamCrmConnection;
use stdClass;
use Throwable;
class ImportActivityTypes implements ShouldQueue
{
/**
* Create the event listener.
*/
public function __construct(
private readonly ResolveTeamCrmConnection $crmResolver,
private readonly FieldRepository $fieldRepository,
private readonly PlaybookCategoryRepository $repository,
) {
// nothing
}
/**
* Import the standard Event/Task Type picklist options from the CRM.
*/
public function handle(PlaybookCreated $event): void
{
$playbook = $event->playbook;
// Don't run if somehow we already have categories.
if ($playbook->getCategories()->isNotEmpty()) {
return;
}
$values = [];
try {
$crmService = $this->crmResolver->resolveForTeam($playbook->getTeam());
$crmService->syncField($playbook->getActivityField());
$values = $crmService->importPicklistValues($playbook->getActivityField());
} catch (Throwable $e) {
Log::warning('[ImportActivityTypes] CRM API failed, falling back to database values', [
'playbook_id' => $playbook->getId(),
'team_id' => $playbook->getTeamId(),
'error' => $e->getMessage(),
]);
}
if (empty($values)) {
$values = $this->fetchActivityFieldValues($playbook->getActivityField());
Log::info('[ImportActivityTypes] Using database fallback for categories', [
'playbook_id' => $playbook->getId(),
'field_values_count' => $values->count(),
]);
}
$createdCount = 0;
/** @var stdClass{label: string} $value */
foreach ($values as $value) {
$data = [
'name' => $value->label,
'enabled' => true,
'type' => PlaybookCategory::TYPE_ALL,
];
if (Str::contains(strtolower($value->label), ['sms sent', 'sms out', 'text in'])) {
$data['type'] = PlaybookCategory::TYPE_SMS_OUTBOUND;
}
if (Str::contains(strtolower($value->label), ['sms received', 'sms in', 'text out'])) {
$data['type'] = PlaybookCategory::TYPE_SMS_INBOUND;
}
$this->repository->create($playbook, $data);
$createdCount++;
}
if ($createdCount === 0) {
Log::warning('[ImportActivityTypes] No categories created for playbook', [
'playbook_id' => $playbook->getId(),
'team_id' => $playbook->getTeamId(),
'field_id' => $playbook->getActivityField()?->getId(),
]);
}
}
private function fetchActivityFieldValues(Field $field): Collection
{
/** @var Collection<FieldValue> */
return $this->fieldRepository->getPicklistValues($field);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
27
9
23
3
105
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM team_features where team_id = 1;
SELECT * FROM teams WHERE name LIKE '%Vixio%'; # 340,270,11922
SELECT * FROM users WHERE team_id = 340; # 12015
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 340
and sa.provider = 'salesforce';
# and sa.provider = 'salesloft';
select * from crm_fields where crm_configuration_id = 270 and object_type = 'event';
# 125558 - Event Type - Event_Type__c
# 125552 - Event Status - Event_Status__c
SELECT * FROM sidekick_settings WHERE team_id = 340;
SELECT * FROM crm_field_values WHERE crm_field_id in (125552);
select * from activities where crm_configuration_id = 270
and type = 'conference' and crm_provider_id IS NOT NULL
and actual_start_time > '2024-09-16 09:00:00' order by scheduled_start_time;
SELECT * FROM activities WHERE id = 20871677;
SELECT * FROM crm_field_data WHERE activity_id = 20871677;
select * from crm_layouts where crm_configuration_id = 270;
select * from crm_layout_entities where crm_layout_id in (886,887);
SELECT * FROM crm_configurations WHERE id = 270;
select * from playbooks where team_id = 340; # 1514
select * from groups where team_id = 340;
SELECT * FROM crm_fields WHERE id IN (125393, 125401);
select g.name as 'team name', p.name as 'playbook name', f.label as 'activity type field' from groups g
join playbooks p on g.playbook_id = p.id
join crm_fields f on p.activity_field_id = f.id
where g.team_id = 340;
SELECT * FROM activities WHERE uuid_to_bin('0c180357-67d2-419e-a8c3-b832a3490770') = uuid; # 20448716
select * from crm_field_data where object_id = 20448716;
select * from activities where crm_configuration_id = 270 and provider = 'salesloft' order by id desc;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%CybSafe%'; # 343,273,12008
select * from opportunities where team_id = 343;
select * from opportunities where team_id = 343 and crm_provider_id = '18099102526';
select * from opportunities where team_id = 343 and account_id = 945217482;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
select * from accounts where team_id = 343 order by name asc;
select * from stages where crm_configuration_id = 273 and type = 'opportunity';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Voyado%'; # 353,283,12143
SELECT * FROM activities WHERE crm_configuration_id = 283 and account_id = 3777844 order by id desc;
SELECT * FROM accounts WHERE team_id = 353 AND name LIKE '%Salesloft%';
SELECT * FROM activities WHERE id = 20717903;
select * from participants where activity_id IN (20929172,20928605,20928468,20926272,20926271,20926270,20926269,20916499,20916454,20916436,20916435,20900015,20900014,20900013,20897312,20897243,20897241,20897237,20897232,20897229,20893648,20893231,20893230,20893229,20893228,20889784,20885039,20885038,20885037,20885036,20885035,20882728,20882708,20882703,20882702,20869828,20869811,20869806,20869801,20869799,20869798,20869796,20869795,20869794,20869761,20869760,20869759,20868688,20868687,20850340,20847195,20841710,20833967,20827021,20825307,20825305,20825297,20824615,20824400,20823927,20821760,20795588,20794233,20794057,20793710,20785811,20781789,20781394,20781307,20762651,20758453,20758282,20757323,20756643,20756636,20756629,20756627,20756606,20756605,20756604,20756603,20756602,20756600,20756599,20756598,20756595,20756594,20756589,20756587,20756577,20756573,20748918,20748386,20748385,20748384,20748383,20748382,20748381,20748380,20748379,20748377,20748375,20748373,20743301,20717905,20717904,20717903,20717901,20717899);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 353
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%modern world business solutions%'; # 345,275,12016, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('3921d399-3fef-4609-a291-b0097a166d43') = uuid;
# id: 20940638, user: 12022, contact: 5305871
SELECT * FROM activity_summary_logs WHERE activity_id = 20940638;
select * from contacts where team_id = 345 and crm_provider_id = '30891432415' order by name asc; # 5305871
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 345
and sa.provider = 'hubspot';
select * from users where team_id = 345 and id = 12022;
SELECT * FROM crm_profiles WHERE user_id = 12022;
SELECT * FROM participants WHERE activity_id = 20940638;
SELECT * FROM users u
JOIN crm_profiles cp ON u.id = cp.user_id
WHERE u.team_id = 345;
select * from contacts where team_id = 345 and crm_provider_id = '30880813535' order by name desc; # 5305871
select * from team_features where team_id = 345;
SELECT * FROM activities WHERE uuid_to_bin('11701e2d-2f82-4dab-a616-1db4fad238df') = uuid; # 21115197
SELECT * FROM participants WHERE activity_id = 20897406;
SELECT * FROM activities WHERE uuid_to_bin('63ba55cd-1abc-447d-83da-0137000005b7') = uuid; # 20953912
SELECT * FROM activities WHERE crm_configuration_id = 275 and provider = 'ringcentral' and title like '%1252629100%';
SELECT * FROM activities WHERE id = 20946641;
SELECT * FROM crm_profiles WHERE user_id = 10211;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120,97,10984, [EMAIL]
SELECT * FROM opportunities WHERE crm_configuration_id = 97 and crm_provider_id = '006N1000006c5PpIAI';
select * from stages where crm_configuration_id = 97 and type = 'opportunity';
select * from opportunities where team_id = 120;
select * from crm_configurations crm join teams t on crm.id = t.crm_id
where 1=1
AND t.current_billing_plan IS NOT NULL
AND crm.auto_sync_activity = 0
and crm.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Exclaimer%'; # 270,205,10053,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 270
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('b54df794-2a9a-4957-8d80-09a600ead5f8') = uuid; # 21637956
SELECT * FROM crm_profiles WHERE user_id = 11446;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cygnetise%'; # 372,300,12554, [EMAIL]
select * from playbooks where team_id = 372;
select * from crm_fields where crm_configuration_id = 300 and object_type = 'event'; # 141340
SELECT * FROM crm_field_values WHERE crm_field_id = 141340;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 372
and sa.provider = 'salesforce';
select * from crm_profiles where crm_configuration_id = 300;
SELECT * FROM crm_configurations WHERE team_id = 372;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Planday%'; # 291,242,11501,[EMAIL]
SELECT * FROM opportunities WHERE team_id = 291 and crm_provider_id = '006bG000005DO86QAG'; # 3207756
select * from crm_field_data where object_id = 3207756;
SELECT * FROM crm_fields WHERE id = 111834;
select f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value
FROM crm_fields f
JOIN crm_field_data fd ON f.id = fd.crm_field_id
WHERE f.crm_configuration_id = 242
AND f.object_type = 'opportunity'
AND fd.object_id IN (3207756)
ORDER BY fd.object_id, fd.updated_at;
SELECT * FROM crm_configurations WHERE auto_connect = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150,[EMAIL]
select * from group_deal_risk_types drgt join groups g on drgt.group_id = g.id
where g.team_id = 187;
select * from `groups` where team_id = 187;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 187
and sa.provider = 'salesforce';
# Destination - 98870 - Destination__c
# Stage - 79014 - StageName
# Land Arrangement - 98856 - Land_Arrangement__c
# Flight - 98848 - Flight__c
# Last activity date - 98812 - LastActivityDate
# Last modified date - 98809 - LastModifiedDate
# Last inbound mail timestamp - 99151 - Last_Inbound_Mail_Timestamp__c
# next call - 98864 - Next_Call__c
select * from crm_fields where crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
select * from opportunities where team_id = 187 and name LIKE'%Muriel Sal%';
select * from opportunities where team_id = 187 and user_id = 9951 and is_closed = 0;
select * from activities where opportunity_id = 3538248;
SELECT * FROM crm_profiles WHERE user_id = 8150;
select * from deal_risks where opportunity_id = 3538248;
select * from teams where crm_id IS NULL;
SELECT opp.id AS opportunity_id,
u.group_id AS group_id,
MAX(
CASE
WHEN a.type IN ("sms-inbound", "sms-outbound") THEN a.created_at
ELSE a.actual_end_time
END) as last_date
FROM opportunities opp
left join activities a on a.opportunity_id = opp.id
inner join users u on opp.user_id = u.id
where opp.user_id IN (9951)
AND opp.is_closed = 0
and a.status IN ('completed', 'received', 'delivered') OR a.status IS NULL
group by opp.id;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Cybsafe%'; # 343,301,12008,[EMAIL]
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_profiles WHERE crm_configuration_id = 301;
SELECT * FROM contacts WHERE id = 6612363;
SELECT * FROM accounts WHERE id = 4235676;
SELECT * FROM opportunities WHERE crm_configuration_id = 301 and crm_provider_id = 32983784868;
select * from opportunity_stages where opportunity_id = 4503759;
# SELECT * FROM opportunities WHERE id = 4569937;
select * from activities where crm_configuration_id = 301;
SELECT * FROM activities WHERE uuid_to_bin('d3b2b28b-c3d0-4c2d-8ed0-eef42855278a') = uuid; # 26330370
SELECT * FROM participants WHERE activity_id = 26330370;
SELECT * FROM teams WHERE id = 375;
select * from playbooks where team_id = 375;
select * from stages where crm_configuration_id = 301 and type = 'opportunity';
select * from teams;
select * from contact_roles;
SELECT * FROM opportunities WHERE team_id = 343 and user_id = 12871 and close_date >= '2024-11-01';
select * from users u join crm_profiles cp on cp.user_id = u.id where u.team_id = 343;
SELECT * FROM crm_field_data WHERE object_id = 3771706;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 343
and sa.provider = 'hubspot';
SELECT * FROM crm_fields WHERE crm_configuration_id = 301 and object_type = 'opportunity'
and crm_provider_id LIKE "%traffic_light%";
SELECT * FROM crm_field_values WHERE crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531);
SELECT fd.* FROM opportunities o
JOIN crm_field_data fd ON o.id = fd.object_id
WHERE o.team_id = 343
# and o.user_id IS NOT NULL
and fd.crm_field_id IN (144020,144048,144111,144113,144126,144481,144508,144531)
and fd.value != ''
order by value desc
# group by o.id
;
SELECT * FROM opportunities WHERE id = 3769843;
SELECT * FROM teams WHERE name LIKE '%Tour%'; # 187,209,8150, [EMAIL]
SELECT * FROM crm_layouts WHERE crm_configuration_id = 209;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 682;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding Circle%'; # 220,177,8603,[EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('7a40e99b-3b37-4bb1-b983-325b81801c01') = uuid; # 23139839
SELECT * FROM opportunities WHERE id = 3855992;
SELECT * FROM users WHERE name LIKE '%Angus Pollard%'; # 8988
SELECT * FROM teams WHERE name LIKE '%Story Terrace%'; # 379, 307, 12894
SELECT * FROM crm_fields WHERE crm_configuration_id = 307 and object_type != 'opportunity';
select * from contacts where team_id = 379 and name like '%bebro%'; # 5874411, crm: 77229348507
SELECT * FROM crm_field_data WHERE object_id = 5874411;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379
and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%mentio%'; # 117, 94, 6371, [EMAIL]
SELECT * FROM activities WHERE uuid_to_bin('82939311-1af0-4506-8546-21e8d1fdf2c1') = uuid;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Tourlane%'; # 187, 209, 8150, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 187 and crm_provider_id = '006Se000008xfvNIAQ'; # 3537793
select * from generic_ai_prompts where subject_id = 3537793;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lunio%'; # 120, 97, 10984, [EMAIL]
SELECT * FROM crm_configurations WHERE id = 97;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 97;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 355;
SELECT * FROM crm_fields WHERE id = 32682;
select cfd.value, o.* from opportunities o
join crm_field_data cfd on o.id = cfd.object_id and cfd.crm_field_id = 32682
where team_id = 120
and cfd.value != ''
;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 120
and sa.provider = 'salesforce';
select * from opportunities where team_id = 120 and crm_provider_id = '006N1000007X8MAIA0';
SELECT * FROM crm_field_data WHERE object_id = 2313439;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 410;
SELECT * FROM teams WHERE name LIKE '%Local Business Oxford%';
select * from scorecards where team_id = 410;
select * from scorecard_rules;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Funding%'; # 220, 177, 8603, [EMAIL]
select * from activities a
join opportunities o on a.opportunity_id = o.id
join users u on o.user_id = u.id
where a.crm_configuration_id = 177 and a.type LIKE '%email-out%'
# and a.actual_end_time > '2024-12-16 00:00:00'
# and o.remotely_created_at > '2024-12-01 00:00:00'
# and u.group_id = 1014
and u.id = 9021
order by a.id desc;
SELECT * FROM opportunities WHERE id in (3981384,4017346);
SELECT * FROM users WHERE team_id = 220 and id IN (8775, 11435);
select * from users where id = 9021;
select * from inboxes where user_id = 9021;
select * from inbox_emails where inbox_id = 1349 and email_date > '2024-12-18 00:00:00';
select * from email_messages where team_id = 220
and orig_date > '2024-12-16 00:00:00' and orig_date < '2024-12-19 00:00:00'
and subject LIKE '%Personal%'
# and 'from' = '[EMAIL]'
;
select * from activities a
join opportunities o on a.opportunity_id = o.id
where a.user_id = 9021 and a.type LIKE '%email-out%'
and a.actual_end_time > '2024-12-18 00:00:00'
and o.user_id IS NOT NULL
and o.remotely_created_at > '2024-12-01 00:00:00'
order by a.id desc;
SELECT * FROM opportunities WHERE team_id = 220 and name LIKE '%Right Car move Limited%' and id = 3966852;
select * from activities where crm_configuration_id = 177 and type LIKE '%email%' and opportunity_id = 3966852 order by id desc;
select * from team_settings where name IN ('useCloseDate');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hurree%'; # 104, 81, 6175, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 104 and name = 'PropOp';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 104
and sa.provider = 'hubspot';
select * from crm_configurations where last_synced_at > '2025-01-19 01:00:00'
select * from teams where crm_id IS NULL;
select t.name as 'team', u.name as 'owner', u.email, u.phone
from teams t
join activity_providers ap on t.id = ap.team_id
join users u on t.owner_id = u.id
where 1=1
and t.status = 'active'
and ap.is_enabled = 1
# and u.status = 1
and ap.provider = 'ms-teams';
select * from crm_configurations where provider = 'bullhorn'; # 344
SELECT * FROM teams WHERE id = 442; # 14293
select * from users where team_id = 442;
select * from social_accounts sa where sa.sociable_id = 14293;
select * from invitations where team_id = 442;
# [PASSWORD_DOTS]
SELECT * FROM users WHERE email LIKE '%[EMAIL]%'; # 14022
SELECT * FROM teams WHERE id = 429;
select * from opportunities where team_id = 429 and crm_provider_id IN (16157415775, 22246219645);
select * from activities where opportunity_id in (4340436,4353519);
select * from transcription where activity_id IN (25630961,25381771);
select * from generic_ai_prompts where subject_id IN (4353519);
SELECT
a.id as activity_id,
a.opportunity_id,
a.type as activity_type,
a.language,
CONCAT(a.title, a.description) AS mail_content,
e.from AS mail_from,
e.to AS mail_to,
e.subject AS mail_subject,
e.body AS mail_body,
p.type as prompt_type,
p.status as prompt_status,
p.content AS prompt_content,
a.actual_start_time as created_at
FROM activities a
LEFT JOIN ai_prompts p ON a.transcription_id = p.transcription_id AND p.deleted_at IS NULL
LEFT JOIN email_messages e ON a.id = e.activity_id
WHERE a.actual_start_time > '2024-01-01 00:00:00'
AND a.opportunity_id IN (4353519)
AND a.status IN ('completed', 'received', 'delivered')
AND a.deleted_at IS NULL
AND a.type NOT IN ('sms-inbound', 'sms-outbound')
ORDER BY a.opportunity_id ASC, a.id ASC;
SELECT * FROM users WHERE name LIKE '%George Fierstone%'; # 14293
SELECT * FROM teams WHERE id = 442;
SELECT * FROM crm_configurations WHERE id = 344;
select * from team_features where team_id = 442;
select * from groups where team_id = 442;
select * from playbooks where team_id = 442;
select * from playbook_categories where playbook_id = 1729;
select * from crm_fields where crm_configuration_id = 344 and id = 172024;
SELECT * FROM crm_field_values WHERE crm_field_id = 172024;
select * from crm_layouts where crm_configuration_id = 344;
select * from playbook_layouts where playbook_id = 1729;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 221, 9444
select s.*
# , s.sent_at, u.name, a.*
from activity_summary_logs s
inner join activities a on a.id = s.activity_id
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 356
and s.sent_at > date_sub(now(), interval 60 day)
order by a.actual_end_time desc;
select * from activities a
# inner join activity_summary_logs s on s.activity_id = a.id
where a.crm_configuration_id = 356 and a.actual_end_time > date_sub(now(), interval 60 day)
# and a.crm_provider_id is not null
# and provider <> 'ringcentral'
and status = 'completed'
order by a.actual_end_time desc;
select * from teams order by id desc; # 17328, 32, 17830, [EMAIL]
SELECT * FROM users;
SELECT * FROM users where team_id = 260 and status = 1; # 201 - 150 active
SELECT * FROM teams WHERE id = 260;
select * from team_settings where team_id = 260;
select * from crm_configurations where team_id = 260;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 356;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1184;
select * from accounts where crm_configuration_id = 221 order by id desc; # 7000
select * from leads where crm_configuration_id = 221 order by id desc; # 0
select * from contacts where crm_configuration_id = 221 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 221 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 221 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 221;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 221 order by id desc;
select * from stages where crm_configuration_id = 221 order by id desc;
select * from accounts where crm_configuration_id = 356 order by id desc; # 7000
select * from leads where crm_configuration_id = 356 order by id desc; # 0
select * from contacts where crm_configuration_id = 356 order by id desc; # 200 000
select * from opportunities where crm_configuration_id = 356 order by id desc; # 0
select * from crm_profiles where crm_configuration_id = 356 order by id desc; # 23
select * from crm_fields where crm_configuration_id = 356;
select * from crm_field_values where crm_field_id = 5302 order by id desc;
select * from crm_layouts where crm_configuration_id = 356 order by id desc;
select * from stages where crm_configuration_id = 356 order by id desc;
select * from playbooks where team_id = 260 order by id desc; # 4 (2 deleted)
select * from groups where team_id = 260 order by id desc; # 27 groups, (2 deleted)
select * from playbook_layouts where playbook_id IN (1410,1409,1276,1254); # 4
select ce.* from calendars c
join users u on c.user_id = u.id
join calendar_events ce on c.id = ce.calendar_id
where u.team_id = 260
and (ce.start_time > '2025-02-21 00:00:00')
;
# calendar events 1207
#
select * from opportunities where team_id = 260;
SELECT * FROM crm_field_data WHERE object_id = 4696496;
select * from activities where crm_configuration_id = 356 and crm_provider_id IS NOT NULL;
select * from activities where crm_configuration_id IN (221) and provider NOT IN ('ms-teams', 'uploader', 'zoom-bot')
# and type = 'conference' and status = 'scheduled' and activities.is_internal = 0
and created_at > '2024-03-01 00:00:00'
order by id desc; # 880 000, ringcentral, avaya
SELECT * FROM participants WHERE activity_id = 26371744;
# all activities 942 000 +
# conference 7385 - scheduled 984 - external 343
select * from activities where id = 26321812;
select * from participants where activity_id = 26321812;
select * from participants where activity_id in (26414510,26414514,26414516,26414604,26414653,26414655);
select * from leads where id in (720428,689175,731546,645866,621037);
select * from users where id = 13841;
select * from opportunities where user_id = 9541;
select * from stages where id = 15900;
select * from accounts where
# id IN (4160055,5053725,4965303,4896434)
id in (4584518,3249934,3218025,3891133,3399450,4172999,4485161,3101785,4587203,3070816,2870343,2870341,3563940,4550846,3424464,3249963,2870342)
;
select * from activities where id = 26654935;
SELECT * FROM opportunities WHERE id = 4803458;
SELECT * FROM opportunities where team_id = 260 and user_id = 13841 AND stage_id = 15900;
SELECT id, uuid, provider, type, lead_id, account_id, contact_id, opportunity_id, stage_id, status, recording_state, title, actual_start_time, actual_end_time
FROM activities WHERE user_id = 13841 AND opportunity_id IN (4729783, 4731717, 4731726, 4732064, 4732849, 4803458, 4813213);
SELECT DISTINCT
o.id, o.stage_id, s.name, a.title,
a.*
FROM activities a
# INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
INNER JOIN groups g ON u.group_id = g.id
INNER JOIN opportunities o ON a.opportunity_id = o.id
INNER JOIN stages s ON o.stage_id = s.id
WHERE
a.crm_configuration_id = 356
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 13841
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
AND team.uuid = uuid_to_bin('a607fba7-452e-4683-b2af-00d6cb52c93c')
AND g.uuid = uuid_to_bin('b5d69e40-24a0-4c16-810b-5fa462299f94')
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-13 00:00:00' AND '2025-03-18 07:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND u.uuid = uuid_to_bin('6f40e4b8-c340-4059-b4ac-1728e87ea99e')
)
)
AND (
# s.id = 15900
s.uuid = uuid_to_bin('04ca1c26-c666-4268-a129-419c0acffd73')
OR s.uuid IS NULL -- Include records without opportunity stage
)
ORDER BY a.actual_end_time DESC;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Lead Forensics%'; # 190, 162, 8474, [EMAIL]
SELECT * FROM users WHERE team_id = 190;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 190
and sa.provider = 'hubspot';
select * from role_user where user_id = 8474;
select * from crm_configurations where provider = 'bullhorn';
SELECT * FROM opportunities WHERE uuid_to_bin('94578249-65ec-4205-90f2-7d1a7d5ab64a') = uuid;
SELECT * FROM users WHERE uuid_to_bin('26dbadeb-926f-4150-b11b-771b9d4c2f9a') = uuid;
SELECT * FROM opportunities WHERE id = 4732493;
select * from activities where opportunity_id = 4732493;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE id = 443; # 358, 14315, [EMAIL]
SELECT * FROM opportunities WHERE team_id = 443;
SELECT a.id, a.type, a.user_id, a.status, a.deleted_at, u.name, u.email, u.team_id as activity_team_id, u.status, u.deleted_at, t.name, t.status, s.team_id as stage_team_id
FROM activities AS a
JOIN stages AS s ON a.stage_id = s.id
JOIN users AS u ON u.id = a.user_id
JOIN teams AS t ON t.id = s.team_id
WHERE u.team_id <> s.team_id and t.id > 135;
SELECT
crm_configuration_id,
crm_provider_id,
COUNT(*) as duplicate_count,
GROUP_CONCAT(id) as stage_ids,
GROUP_CONCAT(name) as stage_names
FROM stages
GROUP BY crm_configuration_id, crm_provider_id
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
select * from stages where id IN (14898,14907);
select * from business_processes;
SELECT *
FROM crm_configurations
WHERE team_id IN (
SELECT team_id
FROM crm_configurations
GROUP BY team_id
HAVING COUNT(*) > 1
)
ORDER BY team_id;
SELECT *
FROM teams
WHERE crm_id IN (
SELECT crm_id
FROM teams
GROUP BY crm_id
HAVING COUNT(*) > 1
)
ORDER BY crm_id;
# [PASSWORD_DOTS]
select * from crm_configurations where provider = 'integration-app';
SELECT * FROM teams WHERE id = 443; # Correre Naturale 358 14315 [EMAIL]
select * from activities where crm_configuration_id = 358 order by actual_end_time desc;
select id, uuid, actual_end_time, crm_provider_id, is_internal, playbook_category_id, type, user_id, lead_id, contact_id, account_id, opportunity_id, status, title from activities where crm_configuration_id = 358 order by actual_end_time desc;
select * from team_features where team_id = 358;
select * from activity_summary_logs;
select * from teams where id = 406;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sportfive%'; # 267, 202, 14637, [EMAIL]
select * from activities where crm_configuration_id = 202 order by actual_end_time desc;
SELECT * FROM users where id = 14637;
SELECT * FROM teams where id = 267;
SELECT * FROM groups where id = 1118;
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM activities
WHERE crm_configuration_id = 202
AND status IN ('completed', 'failed')
AND recording_state != 'stopped'
AND type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
AND (is_private = 0 OR user_id = 14637)
AND (
(
actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
) OR (
actual_start_time IS NULL
AND type IN ('sms-outbound', 'sms-inbound')
AND created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND NOT EXISTS (
SELECT 1
FROM tracks
WHERE
tracks.activity_id = activities.id
AND tracks.type IN ('audio', 'video')
)
ORDER BY actual_end_time DESC;
SELECT DISTINCT
a.*
FROM activities a
INNER JOIN tracks t ON a.id = t.activity_id
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams team ON u.team_id = team.id
WHERE
a.crm_configuration_id = 202
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
# and a.user_id = 14637
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND t.type IN ('audio', 'video')
AND (
(a.actual_start_time BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59')
OR
(
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-12 12:00:00' AND '2025-03-24 11:59:59'
)
)
AND (
a.is_private = 0
OR (
a.is_private = 1
AND a.user_id = 14637
)
)
ORDER BY a.actual_end_time DESC
;
SELECT DISTINCT a.*
FROM activities a
INNER JOIN users u ON a.user_id = u.id
INNER JOIN teams t ON u.team_id = t.id
# INNER JOIN tracks tr ON a.id = tr.activity_id
# INNER JOIN groups g ON u.group_id = g.id
WHERE 1=1
AND t.id = 267
# AND t.uuid = uuid_to_bin('aed4927b-f1ea-499e-94c3-83762fd233e8')
AND a.status IN ('completed', 'failed')
AND a.recording_state != 'stopped'
AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
# AND tr.type NOT IN ('audio', 'video')
AND (
a.is_private = 0
OR a.user_id = 14637
)
AND (
(a.actual_start_time BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59')
OR (
a.actual_start_time IS NULL
AND a.type IN ('sms-outbound', 'sms-inbound')
AND a.created_at BETWEEN '2025-03-19 00:00:00' AND '2025-03-21 23:59:59'
)
)
# and NOT EXISTS (
# SELECT 1
# FROM tracks t
# WHERE t.activity_id = a.id
# AND t.type IN ('audio', 'video')
# )
ORDER BY a.actual_end_time DESC;
SELECT * FROM tracks WHERE activity_id = 26485995;
select a.is_private, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
where a.crm_configuration_id = 202
# and a.is_internal = 0
and (a.actual_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type IN ("softphone","softphone-inbound","conference","sms-inbound")
and a.status IN ('completed', 'failed')
# and a.external_id is not null
order by a.actual_end_time desc;
select * from activities a where a.crm_configuration_id = 202
and a.actual_start_time between '2025-03-20 00:00:00' and '2025-03-21 00:00:00'
# AND a.type IN ('softphone', 'softphone-inbound', 'conference', 'sms-inbound', 'sms-outbound')
select g.name, a.title, uuid_from_bin(a.uuid), a.external_id, a.status, a.recording_state, a.recording_reason_code, a.scheduled_start_time, a.scheduled_end_time, a.actual_start_time, a.actual_end_time from activities a
inner join users u on u.id = a.user_id
inner join groups g on g.id = u.group_id
where a.crm_configuration_id = 202
and a.is_internal = 0
and (a.scheduled_start_time between '2025-03-19 00:00:00' and '2025-03-21 00:00:00')
and a.type = 'conference'
and a.status != 'completed'
and a.external_id is not null
order by a.scheduled_start_time desc;
SELECT * FROM teams WHERE name LIKE '%Tourlane%';
SELECT * FROM crm_fields WHERE crm_configuration_id = 209 and object_type = 'opportunity';
SELECT * FROM crm_field_data WHERE crm_field_id = 98809;
select * from users where status = 1 AND timezone = 'MDT';
select * from opportunities where id = 3769814;
select * from deal_risks where opportunity_id = 3769814;
select cp.* from crm_profiles cp
join users u on cp.user_id = u.id
join crm_configurations crm on cp.crm_configuration_id = crm.id
where crm.provider = 'hubspot' AND u.status = 1 AND log_notes != 'none';
select * from crm_fields where id = 154575;
select * from team_features where feature = 'SUPPORTS_SYNC_MISSING_CALL_DISPOSITIONS';
SELECT * FROM teams WHERE id = 176; # crm 148
select * from activities where crm_configuration_id = 148 and provider = 'hubspot' order by id desc;
select * from activity_providers where provider = 'amazon-connect';
select * from crm_fields cf
join crm_configurations crm on crm.id = cf.crm_configuration_id
where crm.provider = 'hubspot' and cf.object_type IN ('account', 'contact');
# [PASSWORD_DOTS]
SELECT * FROM users WHERE id IN (15415, 15418);
SELECT * FROM groups WHERE id IN (1805,1806);
SELECT * FROM playbooks WHERE id = 1860;
SELECT * FROM playbook_categories WHERE id = 38634;
SELECT * FROM crm_fields WHERE id = 189962;
SELECT * FROM teams WHERE name = 'Pulsar Group'; # 472, 380, 15138 [EMAIL]
SELECT * FROM crm_profiles WHERE user_id = 15415;
SELECT * FROM social_accounts WHERE sociable_id = 15415 and provider = 'salesforce';
select * from sidekick_settings where team_id = 472;
SELECT * FROM activities WHERE uuid_to_bin('452c58c7-b87c-4fdd-953e-d7af185e9588') = uuid; # 28617536, user: 15418
SELECT * FROM activities WHERE uuid_to_bin('399114ee-d3a8-458c-bff5-5f654658db0a') = uuid; # 28344407, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('f0aa567f-0ab1-4bbb-96aa-37dcf184676b') = uuid; # 28580288, user: 15415
SELECT * FROM activities WHERE uuid_to_bin('50c086b1-2770-4bca-b5ae-6bac22ec426b') = uuid; # 28566069, user: 15415
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%TeamTailor%'; # 109, 218, 13969, [EMAIL]
select * from crm_configurations where id = 218;
SELECT * FROM activities WHERE uuid_to_bin('e39b5857-7fdb-4f5a-951a-8d3ca69bb1b0') = uuid; # 28338765
SELECT * FROM users WHERE id IN (13232, 13230);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
0057R00000EPL5HQAX Inez Ekblad
1091cb81-5ea1-4951-a0ed-f00b568f0140 Triman Kaur
SELECT * FROM crm_profiles WHERE user_id IN (13232, 13230);
############################################################################################
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939 00UVg00000FLvnSMAT
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id IN (94491,94493,94498);
SELECT * FROM users WHERE id = 13658;
SELECT * FROM teams WHERE id = 109;
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Strengthscope%'; # 481, 390, 15420, [EMAIL]
SELECT * FROM stages WHERE crm_configuration_id = 390;
select * from business_processes where team_id = 481 and crm_configuration_id = 390;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 481
and sa.provider = 'salesforce';
SELECT * FROM users WHERE id = 15780; # team 462
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 462
and sa.provider = 'hubspot';
select * from teams where id = 495;
SELECT * FROM users WHERE id = 15794;
select * from social_accounts where sociable_id = 15794;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Flight%'; # 427, 333, 13752
SELECT * FROM accounts WHERE team_id = 427 and crm_provider_id = '668731000183444517';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Group GTI%'; # 495, 407, 15794
SELECT * FROM activities WHERE crm_configuration_id = 407
and status = 'completed' and type = 'conference'
order by id desc;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from permission_role;
select * from activities where crm_configuration_id = 407 and status = 'completed' order by id desc;
SELECT * FROM activities WHERE id = 29512773;
SELECT * FROM activities WHERE id IN (29042721,28991325,29002874);
SELECT al.* from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 407
# and a.id IN (29042721,28991325,29002874);
SELECT * FROM users WHERE id = 15794;
SELECT * FROM users WHERE team_id = 495;
SELECT * FROM social_accounts WHERE sociable_id = 15794;
SELECT * FROM opportunities WHERE team_id = 495 and name like '%OC:%';
SELECT * FROM contacts WHERE team_id = 495;
SELECT * FROM leads WHERE team_id = 495;
SELECT * FROM accounts WHERE team_id = 495;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 407;
SELECT * FROM crm_fields WHERE crm_configuration_id = 407;
SELECT * FROM crm_configurations WHERE id = 407;
SELECT * FROM opportunities WHERE team_id = 495 and close_date BETWEEN '2025-06-01' AND '2025-07-01'
and user_id IS NOT NULL and is_closed = 1 and is_won = 1;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Hamilton Court FX LLP%'; # 249, 187, 10103
SELECT * FROM activities WHERE uuid_to_bin('4659c2bb-9a49-484e-9327-a3d66f1e028c') = uuid; # 28951064
SELECT * FROM crm_fields WHERE crm_configuration_id = 187 and object_type IN ('tasks', 'event');
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Checkstep%'; # 325, 256, 11753
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 325
and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid; # 28611085
SELECT * FROM activities WHERE uuid_to_bin('980f0336-840b-4185-a5a9-30cf8b0749a8') = uuid; # 28719733
SELECT * FROM activity_summary_logs where activity_id = 28719733;
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Learning%'; # 260, 356, 9444
SELECT * FROM activity_summary_logs where sent_at BETWEEN '2025-06-09 11:38:00' AND '2025-06-09 11:40:00';
SELECT * FROM leads WHERE crm_configuration_id = 356 and crm_provider_id = '230045001502770504'; # 823630
select * from activities where crm_configuration_id = 356 and lead_id = 841732;
SELECT * from activity_summary_logs al join activities a on a.id = al.activity_id
where a.crm_configuration_id = 356;
select * from activities where crm_configuration_id = 356
and actual_end_time between '2025-06-09 11:00:00' and '2025-06-09 12:00:00'
order by id desc;
select * from accounts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from leads where crm_configuration_id = 356 and crm_provider_id = '230045001514275654' order by id desc;
select * from contacts where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from opportunities where crm_configuration_id = 356 and crm_provider_id = '230045001514403366' order by id desc;
select * from team_features where team_id = 260;
select * from features where id IN (1,2,4,6,18,19,20,9,10,3,23,24,25,26,27);
SELECT * FROM activities WHERE uuid_to_bin('7be372e2-1916-4d79-a2f3-ca3db1346db3') = uuid;
select * from crm_fields;
select * from crm_layout_entities;
SELECT * FROM teams WHERE name LIKE '%Optable%';
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Teamtailor%'; # 109, 218, 13969
SELECT * FROM crm_configurations WHERE id = 218;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 109
and sa.provider = 'salesforce';
SELECT * FROM activities WHERE uuid_to_bin('675eeaeb-5681-42db-90bc-54c07a604408') = uuid; # 28655939
SELECT * FROM crm_field_data WHERE activity_id = 28655939;
SELECT * FROM crm_fields WHERE id in (94491,94493,94498);
select * from teams where crm_id IS NULL;
SELECT * FROM activities WHERE uuid_to_bin('71aa8a0c-9652-4ff6-bee7-d98ae60abef6') = uuid;
# [PASSWORD_DOTS]
select * from team_domains where team_id = 399;
SELECT * FROM teams WHERE name LIKE '%Rydoo%'; # 399, 318, 13207
select * from calendar_events where id = 5163781;
SELECT * FROM activities WHERE uuid_to_bin('be2cbc52-7fda-46a0-9ae0-25d9553eafc0') = uuid; # 29443896
SELECT * FROM participants WHERE activity_id = 29443896;
select * from contacts where crm_configuration_id = 318 and email = '[EMAIL]';
select * from leads where crm_configuration_id = 318 and email = '[EMAIL]';
select * from activities where user_id = 14937 order by created_at ;
select * from users where id = 14937;
select * from contacts where crm_configuration_id = 318 and email LIKE '%@strawberry.se';
select * from opportunities where crm_configuration_id = 318 and crm_provider_id = '006Sf00000D1WOAIA3';
select * from activities a join participants p on a.id = p.activity_id
where crm_configuration_id = 318 and a.updated_at > '2025-06-23T08:18:43Z';
# [PASSWORD_DOTS]
SELECT * FROM opportunities WHERE team_id = 379 and crm_provider_id = '39334518886';
SELECT * FROM opportunities WHERE team_id = 379 order by id desc;
SELECT * FROM teams WHERE id = 379;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 379 and sociable_id = 13852
and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE id = 307;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 307;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1027;
SELECT * FROM crm_fields WHERE crm_configuration_id = 307
and id IN (144750,144855,145158,155227);
SELECT * FROM activities;
select * from activities
where created_at > '2025-07-01 00:00:00'
# and created_at < '2025-08-01 00:00:00'
and type not in ('email-outbound', 'email-inbound')
and account_id is null
and contact_id is null
and lead_id is null
and opportunity_id is not null
;
SELECT * FROM activities WHERE id IN (25344155, 25344296, 25501909, 28692187);
SELECT * FROM crm_configurations WHERE id in (335,301,200);
select * from crm_fields where crm_configuration_id = 230 and crm_provider_id = 'Age2__c';
SELECT * FROM teams WHERE name LIKE '%Resights%';
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_configurations where provider = 'bullhorn'; # 344
select * from teams where id IN (442);
select * from activities
where crm_configuration_id = 177
and provider = 'amazon-connect'
order by id desc;
# and source <> 'gong';
select * from activity_providers where provider = 'amazon-connect';
SELECT * FROM activities WHERE uuid_to_bin('cec1993b-a7e5-4164-b74d-d680ea51d2f2') = uuid;
select * from crm_configurations where store_transcript = 1;
SELECT * FROM teams WHERE id IN (80);
# [PASSWORD_DOTS]
SELECT * FROM teams WHERE name LIKE '%Sedna%'; # 277, 213, 1259...
|
49276
|